Tutorial :FaceBook fan count on website



Question:

I'd like to include a within the footer of my website a "facebook fan count". I believe this will add an incentive to users considering clicking our facebook icon. "join XXXX fans on our facebook page" for example. I want the XXXX to be automatically populated with our facebook fan count. I want to do the same with twitter. Any insight you can provide would be helpful.

Note, I dont want to include the whole FB widget, just need the fan count for this purpose.

Thanks


Solution:1

You can get the fan count of a page via their API using Pages.getInfo found here.

Or using FQL:

select fan_count from page where page_id = [ID of Fan Page]  

For Twitter you can get the followers_count from this call of users/lookup found here.


Solution:2

Do the following FQL query to the facebook api:

select fan_count from page where page_id = <FAN_PAGE_ID>  

For twitter you need to extract it from a user query.


Solution:3

https://graph.facebook.com/cocacola

"fan_count" property. replace "cocacola" with your page ID.


Solution:4

FaceBook Graph API

http://developers.facebook.com/docs/api#selection

the new Graph api should work for you..

Replace the "devilsworkshop.org" with your page name and then try opening page

https ://graph.facebook.com/devilsworkshop.org

It will return a object with fan_count as its member.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »