Skip to content

Instantly share code, notes, and snippets.

@clarkbw
Created April 21, 2010 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clarkbw/84e062e131c51647d63b to your computer and use it in GitHub Desktop.
Save clarkbw/84e062e131c51647d63b to your computer and use it in GitHub Desktop.
import email, json, urllib2
msg = email.message_from_file(open('facebook.eml'))
fb_notifiy = [tuple(t.strip().split("=")) for t in msg.get('X-Facebook-Notify').split(";")]
# example fb_notify
# [('event_wall',), ('eid', '14102494623'), ('from', '21602578'), ('mailid', '12bf28cG149a112G63016bG21')]
from_identity = json.load(urllib2.urlopen("http://graph.facebook.com/%s" % fb_notify[2][1]))
# example from_identity
# {u'first_name': u'Bryan', u'last_name': u'Clark', u'id': u'21602578', u'name': u'Bryan Clark'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment