Skip to content

A lightweight Python script that detects when a Twitter/X user changes their profile picture and sends instant alerts to Telegram. Perfect for tracking competitors, influencers, or anyone of interest.

Notifications You must be signed in to change notification settings

Dairus01/Twitter-Profile-Picture-Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Twitter Profile Picture Monitor

Overview

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.

Features

  • 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.

Requirements

  • Python 3.x
  • Twitter API Bearer Token
  • Telegram Bot Token and Chat ID
  • requests library (install with pip install requests)

Setup

1. Obtain API Credentials

Twitter API

Telegram API

  • 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>/getUpdates to find your chat ID.

2. Configure the Script

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"

3. Install Dependencies

pip install requests

4. Run the Script

python script.py

How It Works

  1. The script fetches the profile picture URL of the specified Twitter user.
  2. It compares the fetched URL with the previously stored one.
  3. If a change is detected, an alert message is sent to the configured Telegram chat.
  4. The script continuously runs, checking for changes every 30 seconds.

Notes

  • 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.

License

This project is open-source and can be modified or distributed freely.

Author

Developed by Dairus Okoh. Contributions are welcome!

About

A lightweight Python script that detects when a Twitter/X user changes their profile picture and sends instant alerts to Telegram. Perfect for tracking competitors, influencers, or anyone of interest.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published