使用Facebook API在朋友的墙上获取帖子 [英] Get posts on a friend's wall using the Facebook API

查看:109
本文介绍了使用Facebook API在朋友的墙上获取帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的Facebook应用能够使用该应用的用户ID,并在他们的一个朋友的墙上找到该ID所发布的帖子(我希望使用一个具有单个ID的示例,而不是迭代的示例通过所有朋友).

I'd like my Facebook app to take the ID of the user using the app, and find posts made by that ID on the wall of one of their friends (I'd prefer an example with an individual ID rather than iterative through all friends).

我认为这两个用户很有可能都必须向应用程序提供权限才能执行此操作,

I figure there's a good possibility that both users will have to provide permissions to the application to do this, and that's fine.

我希望直接在其他用户的墙上发布帖子,以及对目标用户的状态更新/自己的墙上帖子发表评论.

I would prefer posts made directly on another user's wall, as well as any comments made on the target user's status updates / own wall posts.

FQL是更好的选择,但我可以使用图表. 我使用PHP进行编码,但是如果您知道该解决方案,则可以尝试从另一种语言进行翻译.

FQL would be preferable, but I can work with graph. I'm coding in PHP, but I can try to translate from another language if you know the solution in that.

我当前使用的代码是:

SELECT message FROM stream WHERE source_id = <FRIEND ID> AND target_id = <USER ID>

我将<FRIEND ID>硬编码为测试ID(其中一个开发人员),并且我尝试了另外两个<USER ID>(也是开发人员),所有用户均具有read_stream权限. 我不确定,但是我认为如果没有许可,FQL将返回错误.无论哪种方式,它只会变回空白/空白.

I hardcoded <FRIEND ID> to a test ID (one of the developers), and I have tried with two other <USER ID>s (also developers), all users have read_stream permission given. I'm not sure, but I thought FQL would return an error if there wasn't permission. Either way, it just comes back blank / empty.

推荐答案

您将至少需要用户的"read_stream"和"publish_stream".

you will need at least the "read_stream" and the "publish_stream" of users.

然后您可以通过fql选择.看 http://developers.facebook.com/docs/reference/fql/stream/

Then you can select via fql. See http://developers.facebook.com/docs/reference/fql/stream/

http://developers.facebook.com/docs/authentication/permissions/获取您可以请求的权限列表.

and http://developers.facebook.com/docs/authentication/permissions/ for a list of permissions you can request.

这篇关于使用Facebook API在朋友的墙上获取帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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