FQL获取实时更新 [英] Get FQL real time updates

查看:154
本文介绍了FQL获取实时更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用FQL查询。我想重复查询每15分钟,看看是否发生任何变化。所以,理想我想做一个FQL查询,等待15分钟再这样做同样的查询等等...

I am using FQL to query . I want to repeat the query every 15 mins and see if any change occurs. So ideally i want to do a FQL query, wait 15 mins do same query again etc...

有什么办法,我可以使用推送通知办呢?我了解实时的Facebook的API,但我不知道它可以与FQL ..

Is there any way i can use Push notifications to do it? I read about real time facebook api, but I am not sure it can be implemented with FQL..

谢谢!

推荐答案

没有的实时更新的仅用于图形对象,并根据唯一的用户,权限和页面对象(和然后不所有字段或连接)。

No, the Real-time Updates are only for graph objects, and according to the documentation only for the User, Permissions and Page objects (and then not to all fields or connections).

由于FQL是另一个API来并从图形API都是一样得到Facebook的数据,这些数据。

您应该能够注册到一个实时更新(如果支持您所需要的),并且到达时,你可以再发出FQL请求获得用于你想要的方式/需求/数据,这样你不会浪费FQL请求时没有变化。

Since FQL is just another api to get data from facebook, the data from it and from the graph api is the same.
You should be able to register to a real-time update (if it's supported for what you need) and when that arrives you can then issue a FQL request to get the data in the way you want/need/used to, that way you won't "waste" FQL requests when there's no change.

online_ presence 是有问题的,因为你不能访问从图形API,所以你没有太多选择,只能定期发送FQL请求。

The online_presence is problematic since you can't access that from the graph api and so you don't have much choice but to periodically send that fql request.

但请记住,即使该解决方案你不应该的总是的预期得到正确的答案,因为你可以在这个错误报告中看到:的 online_ presence返回null (被设置为固定的,但看评论,也从我自己的经验,我可以说,返回的数据很不一致)。

But keep in mind that even with that solution you should not always expect to get the right answer, as you can see in this bug report: online_presence returning null (which is set to fixed, but look at the comments, also from my own experience I can say that the data returned is very inconsistent).

不仅如此,在 online_ presence 在线是指在FB聊天和不在线的Facebook:

More than that, the online_presence means online in the fb chat and not online on facebook:

该用户的Facebook聊天状态。返回一个字符串,积极之一,
  空闲,脱机或错误(Facebook时不能确定presence
  在服务器端信息)。查询不返回用户的
  当信息的隐私限制Facebook的聊天状态
  的原因。

The user's Facebook Chat status. Returns a string, one of active, idle, offline, or error (when Facebook can't determine presence information on the server side). The query does not return the user's Facebook Chat status when that information is restricted for privacy reasons.

如果这就是你可能要考虑使用聊天API 这让你登录为用户使用XMPP Facebook的聊天服务器。

有了这个解决方案,您就不必提出请求去FB,询问是否有人在线,则presence信息将被推到客户端。

If that's what you're looking for then you might want to consider using the Chat API which let's you log in as the user to the facebook chat servers using xmpp.
With this solution you won't have to make requests to fb asking if someone is online, the presence messages will be pushed to your client.

这篇关于FQL获取实时更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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