1

我使用 FQL 来验证用户提交的 URL 是 Facebook 页面还是个人资料,如下所示:验证 Facebook 页面 URL

这以前有效。当我发送一个像 facebook.com/zuck 或 facebook.com/cocacola 这样的 URL 时,它会返回一个带有 profile.php 或 /pages/ 的 normalized_url。现在,它只返回相同的 URL:例如 facebook.com/zuck。

这是 Facebook API 错误吗?或者还有其他方法可以解决这个问题吗?

4

2 回答 2

2

也许使用 Facebook Graph API 并寻找只有页面才有的属性。例如,可口可乐 API 返回(见下文)likes仅返回一个页面,您也可以查找description, websiteaboutlocation不要只依赖一个。相反,一个人会倾向于有一个first_namelast_name。统一使用这些来确定用户名是个人还是页面。

http://graph.facebook.com/zuck

{
   "id": "4",
   "name": "Mark Zuckerberg",
   "first_name": "Mark",
   "last_name": "Zuckerberg",
   "link": "https://www.facebook.com/zuck",
   "username": "zuck",
   "gender": "male",
   "locale": "en_US"
}

http://graph.facebook.com/cocacola

{
   "id": "40796308305",
   "name": "Coca-Cola",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/174560_40796308305_2093137831_s.jpg",
   "link": "https://www.facebook.com/coca-cola",
   "likes": 41519873,
   "cover": {
      "cover_id": "10150682306963306",
      "source": "http://a7.sphotos.ak.fbcdn.net/hphotos-ak-snc7/s720x720/416803_10150682306963306_40796308305_9337341_812683101_n.jpg",
      "offset_y": 0
   },
   "category": "Food/beverages",
   "is_published": true,
   "website": "http://www.coca-cola.com",
   "username": "coca-cola",
   "founded": "1886",
   "description": "Created in 1886 in Atlanta, Georgia, by Dr. John S. Pemberton, Coca-Cola was first offered as a fountain beverage at Jacob's Pharmacy by mixing Coca-Cola syrup with carbonated water. \n\nCoca-Cola was patented in 1887, registered as a trademark in 1893 and by 1895 it was being sold in every state and territory in the United States. In 1899, The Coca-Cola Company began franchised bottling operations in the United States. \n\nCoca-Cola might owe its origins to the United States, but its popularity has made it truly universal. Today, you can find Coca-Cola in virtually every part of the world.",
   "about": "The Coca-Cola Facebook Page is a collection of your stories showing how people from around the world have helped make Coke into what it is today.",
   "location": {
      "latitude": 53.71282619,
      "longitude": -1.51214516
   },
   "checkins": 92,
   "talking_about_count": 383754
}
于 2012-04-24T13:55:46.743 回答
0

我面临同样的问题,我决定观看“is_published”或“likes”字段。

于 2013-03-05T12:59:00.313 回答