Created
September 8, 2011 10:57
-
-
Save njvitto/1203139 to your computer and use it in GitHub Desktop.
Useful script to ask Facebook social graph for how many likes gived an URL
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
<script type="text/javascript"> | |
FB.api('/', {id: "<%= @url_for_FB %>"} ,function(response) { | |
fb_shares = "0"; | |
if(typeof(response.shares)!=='undefined' && response.shares!=null) | |
fb_shares = response.shares; | |
$("FB_shares").update(fb_shares); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment