简体   繁体   English

在页面墙上获取其他帖子(Facebook API)

[英]Get posts by other on page wall (Facebook API)

I've searched around, but can't find the answer, so I try here. 我四处搜索,但找不到答案,所以我试试这里。

Is it possible to get posts by others on a page wall (See image as example: http://d.pr/i/fklT ) via. 是否有可能在页面墙上获得其他人的帖子(请参见图像为例: http//d.pr/i/fklT )。 Facebook's API? Facebook的API?

I've tried with /PAGE_ID/posts, but that only gives me updates created by the page and not by the people that liked the page 我已尝试使用/ PAGE_ID /帖子,但这只会给我页面创建的更新,而不是喜欢该页面的人

As Martin said, it's possible with the Graph API using FQL. 正如Martin所说,使用FQL的Graph API是可能的。 I tried Martin's solution, but needed to change it a little bit. 我尝试了马丁的解决方案,但需要稍微改变一下。

Defining filter_key = 'others' didn't help. 定义filter_key = 'others'没有帮助。 Instead, you can replace it for actor_id != YOUR_PAGE_ID , so, in the end, you can have: 相反,您可以将其替换为actor_id != YOUR_PAGE_ID ,因此,最后,您可以:

https://graph.facebook.com/fql?q=SELECT post_id, created_time , app_data, type, actor_id, target_id, message FROM stream WHERE  source_id = YOUR_PAGE_ID AND actor_id != YOUR_PAGE_ID&access_token=YOUR_ACCESS_TOKEN

If you need more variables, you just need to put them after SELECT, and you can check them out here: https://developers.facebook.com/docs/reference/fql/stream 如果你需要更多的变量,你只需要在SELECT之后放置它们,你可以在这里查看它们: https//developers.facebook.com/docs/reference/fql/stream

On iOS, you don't need to put the access token in the query. 在iOS上,您无需将访问令牌放入查询中。 To check how to do it with the latest iOS SDK, see my answer here: https://stackoverflow.com/a/14357179/675486 要查看如何使用最新的iOS SDK,请在此处查看我的答案: https//stackoverflow.com/a/14357179/675486

This is possible by using FQL instead of the normal graph objects: 这可以通过使用FQL而不是普通的图形对象来实现:

https://graph.facebook.com/fql?q=SELECT post_id, actor_id, target_id, message FROM stream WHERE filter_key = 'others' AND source_id = YOUR_PAGE_ID&access_token=YOUR_ACCESS_TOKEN

More about FQL: https://developers.facebook.com/docs/reference/fql/ 有关FQL的更多信息: https//developers.facebook.com/docs/reference/fql/

Using graph api, you can get all posts (including those by others) querying the field "feed" instead of "posts", eg /PAGE_ID/feed. 使用图形api,您可以获取所有帖子(包括其他人的帖子)查询字段“feed”而不是“posts”,例如/ PAGE_ID / feed。 I got this from this other answer: 我从另一个答案中得到了这个:

https://stackoverflow.com/a/14401026/1449045 https://stackoverflow.com/a/14401026/1449045

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM