Skip to content

Instantly share code, notes, and snippets.

@abi
Created January 17, 2010 03:19
Show Gist options
  • Save abi/279183 to your computer and use it in GitHub Desktop.
Save abi/279183 to your computer and use it in GitHub Desktop.
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