3 ms·
The script is not getting 'likes,' it's pulling the number of 'shares' for a particular URL. If you want to get to a brand's like-count, you'll need to feed th
by amitparikh 14y ago
The script is not getting 'likes,' it's pulling the number of 'shares' for a particular URL.
If you want to get to a brand's like-count, you'll need to feed the Graph API with either the Facebook Username of the account (e.g. "nike", not "http://www.nike.com http://www.nike.com "), or with the Facebook ID# of the brand (e.g. "15087023444").
- iamchrisle 14y agoAh. Right! Thanks. I'll have to change this today then.
- TomAnthony 14y agoThis can be misleading though. This script does get the count you will see on a Facebook 'Like' button which is actually the sum of the 'like','share', and 'comment' counts. For example, the script gets a count of 1,257,333 for www.apple.com: https://graph.facebook.com/?ids=http://www.apple.com https://graph.facebook.com/?ids=http://www.apple.com Which from here we can see is the sum of the 3 values: http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http://www.apple.com http://api.facebook.com/restserver.php?method=links.getStats... And by entering www.apple.com as the URL here we can confirm is exactly the figure the Like button shows: http://developers.facebook.com/docs/reference/plugins/like/ http://developers.facebook.com/docs/reference/plugins/like/ So whilst maybe not 100% accurate in some regards, it is certainly what many people would refer to as the 'like' count (and they'd be confused if you gave a lower number which isn't what the like button on the page showed). This tool is aimed more at URLs than brands.