mattpodolak / pmaw

A multithread Pushshift.io API Wrapper for reddit.com comment and submission searches.
MIT License
212 stars 28 forks source link

Sort = "created_utc" didnt sort results properly #63

Open grejty opened 1 year ago

grejty commented 1 year ago

My code looks like this:

_gen = list(api.search_submissions(q="fire", sort="createdutc", order="desc", subreddit=subreddit, filter=['id'], limit=None))

_for pmaw_submission in gen: praw_submission = reddit.submission(id=pmaw_submission['id']) print(datetime.utcfromtimestamp(praw_submission.createdutc))

Returns the following: https://pastebin.com/Y91fYYDy

You can see the years are not in order, otherwise, it kinda looks ordered, if we talking days/time only

Any idea why is this happening / how to fix this? Thanks

grejty commented 1 year ago

Overall, the query is returning submission in different order everytime it's ran