Python Prompts Free Prompt

Python Script to Monitor Twitter for Keywords

Write a Python script that monitors Twitter for specific keywords using Tweepy
☆ Save
Prompt
You are a Python developer. Write a script that uses Tweepy to stream tweets containing certain keywords. The script must: 1) Accept keywords from command line or file, 2) Stream real-time tweets, 3) Store tweets (text, user, timestamp) in a CSV file, 4) Perform sentiment analysis on each tweet using TextBlob, 5) Log errors and reconnections, 6) Provide a simple dashboard with Flask to display live tweets, 7) Use environment variables for API keys. Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.