Skip to content

Instantly share code, notes, and snippets.

@chrisle
Created August 14, 2012 13:08
Show Gist options
  • Save chrisle/3349103 to your computer and use it in GitHub Desktop.
Save chrisle/3349103 to your computer and use it in GitHub Desktop.
Facebook Likes for Excel using DataNitro
""" 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