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
{{ message }}
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.
Turns out the function psaw_api.search_submissions() simply takes a kwargs and builds a get url with the key value pairs to hit the pushshift endpoint. With that being the case all you'd need to do is pass in selftext:not into the kwargs as a key and the query as it's value. Of course, python doesn't allow a colon and the not keyword when assigning a key, so instead you can just pass in a dictionary with the spread operator as the kwargs.
So instead of this: psaw_api.search_submissions(subreddit="politics", selftext="[removed]|[deleted]")
you can do this: psaw_api.search_submissions(**{"subreddit": "politics", "selftext:not": "[removed]|[deleted]"})
With this example I'm able to search for text that is not removed or deleted. An extra interesting behavior that might be useful to note is that if you pass in a praw instance into your psaw api, psaw will request the submission ids from pushshift, but then lookup those submissions live using praw, therefore there can be differences between the current submission and what was archived by pushshift.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Without the API, I'm able to search via
selftext:not
:What is the equivalent here?
selftext_not
andselftextnot
don't seem to work.The text was updated successfully, but these errors were encountered: