Skip to content

Instantly share code, notes, and snippets.

@christianmondabon
Last active April 19, 2018 14:07
Show Gist options
  • Save christianmondabon/08362d6b7cdc58ec009d19b360cfc65e to your computer and use it in GitHub Desktop.
Save christianmondabon/08362d6b7cdc58ec009d19b360cfc65e to your computer and use it in GitHub Desktop.
send pushover message (message is 1st command line parameter)
import http.client, urllib
conn = http.client.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.parse.urlencode({
"token": "APP_TOKEN",
"user": "USER_KEY",
"message": str(sys.argv[1]),
}), { "Content-type": "application/x-www-form-urlencoded" })
conn.getresponse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment