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
First off, it's refreshing to find a simple library to access the Reddit API. I was hoping you could help point me in the right direction. Basically, I have a web application where each record has a handful of keywords\tags associated with it. I want to search a couple of subreddits with those keywords in both the post and comments. Any thoughts on the simplest way to approach this?
The text was updated successfully, but these errors were encountered:
To search for a keyword in submissions for a particular subreddit, you can use the SearchSubmissionsAsync method, e.g.
varkeyword="...";varsubreddit= client.Subreddit("...");varsearchResults= subreddit.SearchSubmissionsAsync(
keyword,builder => builder.WithSyntax(SearchQuerySyntax.Lucene));awaitforeach(var submissionDetails in searchResults){// Do something with submission
...}
You can find more details of how to use the search API (e.g. the query syntax) in the reddit documentation.
As far as searching comments is concerned, I don't believe the reddit API directly offers any way to do this. There are other services like pushshift.io that support more search options, but this client doesn't currently integrate with that service.
If you want to search new submissions/comments for keywords as they become available, take a look at the streaming sample.
First off, it's refreshing to find a simple library to access the Reddit API. I was hoping you could help point me in the right direction. Basically, I have a web application where each record has a handful of keywords\tags associated with it. I want to search a couple of subreddits with those keywords in both the post and comments. Any thoughts on the simplest way to approach this?
The text was updated successfully, but these errors were encountered: