Facebook Graph API:如何过滤家庭&按应用程序喂? [英] Facebook Graph API: How to filter home & feed by application?

查看:104
本文介绍了Facebook Graph API:如何过滤家庭&按应用程序喂?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Facebook Graph API可让您获取家庭的JSON表示(新闻Feed)和feed(Wall)。

The Facebook Graph API lets you grab a JSON representation of home (News Feed) & feed (Wall).

如何获取我的Facebook应用程序发布的帖子?

How do I just get the posts made by my Facebook app?

推荐答案

您现在可以运行 Facebook查询语言(FQL)使用 Facebook Graph API (基本URL: https://graph.facebook.com )。

You can now run Facebook Query Language (FQL) queries using the Facebook Graph API (base URL: https://graph.facebook.com).

假设您的应用是Twitter。 Twitter的Facebook应用程序ID为2231777543。

Let's say your application is Twitter. Twitter's Facebook application ID is 2231777543.

我在以下 @ danontheline的答案,并仔细阅读Facebook的文档 FQL stream & FQL stream_filter

I came up with the FQL queries below with the help of @danontheline's answer and by carefully reading Facebook's documentation on FQL stream & FQL stream_filter.

以下摘录特别相关:


如果您指定了一个 filter_key stream_filter FQL表或
多个用户,返回的结果将像用户的主页
新闻Feed一样。如果只有一个用户被指定为source_id,您将
接收用户或页面的配置文件视图。您可以通过指定 filter_key 'others'(只返回由指定用户以外的其他人返回
帖子)来过滤这些
个人资料视图帖子,所有者'
(仅返回指定用户发布的帖子)。配置文件视图
不同于首页视图,从我们的数据库返回较旧的数据。在
的页面的情况下,个人资料视图还包括粉丝的帖子。

If you specify a filter_key from the stream_filter FQL table or multiple users, results returned will behave like the user's homepage news feed. If only one user is specified as the source_id, you will receive the profile view of the user or page. You can filter these profile view posts by specifying filter_key 'others' (return only posts that are by someone other than the specified user) or 'owner' (return only posts made by the specified user). The profile view, unlike the homepage view, returns older data from our databases. In the case of a Page, the profile view also includes posts by fans.



Twitter推文在您的Facebook新闻Feed



Twitter Tweets on Your Facebook News Feed

GET /fql?q=SELECT post_id, actor_id, message, app_id, attribution FROM stream WHERE filter_key = 'app_2231777543'



Twitter Facebook上的推文



Twitter Tweets on Your Facebook Wall

GET /fql?q=SELECT post_id, actor_id, message, app_id, attribution FROM stream WHERE source_id = me() AND app_id = '2231777543' LIMIT 1000

使用 Facebook运行这些查询Graph API Explorer 返回 Facebook Graph API post 对象(The结果集将根据 access_token ,隐私等而有所不同)。您可以通过在上面的查询中添加流表的其他列和/或通过简单地将另一个Graph API请求添加到 GET / {post_id} 来查找有关每个帖子的更多信息由上述FQL流查询返回的eache post_id

Running these queries with the Facebook Graph API Explorer returns Facebook Graph API post objects (The result set will differ depending on access_token, privacy, etc.). You can find out more about each post by adding other columns of the stream table to the queries above and/or by simply making another Graph API request to GET /{post_id} for eache post_id returned by the FQL stream queries above.

这篇关于Facebook Graph API:如何过滤家庭&按应用程序喂?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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