Welcome to the TechCrunchNews Bot! π₯ This powerful Telegram bot is your gateway to the latest tech news from TechCrunch, delivered directly to your Telegram channel. Built with cutting-edge tools like Pyrogram and MongoDB, this bot ensures you stay ahead of the curve in the fast-paced world of technology. π
- Automated News Updates π«: Fetches the latest TechCrunch articles every 40 minutes and posts them to your channel.
- Rich Media Posts β¨: Each post includes the article title, a concise summary, an image (when available), and additional details scraped from the article.
- Interactive Buttons π: Inline buttons allow users to refresh the news, read the full article, join a tech news channel, or share the post with others.
- Smart Duplicate Prevention βοΈ: Uses MongoDB to track posted articles, ensuring no duplicates clutter your feed.
Follow these simple steps to get the bot up and running:
-
Clone the Repository π:
git clone https://github.com/abirxdhack/TechCrunchNews.git cd TechCrunchNews
-
Install Dependencies π οΈ: Make sure you have Python 3.9 or above installed. Install the required packages using:
pip install -r requirements.txt
-
Configure the Bot βοΈ:
- Copy the
config.py
template and create your ownconfig.py
file. - Fill in the following values:
API_ID
: Your Telegram API ID. Get it from my.telegram.org.API_HASH
: Your Telegram API Hash. Get it from my.telegram.org.BOT_TOKEN
: Your bot's token. Get it by creating a bot via BotFather on Telegram.MONGO_URI
: Your MongoDB connection string. Set up a MongoDB database and obtain the URI from your provider (e.g., MongoDB Atlas).DB_NAME
: The name of your MongoDB database.COLLECTION_NAME
: The name of the collection where posted articles will be stored.CHANNEL_USERNAME
: The username of the Telegram channel where the bot will post news (e.g.,@yourchannel
).
- Copy the
- Python 3.9 or above π
- Pyrogram βοΈ
- aiohttp
- feedparser
- beautifulsoup4
- pymongo
- psutil
Tip: Use pip install -r requirements.txt
to install all dependencies at once! π‘
To run the bot on your local machine:
python main.py
The bot will start fetching and posting news to your channel every 40 minutes.
To run the bot on a Virtual Private Server (VPS) and keep it running in the background, use screen
:
- Install screen (if not already installed):
sudo apt-get install screen
- Start a new screen session:
screen -S techcrunch_bot
- Run the bot inside the screen session:
python main.py
- Detach from the screen session by pressing
Ctrl+A
followed byD
. - Reattach to the screen session later (if needed):
screen -r techcrunch_bot
Pro Tip: Using screen
ensures your bot keeps running even after you close the terminal! π₯οΈ
Love tech news as much as we do? Join the fun! π₯ Feel free to:
- Open an issue to report bugs or suggest enhancements.
- Submit a pull request to improve the code or add new features.
Your contributions help make this bot even better! π
This project is licensed under the MIT License. See the LICENSE file for details.
β¨ Stay ahead of the curve with TechCrunchNews Bot! β¨
Clone the repo, set it up, and enjoy a steady stream of tech updates delivered right to your Telegram channel! π