-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.php
More file actions
29 lines (23 loc) · 843 Bytes
/
sample.php
File metadata and controls
29 lines (23 loc) · 843 Bytes
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
<?php
require dirname(__FILE__).'/pushover.class.php';
$pushover = new pushover(array('apiToken' => 'xxxXXXxxx_PUT-YOUR-APPLICATION-KEY-HERE_xxxXXXxxx'));
/*
* Sample code
* Notification Sending
*
*/
$user = "xxxXXXxxx_PUT-YOUR-USER/GROUP-KEY-HERE_xxxXXXxxx";
$message = "Checkout this awesome php5 api for Pushover that doen't even require cURL !";
// Optional Params
$option['title'] = "Aweosme Api for Pushover";
$option['url'] = "https://github.com/mcraz/php5-pushover";
$option['url_title'] = "Project on Github";
$option['priority'] = 1;
$option['timestamp'] = time();
$option['sound'] = "pianobar";
// Sending notification if user valid validating
if($pushover->validate($user))
$ApiResopnse = ($pushover->notify($user,$message,$option));
else
$ApiResopnse = "Invalid User/Group Key";
print_r($ApiResopnse);