Facebook - 此网址是否存在此页面?

时间:2011-10-13 11:54:01

标签: facebook

我正在制作网页/搜索引擎优化检查页面,我可以在其中输入网址,它会告诉我有关网页的各种事实。

我希望能够判断是否存在与该网址相关联的Facebook页面。这可能是使用API​​还是通过其他方式?

例如,https://www.facebook.com/focalstrategy链接到信息标签上的http://www.focalstrategy.com/ - 有没有办法走另一条路并输入网址并找到页面?

(奖励积分 - 任何人都知道如何为Twitter账户做同样的事情)

1 个答案:

答案 0 :(得分:3)

认为这是可能的。使用API​​,您可以检索有关网址的信息:

http://graph.facebook.com/?id=http://www.focalstrategy.com/

会回来:

{
   "id": "http://www.focalstrategy.com/",
   "shares": 38
}

现在我要注意使用Open Graph元标记是否有助于返回更多数据(仍然不是您需要的),但这里是我的网站信息没有尾随斜杠:

http://graph.facebook.com/?id=http://www.masteringapi.com

会回来:

{
   "id": "109784969102047",
   "name": "MasteringAPI.com",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/276619_109784969102047_474156823_s.jpg",
   "link": "http://www.masteringapi.com/",
   "likes": 25,
   "category": "Website",
   "website": "http://www.masteringapi.com",
   "description": "Master Facebook, Google and Twitter APIs! Learn Facebook Application Development Now!",
   "can_post": true
}