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...
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..
Thanks!
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).
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.
Edit
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.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).
More than that, the
online_presence
means online in the fb chat and not online on facebook: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.