-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpushover.py
More file actions
executable file
·28 lines (25 loc) · 1.6 KB
/
pushover.py
File metadata and controls
executable file
·28 lines (25 loc) · 1.6 KB
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
#!/usr/bin/python
#################################################################################
# Created by Wesley Archer (aka. Raspberry Coulis) to enable push notifications #
# via Pushover.net in MotionEyeOS. See Pushover's API FAQ for more detailed use #
# Also featured on Pi-Supply.com's Maker Zone. #
# #
# Follow me: @RaspberryCoulis #
# Visit me: raspberrycoulis.co.uk #
# Email me: wesley@raspberrycoulis.co.uk #
# Like me: facebook.com/raspberrycoulis #
#################################################################################
import httplib, urllib
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
"token": "APP_TOKEN", # Insert app token here
"user": "USER_TOKEN", # Insert user token here
"html": "1", # 1 for HTML, 0 to disable
"title": "Motion Detected!", # Title of the message
"message": "<b>Front Door</b> camera!", # Content of the message
"url": "http://IP.ADD.RE.SS", # Link to be included in message
"url_title": "View live stream", # Text for the link
"sound": "siren", # Define the sound played
}), { "Content-type": "application/x-www-form-urlencoded" })
conn.getresponse()