A Streamlit web app that analyzes the sentiment of top Reddit posts for any subreddit and time frame.
It uses NLTK's VADER Sentiment Analyzer to score posts and displays visual insights,.
- Fetches top Reddit posts for a selected time range (
day,week,month,year,all). - Calculates average sentiment score.
- Displays sentiment distribution chart.
- Shows Top 5 Positive and Top 5 Negative posts.
- Allows downloading results as CSV.
- Clone the repository:
git clone https://github.com/chiragkakad/reddit-sentiment-analyzer.git cd reddit-sentiment-analyzer
2. Install dependencies:
```bash
pip install -r requirements.txt
-
Set up environment variables in
.env:REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret REDDIT_USER_AGENT=your_user_agent -
Run the app:
streamlit run app.py
-
Open the provided local URL in your browser.
- Python (NLTK, pandas, matplotlib)
- Streamlit for the web interface
- PRAW for Reddit API