1
votes

I am doing a cron style search of activities and I want to retrieve Google plus activities published after the timestamp when last search was run. How can this be done? Current documentation seems to allow only search by keywords and doesn't talk about a timestamp range filter in search.

Here is the link to the documentation https://developers.google.com/+/api/latest/activities/search

1
You speak about plus.activities.search ?mpgn

1 Answers

1
votes

One way to do this would be to

a. Store the timestamp of the previous search as "previous_search_timestamp"

b. In every search, sort the results by recency (as allowed by the API)

c. Iterate over the results of current search, till you come across an activity whose published <= previous_search_timestamp

d. Stop processing the results from that activity onwards (or making further pagination requests) as the further activity results would already have been retrieved in the previous search. You don't want to make redundant API calls or data processing on your server :)