Skip to content

Commit

Permalink
Merge pull request Julienh#80 from Sire/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Julienh committed Sep 17, 2012
2 parents 3c75eb6 + eea3c25 commit 4962084
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions jquery.sharrre.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,12 @@
================================================== */
urlJson = {
googlePlus: "",
facebook: "http://graph.facebook.com/?id={url}&callback=?",

//new FQL method by Sire
facebook: "https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?",
//old method facebook: "http://graph.facebook.com/?id={url}&callback=?",
//facebook : "http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&urls={url}&format=json"

twitter: "http://cdn.api.twitter.com/1/urls/count.json?url={url}&callback=?",
digg: "http://services.digg.com/2.0/story.getInfo?links={url}&type=javascript&callback=?",
delicious: 'http://feeds.delicious.com/v2/json/urlinfo/data?url={url}&callback=?',
Expand Down Expand Up @@ -452,11 +456,9 @@
temp = temp.replace('\u00c2\u00a0', ''); //remove google plus special chars
count += parseInt(temp, 10);
}
else if(typeof json.likes !== "undefined"){ //Facebook Fan page
count += parseInt(json.likes, 10); //changed shares to likes to use with fanPage url
}
else if(typeof json.shares !== "undefined"){ //Facebook
count += parseInt(json.shares, 10);
//get the FB total count (shares, likes and more)
else if(json.data && json.data.length > 0 && typeof json.data[0].total_count !== "undefined"){ //Facebook total count
count += parseInt(json.data[0].total_count, 10);
}
else if(typeof json[0] !== "undefined"){ //Delicious
count += parseInt(json[0].total_posts, 10);
Expand Down

0 comments on commit 4962084

Please sign in to comment.