Last active
February 15, 2016 15:14
-
-
Save chew-z/fddb79f6b7c9f434f2b9 to your computer and use it in GitHub Desktop.
Send Notifications via Pushover (from Pythonista on iOS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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