Custom facebook like button / fan count - not using facebooks like button generated code
The is probably a simple solution to this, but all I can find is facebook like buttons and share URL's, which won't work for me.
I would like to have a button on my website to like this URL... http://facebook.com/examplepage ...and also retrieve the fan count.
Because I need my button graphic to change to 'Liked' if the current logged in facebook user has already like the page, and say 'Like us' if the logged in user has not liked the page?
And also is it possible to retrieve a facebook page count in a separate div?
If anyone share any pointers, tutorial links, or code you've used to achieve something similar.. that would be awesome.
See my design below which I'm trying to make a reality, and you can see why I need to make my own.
Outside of a canvas/page tab app you would have to get the users permission to read his likes first. If your app requires a login and granting permissions in general, you could include the user_likes permission, and then ask the Graph API if the user liked your page/url already. But if it doesn’t, or the user is unknown (just a random site visitor), then that’s not practical/even possible.
For the count of likes of a page, you can query that from the API separately, but it will also require a page access token.
(If your not familiar with these techniques/terms, please start reading Facebooks documentation on these matters.)