-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpushover.php
38 lines (30 loc) · 838 Bytes
/
pushover.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* A PHP parser/watcher/notifier of DigiKey stock status for P/N list
* @package pushover
* @author Dmitry Murzinov (kakstattakim@gmail.com)
* @link : https://github.com/iDoka/digikey-cool-stuff
* @version 1.0
*/
function pushover($message){
$userkey="o4d3rskldmgvbsjknfw3jy7zkxun";
$apikey="sfatxii5ogkjkl3yzqtmm63wvgnd";
$device="iphone-idoka";
$title="DigiKey";
curl_setopt_array($ch = curl_init(), array(
'CURLOPT_URL' => "https://api.pushover.net/1/messages.json",
'CURLOPT_POSTFIELDS' => array(
"token" => $apikey,
"user" => $userkey,
"device" => $device,
"title" => $title,
"message" => $message,
),
'CURLOPT_SAFE_UPLOAD' => true,
'CURLOPT_RETURNTRANSFER' => true,
));
curl_exec($ch);
curl_close($ch);
return 0;
}
?>