two pushover apps
This commit is contained in:
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys
|
||||
import httplib, urllib
|
||||
|
||||
def pushover(msg):
|
||||
conn = httplib.HTTPSConnection("api.pushover.net:443")
|
||||
conn.request("POST", "/1/messages.json",
|
||||
urllib.urlencode({
|
||||
"token": "aNY2xeYydxzabzihTjb3P2LMHhqhr2",
|
||||
"user": "uDhH33UjQQDYtNzJb1ThRiWb9ingGK",
|
||||
"message": msg,
|
||||
}), { "Content-type": "application/x-www-form-urlencoded" })
|
||||
r1=conn.getresponse()
|
||||
#print r1.status, r1.reason
|
||||
return r1.status == 200
|
||||
|
||||
|
||||
v=" ".join(sys.argv[1:])
|
||||
if pushover(v):
|
||||
print "delivered"
|
||||
else:
|
||||
print "NOT delivered"
|
||||
Reference in New Issue
Block a user