Created
November 1, 2015 11:44
-
-
Save jabb3rd/c3e5528786e4cc777722 to your computer and use it in GitHub Desktop.
PushAll.Ru support for Synology DSM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo time(); | |
if ($_SERVER['HTTP_HOST'] != 'localhost') { | |
die; | |
} | |
$options = array( | |
'type' => 'self', | |
'id' => isset($_GET['id']) ? $_GET['id'] : false, | |
'key' => isset($_GET['key']) ? $_GET['key'] : false, | |
'title' => isset($_GET['title']) ? $_GET['title'] : false, | |
'text' => isset($_GET['text']) ? $_GET['text'] : false | |
); | |
$options = array_filter($options); | |
if (count($options) != 5) { | |
echo 'invalid options'; | |
die; | |
} | |
curl_setopt_array($ch = curl_init(), array( | |
CURLOPT_URL => "https://pushall.ru/api.php", | |
CURLOPT_POSTFIELDS => $options | |
)); | |
$return = curl_exec($ch); | |
curl_close($ch); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment