Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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("" % 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