Reputation: 121998
The below Javascript function I used to have the twitter share count for a URL.
Unfortunately, twitter stopped providing the count of shares now. Is there any better alternative for that ?
// Twitter Shares Count
$.getJSON( 'http://cdn.api.twitter.com/1/urls/count.json?url=' + $URL + '&callback=?', function( twitdata ) {
$('#twitter-count').text( ReplaceNumberWithCommas(twitdata.count) + ' Tweets ')
});
You can see how it is failing now
http://jsfiddle.net/sureshatta/5TxBd/125/
Previously the above call giving me the exact count of tweets with that url but twitter stopped that.
Can someone suggest any quick alternative for the above call ?
Upvotes: 0
Views: 1677
Reputation: 771
On the last November 20, Twitter just shut down the JSON endpoint referenced in the question, which provided the share count.
Right now, Open Share Count is a free alternative to get the Twitter Share Count.
There's some caveats, though:
The Search API is not meant to be an exhaustive source of Tweets. Not all Tweets will be indexed or made available via the search interface.
Open Share Count mentions that will deal with this, though, so you can always have an accurate share count.
That said, right now this is probably the easiest and fastest way to make the Twitter share count work again with any degree of accuracy.
Upvotes: 1