Skip to content

Instantly share code, notes, and snippets.

@chew-z
Last active February 15, 2016 15:14
Show Gist options
  • Save chew-z/fddb79f6b7c9f434f2b9 to your computer and use it in GitHub Desktop.
Save chew-z/fddb79f6b7c9f434f2b9 to your computer and use it in GitHub Desktop.
Send Notifications via Pushover (from Pythonista on iOS)
# coding: utf-8
# send Pushover notifications
import requests
import keychain
def pushNotification(message, title='', url='', url_title=''):
pushover_url = 'https://api.pushover.net/1/messages.json'
payload = {
'token': keychain.get_password('Pushover', 'token'),
'user': keychain.get_password('Pushover', 'user'),
'message': message,
'title': title,
'url': url,
'url_title': url_title
}
return requests.post(pushover_url, data=payload).text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment