Last active
December 13, 2018 02:35
-
-
Save necenzurat/cea3a3235ee9fb65556d03985f087fdf to your computer and use it in GitHub Desktop.
simple prowl app notifier
This file contains 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 | |
$url = 'https://api.prowlapp.com/publicapi/add'; | |
$fields = array( | |
'apikey' => 'API_KEY', | |
'application' => 'APP', | |
'event' => "jobs done", | |
'description' => "TeXT", | |
// https://www.prowlapp.com/api.php | |
// meh | |
); | |
$fields_string = ''; | |
foreach($fields as $key=>$value) { | |
$fields_string .= $key.'='.urldecode($value).'&'; | |
} | |
rtrim($fields_string, '&'); | |
//open connection | |
$ch = curl_init(); | |
//set the url, number of POST vars, POST data | |
curl_setopt($ch,CURLOPT_URL, $url); | |
curl_setopt($ch,CURLOPT_POST, count($fields)); | |
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); | |
//execute post | |
$result = curl_exec($ch); | |
//close connection | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment