pratikpv / reddit_scraper_and_sentiment_analyzer

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.


Languages

Language:Python 100.0%