开发者

How to check is website visitor fan of my facebook page?

开发者 https://www.devze.com 2023-01-20 04:53 出处:网络
can someone help me please how to check 开发者_如何学Gois visitor on my website fan of my facebook page,thanks in advance.

can someone help me please how to check 开发者_如何学Gois visitor on my website fan of my facebook page,thanks in advance. Regards


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消