Reputation: 3032
I'm writing some scripts to download my Facebook page's content. The graph API I'm using is page's feed ege.
I start by calling the feed API and recursively calling its nextpage property to get older contents. To save calls to Facebook, I set a coverage window. When I detects the returned posts are too old, I stop calling nextpage.
The issue here is that people may comment on very old posts. A finite coverage window therefore leaves possibility to miss such comments.
Is there anyway to return feeds base on their last commented time without downloading the whole page content?
Upvotes: 0
Views: 390
Reputation: 1067
I have been playing around a lot with the Facebook API. And one thing is for sure, if you want to be able to cover this window of comments on very old posts, do consider using Facebook Real Time updates.
The documentation Url :
https://developers.facebook.com/docs/graph-api/real-time-updates/v2.3
The great thing is that in v2.3 you get pushed the full content of the comment, so no extra API calls are required if you handle the pushed real time correctly.
This is in my honest opinion the cleanest and smoothest implementation to keep track on the updates of a Page Feed with a no risk of abusing Facebook API Limits when scaling.
I do must warn that the Real Time Updates might be quite some scope to implement but if you want the most optimal way of dealing with comments on older posts without having to do extensive API calls, use the Facebook API Real Time Updates.
There are currently no (decent ?) filters or approaches in the PULLING approach that is able to filter and sort on 'newly added comments'. I played in the past with some special GRAPH API queries but they pushed me to hit the API Limits because the 'weight' of my Calls were to heavy. FQL is close to deprecating as we speak so no need to take this option in concern.
EDIT 1 : I noticed you mentioned 'script', are you talking about a scripting language ? Because in that case the Real Time Updates might not be a solution. Depends on your stack / technical implementation details :)
Upvotes: 2