Created
January 17, 2010 03:19
-
-
Save abi/279183 to your computer and use it in GitHub Desktop.
This file contains 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
import urllib | |
import hashlib | |
from google.appengine.api import urlfetch | |
API_KEY = "[REPLACE WITH YOUR API KEY]" | |
# More information on how notify.io notification sending works - | |
# http://groups.google.com/group/notify-io/web/developers | |
payload= {'text' : "some text", | |
'title' : "title", | |
'icon' : "icon", | |
'link' : "link"} | |
to = "[REPLACE WITH USER EMAIL]" | |
# Get the email, hash it send with notify.io | |
m = hashlib.md5() | |
m.update(to) | |
url = "http://api.notify.io/v1/notify/" + m.hexdigest() | |
authString = 'Basic ' + base64.b64encode( API_KEY + ":string") | |
payload= urllib.urlencode(payload) | |
data = urlfetch.fetch(url, payload=payload, method=urlfetch.POST, headers={'Authorization' : authString}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment