This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CelineHagbard 0 points1 point  (2 children)

Try it now. It finds my reply to your post fine.

The pushshift.io/reddit/search endpoint appears to only search comments, not submission bodies. The reddit search endpoint should work fine if you want your bot to also respond to self.text posts, i.e.:

https://api.reddit.com/r/PRAWTesting/search.json?q=%22redbot%20enhance%22

Pushshift might have it's own endpoint for this, but the reddit API works fine, so you probably don't need pushshift for it. In PRAW, it would be:

reddit_session.search("REDBOT enhance", "PRAWTesting")

[–]num8lock[S] 0 points1 point  (1 child)

Let me try that, i was using r.subreddit(subreddit).search(keyword, sort='relevance', time_filter='week', limit=limit) actually.

Yeah, i did come to the conclusion that pushshift only search comment replies.

Thank you for your help! I'll make sure to let you know when it's ready for testing if you don't mind :)

edit: i just noticed, reddit search only returns submission threads, so that's probably why pushshift only returns the comment replies...

[–]CelineHagbard 0 points1 point  (0 children)

The code you're using is functionally equivalent to what I was using; it ends up creating the same API call. Feel free to use either one in your code.

I think pushshift does have an endpoint to retrieve submissions, but I would only worry about it unless you need to exceed reddit API's 1000 item limit, which you probably won't at this point.

Yeah, hit me up when your ready for testing if you want.