Created
August 14, 2012 13:08
-
-
Save chrisle/3349103 to your computer and use it in GitHub Desktop.
Facebook Likes for Excel using DataNitro
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
""" Facebook likes for Excel using DataNitro | |
[email protected] | |
http://www.seeinteractive.com/blog/get-facebook-likes-in-excel-using-datanitro | |
""" | |
import urllib2 | |
import json | |
def facebook_likes(url): | |
facebook_url = "https://graph.facebook.com/?ids=" + url | |
raw_data = urllib2.urlopen(facebook_url).read() | |
formatted_data = json.loads(raw_data) | |
likes = formatted_data[url].get('shares', 0) | |
return likes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment