pushshift / api

Pushshift API
1.29k stars 107 forks source link

query doesn't return last posts #120

Open journeytosilius opened 1 year ago

journeytosilius commented 1 year ago
  start =  dt.datetime.now(timezone.utc) - timedelta(hours=0, minutes=120)

end = dt.datetime.now(timezone.utc)

start_utc_time = start.replace(tzinfo=timezone.utc)
start_time = int(start_utc_time.timestamp())

end_utc_time = end.replace(tzinfo=timezone.utc)
end_time = int(end_utc_time.timestamp())

this is what I'm trying to get the posts of certain subredit starting two hours ago to now, but I always get returned nothing. I get no errors, only empty responses.

When I do this:

 start_time = int(dt.datetime(2022, 10, 7).timestamp())
end_time = int(dt.datetime(2022, 10, 8).timestamp())

it partially works, but not really since I really only want the posts over the last two hours every time I check. This is returning posts from 7 hours ago. Another thing I can't find in the documentation is how to make sure is always at the query is performed against the "New" category. Is there a way to fetch only from "New" ? Thanks !

r92546024 commented 1 year ago

I have same issue, not to return the all post result when specify last 1 day period.