So on my Raspberry Pi with Motioneye (not OS) installed and I'm trying to get the Pushover Notification to work. The problem is on Raspbian I'm not sure where to put the python script. I've put it in /usr/local/bin
, /usr/bin
but no matter where I place the script it never activates.
the pushover.py looks like this:
#!/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: [email protected] #
# Like me: facebook.com/raspberrycoulis #
#################################################################################
import httplib, urllib
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
"token": "my api token" # Insert app token here
"user": "My 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()
When I try to execute the python script I get:
File "./pushover.py", line 20
"user": "My token", # Insert user token here
^
SyntaxError: invalid syntax