Skip to content

Instantly share code, notes, and snippets.

@jabb3rd
Created November 1, 2015 11:44
Show Gist options
  • Save jabb3rd/c3e5528786e4cc777722 to your computer and use it in GitHub Desktop.
Save jabb3rd/c3e5528786e4cc777722 to your computer and use it in GitHub Desktop.
PushAll.Ru support for Synology DSM
<?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