Skip to content

Instantly share code, notes, and snippets.

@vmitchell85
Created February 27, 2014 17:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save vmitchell85/9255191 to your computer and use it in GitHub Desktop.
import httplib, urllib, sys
apiKey = sys.argv[1]
userKey = sys.argv[2]
priority = sys.argv[3]
title = sys.argv[4]
msg = ''
for count, arg in enumerate(sys.argv):
if count > 4:
msg += arg + '\n'
conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
"token": apiKey,
"user": userKey,
"message": msg,
"title": title,
"priority": priority,
"retry":"30",
"expire":"3600"
}),
{ "Content-type": "application/x-www-form-urlencoded" })
response = conn.getresponse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment