Skip to content

Latest commit

 

History

History
100 lines (76 loc) · 4.02 KB

File metadata and controls

100 lines (76 loc) · 4.02 KB

🚀 TechCrunchNews Bot 🌐

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

🌟 Features

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

🛠️ Setup

Follow these simple steps to get the bot up and running:

  1. Clone the Repository 📂:

    git clone https://github.com/abirxdhack/TechCrunchNews.git
    cd TechCrunchNews
  2. Install Dependencies 🛠️: Make sure you have Python 3.9 or above installed. Install the required packages using:

    pip install -r requirements.txt
  3. Configure the Bot ⚙️:

    • Copy the config.py template and create your own config.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).

📋 Requirements

  • Python 3.9 or above 🐍
  • Pyrogram ⭐️
  • aiohttp
  • feedparser
  • beautifulsoup4
  • pymongo
  • psutil

Tip: Use pip install -r requirements.txt to install all dependencies at once! 💡

🚀 Running the Bot

Locally 💻

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.

On a VPS ☁️

To run the bot on a Virtual Private Server (VPS) and keep it running in the background, use screen:

  1. Install screen (if not already installed):
    sudo apt-get install screen
  2. Start a new screen session:
    screen -S techcrunch_bot
  3. Run the bot inside the screen session:
    python main.py
  4. Detach from the screen session by pressing Ctrl+A followed by D.
  5. 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! 🖥️

🤝 Contributing

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! 🌐

📜 License

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! 👀