You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just curious if anyone else has noticed that the GETTR post id does not consistently increase in a user's timeline. I pulled the most recent 20 posts from a user using the following code:
client = PublicClient()
posts = client.user_activity(username="elisestefanik", max=20, type="posts")
for post in posts:
print(post["_id"])
Here are the results. The oldest post is on the bottom.
I assumed that the post id was a base 36 value that was always increasing over time, but when you start from the
bottom of the results and go forward through time you will see the id go from puw___ to pux___ and then back to puw___
Huh? Within the puw posts it goes from puwv___ to puwy___ to puwq___
This seems to present a problem when using the 'until' parameter. My use case involves keeping track of the most recent post id that was retrieved each day, and using that on the next day to make sure I only grab the new posts. This requires a value that consistently increases. Since the value bounces around it's very likely to miss some posts since the line in user_activity.py if until is not None and until > id:
assumes that new posts always have a higher id.
Each post has a 'udate' available in the dictionary at post['udate'] which is the time in milliseconds since the epoch, UTC. This seems to consistently increase for each post. Maybe a parameter 'until_time' could replace or be an alternative to 'until'?
The text was updated successfully, but these errors were encountered:
Just curious if anyone else has noticed that the GETTR post id does not consistently increase in a user's timeline. I pulled the most recent 20 posts from a user using the following code:
Here are the results. The oldest post is on the bottom.
I assumed that the post id was a base 36 value that was always increasing over time, but when you start from the
bottom of the results and go forward through time you will see the id go from puw___ to pux___ and then back to puw___
Huh? Within the puw posts it goes from puwv___ to puwy___ to puwq___
This seems to present a problem when using the 'until' parameter. My use case involves keeping track of the most recent post id that was retrieved each day, and using that on the next day to make sure I only grab the new posts. This requires a value that consistently increases. Since the value bounces around it's very likely to miss some posts since the line in user_activity.py
if until is not None and until > id:
assumes that new posts always have a higher id.
Each post has a 'udate' available in the dictionary at post['udate'] which is the time in milliseconds since the epoch, UTC. This seems to consistently increase for each post. Maybe a parameter 'until_time' could replace or be an alternative to 'until'?
The text was updated successfully, but these errors were encountered: