Facebook Graph API。如何获得喜欢评论? [英] Facebook Graph API. How to get likes for comment?
问题描述
例如,我的帖子中有个号为246595548763188_464132103676197的帖子,该帖子的评论与标题为464146663674741。
然后,我使用Graph Api Explorer( https ://developers.facebook.com/tools/explorer/ )
权限: user_groups
图形API网址: https://graph.facebook。 com / 464146663674741
结果:
code> {
id:464146663674741,
from:{
name:Rostyslav Paranko,
id:100001288191932
},
message:Українськумовудоконаютьпуристи,
can_remove:false,
created_time:2013-06-03T19:10: 57 + 0000,
like_count:8,
user_likes:false
}
如您所见, like_count
有价值 8
,但我看不到 喜欢此评论的人 (使用ids和名称)。 https://graph.facebook.com/464146663674741/likes
返回空数组。
那可以吗使用Graph API(或者也可能是FQL Query)获取评论的喜好?
获取注释ID,并使此Graph API请求:
https://graph.facebook.com/COMMENT_ID?fields=likes
注释ID实际上是以下连接:
- POST_ID(
246595548763188_464132103676197
), - COMMENT_ID(
464146663674741
)
这将在您的情况下给出: 246595548763188_464132103676197_464146663674741
。
所以,这应该工作:
graph.facebook.com/246595548763188_464132103676197_464146663674741?field s =喜欢
I need to get ids of people who liked some comment.
For example, I have the post with id 246595548763188_464132103676197 , and this post has comment with id 464146663674741.
Then, I use Graph Api Explorer (https://developers.facebook.com/tools/explorer/)
Permissions: user_groups
Graph API URL: https://graph.facebook.com/464146663674741
Result:
{
"id": "464146663674741",
"from": {
"name": "Rostyslav Paranko",
"id": "100001288191932"
},
"message": "Українську мову доконають пуристи.",
"can_remove": false,
"created_time": "2013-06-03T19:10:57+0000",
"like_count": 8,
"user_likes": false
}
As you can see, like_count
has value 8
, but I can't see people who liked this comment (with ids and names). https://graph.facebook.com/464146663674741/likes
returns empty array.
So, is it possible to get comment's likes using Graph API (or, maybe, FQL Query)?
Get the comment ID and make this Graph API request:
https://graph.facebook.com/COMMENT_ID?fields=likes
The comment ID is in fact the concatenation of:
- the POST_ID (
246595548763188_464132103676197
), - the COMMENT_ID (
464146663674741
),
which would give in your case: 246595548763188_464132103676197_464146663674741
.
So, this should work:
graph.facebook.com/246595548763188_464132103676197_464146663674741?fields=likes
这篇关于Facebook Graph API。如何获得喜欢评论?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!