Skip to content

Download reddit posts based on keywords and perform sentiment analysis on the posts.

Notifications You must be signed in to change notification settings

pratikpv/reddit_scraper_and_sentiment_analyzer

Repository files navigation

Reddit posts scraper and sentiment analyzer using python

Summary:

A web-crawler/scraper script to fetch reddit posts and save them in CSV files. Search is performed with given keywords in specific subreddits to fetch the reddit posts. Performs sentiment analysis to quantify the posts using pre-trained sentiment analysis models like Flair, Textblob and VADER. The results are saved in CSV.

download_data_from_reddit.py

  • Is a scraper script which can search reddit post using keywords, in a subreddit of interest.
  • It uses pushshift api from https://api.pushshift.io/. There is no need get API secret keys from reddit.com to use pushshift APIs (as of this writing).
  • sample data generated by the script looks like this. alt text

reddit_post_sentiment_analysis.py

This framework is used in https://github.com/pratikpv/predicting_bitcoin_market

Credits: Code from https://medium.com/@RareLoot/using-pushshifts-api-to-extract-reddit-submissions-fb517b286563 is referenced as base to write scraper code.

About

Download reddit posts based on keywords and perform sentiment analysis on the posts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages