Is there a way to use Reddit ExtractoR to look only at post titles and exclude comments?

Viewed 86

Title: I'm looking to pull all of the post titles from a specific subreddit since Jan 1, 2021 using Reddit ExtractoR. I can't figure out how to direct the function to only look at post titles and not pull in any comments. I've posted the current version of my code below:

reddit_test <- get_reddit(search_terms = NA, regex_filter = "", subreddit = "subreddit_name",
           cn_threshold = 1, page_threshold = 12000, sort_by = "new",
           wait_time = 2)
1 Answers

It seems the get_reddit() function always returns comments.

Looking at the github https://github.com/ivan-rivera/RedditExtractoR

The reddit_urls() function will return fewer attributes, and title is one of them:

> reddit_links <- reddit_urls(   search_terms   = "cute_cats", page_threshold = 1 )
> 
> 
> str(reddit_links) 'data.frame':   25 obs. of  5 variables:  
> $ date      : chr  "05-02-15" "24-02-14" "03-09-13" "20-05-14" ...  
> $ num_comments: num  214 26 221 36 44 41 93 199 20 175 ...  
> $ title     : chr  "My brother's cat is insanely cute!" "...  
> $ subreddit  : chr  "cats" "cats" "cats" "cats" ...  
> $ URL         : chr "http://www.reddit.com/r/cats/comments/2uv9q5/my_brothers_cat_is_insanely_cute/?ref=search_posts" ...
Related