Skip to content

Commit

Permalink
Shares: Fix facebook likes count url
Browse files Browse the repository at this point in the history
  • Loading branch information
tabalinas committed May 17, 2015
1 parent 0886d41 commit e4d0740
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/jssocials.shares.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
label: "Like",
logo: "fa fa-facebook",
shareUrl: "https://facebook.com/sharer/sharer.php?u={url}",
countUrl: "https://graph.facebook.com/?id={url}&callback=?",
countUrl: function() {
return "https://graph.facebook.com/fql?q=SELECT total_count FROM link_stat WHERE url='" + window.encodeURIComponent(this.url) + "'";
},
getCount: function(data) {
return data.shares;
return (data.data.length && data.data[0].total_count) || 0;
}
},

Expand Down

0 comments on commit e4d0740

Please sign in to comment.