Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Facebook Share count not working #24

Open
rrfranco92 opened this issue Aug 18, 2016 · 3 comments
Open

Facebook Share count not working #24

rrfranco92 opened this issue Aug 18, 2016 · 3 comments

Comments

@rrfranco92
Copy link

Hey,

I noticed that my facebook wasn't working and I went to see what was happening. I've found out that the facebook API you are using was deprecated today, 18th August.

Can you take a look at this? Will it possible using the new API or not?

Regards!

AyumuKasuga added a commit that referenced this issue Aug 19, 2016
Because Facebook completely shutting down deprecated REST API.

https://developers.facebook.com/blog/post/616/
@AyumuKasuga
Copy link
Owner

Hello, @rrfranco92 ! Thank you for the report. Looks like facebook completely disabled their rest api. Now we can't get share counter from browser without access token. Currently i can't find the way how to get around this.

Also you can use graph api https://developers.facebook.com/docs/graph-api

@ldo-tamedia
Copy link

ldo-tamedia commented Aug 26, 2016

Try this:

    function facebook(url, callback){

        $.ajax({
            type: 'GET',
            dataType: 'jsonp',
            url: 'http://graph.facebook.com?id='+url,
        })
        .done(function (data){callback(data.share.share_count)})
        .fail(function(){callback(0);})
    }

but apparently they removed a part of the results

AyumuKasuga added a commit that referenced this issue Aug 26, 2016
Thanks @ldo-tamedia for this solution. Please be careful with facebook
counter :) it can not be shown to user because of rate limit...
@AyumuKasuga
Copy link
Owner

Hello @ldo-tamedia ! Thanks for your comment. Yes your solution works, but it should not work :). Regarding documentation we should provide access_token, but we can see it works well without token.
And everything fine, we again found unofficial method to fetch share counters bypassing official graph API, but if you try to multiple refresh this url you can get error like this:

/**/ callback({
   "error": {
      "message": "(#4) Application request limit reached",
      "type": "OAuthException",
      "is_transient": true,
      "code": 4,
      "fbtrace_id": "DfFpebWbEsl"
   }
});

Because they have limits requests per user IP.
But anyway I decided to add this method, be careful with it and be ready that not every user can see this counter... Also facebook can disable this hack at any time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants