Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GETTR post id does not consistently increase #20

Open
JusticeProject opened this issue Feb 17, 2022 · 0 comments
Open

GETTR post id does not consistently increase #20

JusticeProject opened this issue Feb 17, 2022 · 0 comments

Comments

@JusticeProject
Copy link

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.

puyfio07ae
puyl23a25b
puya6rd15c
puy99p209c
puy13dd6f9
puwxq28b5b
puwool7718
puwlwue81d
pux00k1c3a
pux3rocc56
pux0r51e80
puwhjz99e2
puwz4v8eff
puwvl67d70
puw00a95db
puwqhtd4ed
puwyd00b1b
puwvfme687
put13g39eb
pusdlv7b92

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'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant