Reputation: 1310
can someone help me please how to check is visitor on my website fan of my facebook page,thanks in advance. Regards
Upvotes: 0
Views: 1058
Reputation: 8932
The easiest way to do this is using the graph API. Make a request to https://graph.facebook.com/me/likes?fields=id&access_token=.... You will recieve a JSON object back that looks like this:
{ "data": [
{
"id": "167719689909536",
"created_time": "2010-10-12T17:52:07+0000"
},
{
"id": "48543634386",
"created_time": "2010-10-08T15:51:56+0000"
},
{
"id": "116444998394332",
"created_time": "2010-10-07T03:50:46+0000"
},
{
"id": "165752823438719",
"created_time": "2010-10-07T01:50:51+0000"
}
] }
From this you can just iterate through the likes until you find if the like you are looking for exists. If you don't know the id of your Url you can simply go to http://graph.facebook.com/http://www.mydomain.com/myurl and you will be given a JSON result that contains the ID of your page.
Upvotes: 3