-
-
Save clarkbw/84e062e131c51647d63b 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 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