This project focuses on mining and analyzing data from Twitter. It involves collecting tweets, processing the data, and performing various analyses to extract meaningful insights.
- Fetch tweets using the Twitter API
- Perform sentiment analysis on tweets
- Visualize tweet data with graphs and charts
- Store and retrieve tweet data from a database
- Python 3.x
- Tweepy
- Pandas
- NLTK (Natural Language Toolkit)
- Matplotlib
- SQLite (or any other preferred database)
-
Clone the repository:
git clone https://github.com/yourusername/twitter-data-mining.git cd twitter-data-mining
-
Install the required packages:
pip install -r requirements.txt
-
Set up your Twitter API credentials:
- Create a Twitter Developer account and generate API keys and tokens.
- Create a file named
config.py
and add your credentials:CONSUMER_KEY = 'your-consumer-key' CONSUMER_SECRET = 'your-consumer-secret' ACCESS_TOKEN = 'your-access-token' ACCESS_TOKEN_SECRET = 'your-access-token-secret'
-
Fetch tweets:
python fetch_tweets.py --query "your search query" --count 100
-
Perform sentiment analysis:
python sentiment_analysis.py
-
Visualize data:
python visualize_data.py