I am attempting to allow users to supply me with their facebook link when registering and when their profile is created, I auto populate a facebook like box into their profile. The problem I am having is that the like box does not work with personal facebook pages.
I need a way to test if a url is a fan page or personal page before displaying so I don’t get an error on my page. The only way I’ve been able to test so far is using php strpos to search for the string “pages/” which is in many fan page urls. If anyone can help me out with a concrete way to determine which page a url leads to, please let me know.
Thanks
The Facebook Graph API, may be a way to solve this problem.
If you compare the
Userand thePageobject, you will notice that there are some unique fields. For example a page haslikes.Now you only need to make a HTTP request to the Graph API and check if the response contains a specific field e.g.
likes.User: https://graph.facebook.com/btaylor
Page: https://graph.facebook.com/cocacola