StarTrackerBot is a Python script that tracks GitHub repository stars and logs the count over time. It also sends a Telegram notification whenever the repository gains a new star.
- Fetches the current star count of a GitHub repository
- Saves the star history to a CSV file
- Sends a Telegram notification when the star count increases
- Python 3.x installed
- A Telegram bot and chat ID (for notifications)
- A GitHub repository to track
Clone the repository and install required packages:
git clone https://github.com/ArghavanMonajemi/StarTrackerBot.git
cd StarTrackerBot
pip install requestsReplace these placeholders in the script with your actual credentials:
TELEGRAM_BOT_TOKEN = "your_telegram_bot_token"
TELEGRAM_CHAT_ID = "your_chat_id"
REPO = "torvalds/linux" # Change to the GitHub repo you want to track4οΈβ£ Run the Bot
python main.pyTo automate the bot, you can set up a scheduler.
- Open the terminal and type:
crontab -e- Add this line at the end (runs every hour):
0 * * * * /usr/bin/python3 /path/to/StarTrackerBot/main.py- Replace /path/to/StarTrackerBot/star_tracker.py with the actual path.
- Save and exit.
- Open Task Scheduler.
- Click Create Basic Task.
- Set a name like StarTrackerBot.
- Select Daily or Hourly.
- Choose Start a Program and browse for python.exe.
- Add the script path (star_tracker.py) in the "Add arguments" field.
- Click Finish.
- Now, the bot will run automatically at the scheduled time!
The script fetches the star count from the GitHub API. It logs the count into a CSV file (stars_history.csv). If the star count has increased, it sends a Telegram message.