This script monitors a specified Twitter account for changes in its profile picture. When a change is detected, it sends an alert message to a designated Telegram chat with the old and new profile pictures.
- Tracks profile picture updates for a given Twitter user.
- Sends alerts via Telegram with links to the old and new profile pictures.
- Runs continuously, checking for updates every 30 seconds.
- Python 3.x
- Twitter API Bearer Token
- Telegram Bot Token and Chat ID
requestslibrary (install withpip install requests)
- Create a developer account at Twitter Developer Portal.
- Generate a Bearer Token for API authentication.
- Create a bot using BotFather on Telegram.
- Obtain the bot token.
- Get your chat ID by sending a message to your bot and using
https://api.telegram.org/bot<Your_Bot_Token>/getUpdatesto find your chat ID.
Open the script and replace the following placeholders with your actual credentials:
BEARER_TOKEN = "Input your Twitter bearer token"
USERNAME = "Input your Username" # The Twitter username you want to track
TELEGRAM_BOT_TOKEN = "Input your Telegram Bot Token"
TELEGRAM_CHAT_ID = "Input your chat id"pip install requestspython script.py- The script fetches the profile picture URL of the specified Twitter user.
- It compares the fetched URL with the previously stored one.
- If a change is detected, an alert message is sent to the configured Telegram chat.
- The script continuously runs, checking for changes every 30 seconds.
- The script relies on Twitter API v2.
- Ensure your Twitter API access has permission to fetch user profile details.
- The Telegram bot must be added to the chat where alerts should be sent.
This project is open-source and can be modified or distributed freely.
Developed by Dairus Okoh. Contributions are welcome!