获取Facebook公共页面评分和评论 [英] Get facebook public page rating and review

查看:254
本文介绍了获取Facebook公共页面评分和评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不是某个页面的所有者,但我想访问页面的评论和评分,每次访问时间我都获得了空数据集

I am not the owner of some page but i want access the pages reviews and ratings,Each access time i am getting empty data set

> http="https://graph.facebook.com/102227700571/tabs/reviews?access_token=fb_oauth"
>  content=callAPIInfo(http,fb_oauth)
> content
$data
list()

我看到了一些类似的 1 2 问题,但没有得到我的答案,我不想从中收集页面访问令牌每页的管理员,是否可以获取评论和评分.谢谢.

I saw some of the similar12 question but didnt get my answer,I dont wanna collect page access tokens from the admin of each pages,Is it possible to fetch review and rating.thanks.

编辑

最后,我通过 ifaour 找到了一个非常详细的答案,用于管理员访问页面令牌以及获取页面访问令牌的必要条件,因此这是如何获取页面访问令牌并进行评论和评分

Finally i find a very detailed answer by ifaour for access pages token by admin and its necessary to take page access token so here is how to get page access token and review and rating

  1. 转到Graph API资源管理器
  2. 从下拉菜单中选择您的应用
  3. 点击获取访问令牌"
  4. 选择manage_pages权限(不确定,您可能也需要user_events权限)
  5. 现在访问我/帐户连接并复制页面的access_token单击
  6. 页面的ID将页面的access_token添加到GET字段中调用
  7. 所需的连接(例如:PAGE_ID/事件)

  1. Go to the Graph API Explorer
  2. Choose your app from the dropdown menu
  3. Click "Get Access Token"
  4. Choose the manage_pages permission (you may need the user_events permission too, not sure)
  5. Now access the me/accounts connection and copy your page's access_token Click on
  6. your page's id Add the page's access_token to the GET fields Call
  7. the connection you want (e.g.: PAGE_ID/events)

access_token="xxx" #[what u find above]
> content=callAPIInfo(http,access_token)
> content
$data
$data[[1]]
$data[[1]]$created_time
[1] "2014-04-13T11:37:26+0000"

$data[[1]]$reviewer
$data[[1]]$reviewer$name
[1] "abc"

$data[[1]]$reviewer$id
[1] "100000579606903"

$data[[1]]$rating
[1] 4

$data[[1]]$review_text
[1] "Enjoy having coffee here...:)"

推荐答案

请参见,几乎所有图形API调用都需要一个

See, all-most all the graph API calls needs an access token for access else you'll not get the result.

不同的API需要不同种类的访问令牌,某些需要当前用户的访问令牌,有些需要页面访问令牌,有些需要应用程序访问令牌.还有一些API可以使用这些令牌中的任何一个.

The different APIs require different kinds of access tokens, some required current user's access token, some requires page access token and some require app access token. And there are also some APIs that can use either of these tokens.

您要获取页面的评级/评论.如果您阅读相同的官方文档( /{page-id}/ratings ),它清楚地说-

You want to get the rating/reviews of a page. If you read the official documentation for the same (/{page-id}/ratings), it clearly says-

需要页面访问令牌才能检索此数据.

A page access token is required to retrieve this data.

因此,您必须具有页面访问令牌才能获得该页面的评级/评论. (为此,您应该添加manage_pages权限并使用/{page-id}?fields=access_token获取页面访问令牌)

So you have to have the page access token to get the ratings/reviews of that page. (and for that you should add manage_pages permission and get the page access token with /{page-id}?fields=access_token)

这篇关于获取Facebook公共页面评分和评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆