-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
REST API is gone, facebook share count is not working now #294
Comments
Can confirm also, Facebook numbers are all zero now. Even in their demos. |
Could be solved by using |
Same for us, I'll try the graph api mentioned above |
Got the fb share counts working again... two bits of code need altering: Weirdly you have to switch back to a previous version of the facebook api (no idea why)
Then the returned format is different so you have to change that too:
|
Same problem here and your hack worked for me @sphism. Thank you! |
I implemented the hack from @sphism and my counts are still not working. GitHub is saying the code was last updated March 3. I seem to be missing something. I found this article published last week: http://www.inc.com/james-parsons/the-era-of-the-share-count-is-coming-to-an-end.html that says FB Shared counts are no longer available... |
@martinfritch Have a play with the facebook graph explorer, that's how i figured out how to get ours working yesterday. https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=%3Fid%3Dhttp%253A%252F%252Fwww.imdb.com%252Ftitle%252Ftt2015381%252F&version=v2.7 |
@martinfritch did you use http or https for the graph facebook URL? http did not work on our project as the project is hosted on https. Chrome blocked the request. That graph URL does (currently) work, but I have no idea if/when it'll be retired. It might just be that the person that wrote the blog didn't look around for new URLs.. This definitely works: |
Glad to find this fix. Thanks @sphism this worked for me. |
@sphism 's fix didn't work for me -- we're still getting 0s everywhere. Anyone know of any alternatives to sharrre that can accomplish the same thing? |
Just an update: I got @sphism 's fix to work. Not sure what exactly I did, or what changed, but after working on it for several hours and trying different variations, I got a valid response back and now the counts are working fine! |
@martinfritch do you use any kind of version control so you can get a diff to see what you changed? @aandrewjoyce did you change it from http to https? Do you get any errors in the console or network tab? This patch does work, so if it doesn't work for you it would be good to know why. |
@martinfritch glad you got it sorted. @aandrewjoyce Not sure what to say. Have you tried using the graph api explorer https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=%3Fid%3Dhttp%253A%252F%252Fwww.imdb.com%252Ftitle%252Ftt2015381%252F&version=v2.7 I made sure i was getting results in there first, then figured out how to get it working on our site. There are loads of different version of the api, I wonder if the one you are using returns the data in a slightly different format???? If you look in the jquery.sharrre.js file for the Plugin.prototype.getSocialJson method, you can uncomment this line
Then you see all the returned JSON from each of the social sites. The facebook fql api used to return the share count as:
The graph api i just switched to returns it as:
It might be that the version of the api you are connecting to returns it slightly differently??? I'm not sure, I don't know much about the different fb api's. If you use that graph api explorer i liked to above then you might be able to figure it out |
The code I'm using is exactly what @sphism posted. However, the query isn't working again this morning. I'm getting the following response back from FB:
I bet this is why my first attempt appeared to be not working. |
ahhh interesting! Never considered that Facebook would implement API limits... |
�Check my website's share counter, it's working now: http://www.hungry.tw/2016/08/ShanHaiGo.html How I fixed that : First Step. Change the "Json url to get count number" in your sharer.js, ex /* Json URL to get count number Second Step. Add one line code at : //console.log('name : ' + name + ' - url : '+url); //debug ex. } else if (typeof json[0] !== "undefined") { //Stumbleupon you can use cmd(ctrl)+(F) to find "//Stumbleupon", and you will find that.the counter works fine now!!! of course, you need an Facebook app token first. You can find your token here if you already have an Facebook app: https://developers.facebook.com/tools/accesstoken/ Enjoy your counter now : ) warning: An app token have limit of request. I suggest every people using the personal token for themself, and do not using other people's token. It's easy to reach the limit. To create a Facebook app is easy and free. You do not need any Code skill. Yu-Ci |
I'm confused... doesn't the USER token have a time limit (2 mos) while the APP token does not? And I'm guessing the app token should not be used here because it's client side, per the facebook documentation? |
All token have limit, and you can check my.site its works. |
Thanks @nikksan! (there's a bug in your Markdown by the way - your link is not clickable) https://fragrances.bg/blog/wp-content/themes/hueman/js/jquery.sharrre.min.js?ver=4.2.2 |
@nikksan your fix sets 41 facebook likes to all posts. |
Aug 18, the FB REST API is gone.
There are any solution to fix my share count?
The text was updated successfully, but these errors were encountered: