Skip to content

About

A Python bot that scrapes tweets from Nitter alt private instance, stores them in MongoDB, and automatically sends new tweet notifications to a Telegram channel — all without using the official Twitter API.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

77 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

🐦 Twitter Telegram Bot (use own instance)

Scraping tweets has become increasingly difficult without paying high API fees or relying on third-party services like Nitter. However, since Nitter often imposes timeouts and access limits, this project recommend using private instance.

This Python bot scrapes tweets from Nitter, stores them in MongoDB, and sends new tweet alerts to a Telegram channel — all without using the official Twitter API.

📸 Preview

Twitter Telegram Bot Preview An overview of the bot’s scraping and alert process.

🚀 Features

  • 🧩 Nitter Scraper — use your own instance.
  • 💾 MongoDB Storage — Keeps track of tweet IDs to avoid duplicate alerts.
  • 📢 Telegram Integration — Sends formatted tweet notifications to your Telegram channel.
  • 🧠 Randomized Headers — Generates unique HTTP headers and cookies on every request to bypass scraping restrictions.
  • ⚙️ Error Handling — Manages connection and parsing errors per user gracefully.

🧰 Requirements

  • Python 3.8+
  • A MongoDB instance (local or cloud)
  • A Telegram Bot API Key (from @BotFather)

🔑 Environment Variables

Set these environment variables (or create a .env file):

API=<your_telegram_bot_api_key>
CHANNEL_ID=<your_telegram_channel_id>
MONGODB_URI=<your_mongodb_connection_uri>

About

A Python bot that scrapes tweets from Nitter alt private instance, stores them in MongoDB, and automatically sends new tweet notifications to a Telegram channel — all without using the official Twitter API.

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors