【问题标题】:Facebook Graph API returns Shares instead of total countFacebook Graph API 返回共享而不是总数
【发布时间】:2012-06-22 20:35:05
【问题描述】:

我在尝试为我们的 Like 按钮返回 total_count 数时遇到问题。我们的应用程序管理 Like 按钮和 Open Graph 标签,我们尝试获取一些 URL 的 Like 计数,但它返回的共享没有 OG 标签信息。

例如: https://graph.facebook.com/?id=http://www.fruitilike.com/products/shares-debug6/

返回:

{
   "id": "http://www.fruitilike.com/products/shares-debug6/",
   "shares": 1
}

它应该如何工作的示例: https://graph.facebook.com/?id=http://www.fruitilike.com/products/apple

返回:

{
   "id": "114182628680532",
   "name": "Apple",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/187789_114182628680532_2291233_s.jpg",
   "link": "http://www.fruitilike.com/products/apple",
   "likes": 1,
   "app_id": 102729306450470,
   "category": "Food",
   "is_published": true,
   "description": "The Apple. When it falls from a tree it generates gravity.",
   "about": "The Apple. When it falls from a tree it generates gravity."
}

【问题讨论】:

  • 这取决于链接。即使是尾部斜线也会有所作为。我猜第一个网址只有分享,但没有喜欢或其他信息(是否有与之相关的应用程序 ID?)等。第二个网址具有这些属性
  • 埃斯瓦尔,谢谢。这是真的,但问题是 Facebook 过去返回的点赞数基本上是总数,现在他们返回的是分享数。

标签: facebook facebook-graph-api facebook-like facebook-javascript-sdk facebook-social-plugins


【解决方案1】:

这些结果没有错,这是因为您比较的对象具有不同的类型:

  • http://www.fruitilike.com/products/shares-debug6/ - is website
  • http://www.fruitilike.com/products/apple/ - is food

为不同类型的对象设置不同的集合字段是完全可以的。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-09
  • 1970-01-01
  • 1970-01-01
  • 2013-06-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多