Real time api feed - how to get new comments?

I subscribed to the api in real time and received update messages telling me the uid and time when the item changed. But how do I get the appropriate post / comment. I tried using fql, but unfortunately in fql there is an error in using update_time.

This is my query: SELECT post_id, actor_id, target_id, updated_time, message FROM stream WHERE source_id = me () AND updated_time> = "pushTime"

where pushtime is the time I received from the real-time notification.

It works to receive a separate (no comment) message, but as soon as comments appear, it does not work. When I look through all the posts and check for update_time, I can find the correct post. My only solution for now is to iterate over all the messages until I find the message where updated_time == "pushTime". Any other solution?

+4
source share
1 answer

If you saved previous comments, you will get the last comment identifier that you saved, and use this to request facebook for comments with an identifier above this.

0
source

Source: https://habr.com/ru/post/1386391/


All Articles