Skip to content

KTU Announcement Bot: A Python bot that scrapes KTU Announcements and sends updates to Telegram Channel or Chat.

License

Notifications You must be signed in to change notification settings

10cyrilc/ktu-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KTU Bot

The KTU Bot is a Python-based bot that scrapes data from the Kerala Technological University (KTU) official website to provide you with the latest announcements. It retrieves information from the KTU Announcements page and delivers updates to your channel or chat.

Demo

Live Working Demo on KTU Announcements

Features

  • Scrapes the KTU Announcements page for the latest updates.
  • Sends notifications to your Telegram chat.
  • Easy setup and configuration using environment variables.

Installation

  1. Clone this GitHub repository to your local machine:

    git clone https://github.com/10cyrilc/ktu-bot.git
  2. Change to the project directory:

    cd ktu-bot
  3. Create a virtual environment to install the dependencies:

    python3 -m venv venv
  4. Activate the virtual environment:

    • For macOS/Linux:

      source venv/bin/activate
    • For Windows:

      venv\Scripts\activate
  5. Install the required dependencies:

    pip install -r requirements.txt
  6. Rename the .env.example file to .env.

  7. Open the .env file and set the following variables:

    • MONGO_URI: The connection URI for your MongoDB database.
    • SESSION_NAME: A unique identifier for your bot session.
    • BOT_ID: The ID of your Telegram bot from @Botfather.
    • CHAT_ID: The identifier for the Telegram chat where you want to receive notifications.
  8. Setup a cron job to run the bot script every 5 minutes:

    • Open your crontab file:

      crontab -e
    • Add the following line to the file:

      */5 * * * * /path/to/python3 /path/to/ktu-announcement-bot/main.py

      Replace /path/to/python3 with the absolute path to your Python 3 executable, and replace /path/to/ktu-announcement-bot/main.py with the absolute path to the main.py script of the bot.

    • Save the crontab file.

Usage

The KTU Bot will now run as a scheduled cron job, scraping the KTU Announcements page and sending notifications to your specified Telegram chat every 5 minutes.

Contributing

Contributions to the KTU Bot are welcome! If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub repository. You can also submit pull requests with your proposed changes.

License

The KTU Bot is licensed under the MIT License.

Acknowledgements

Special thanks to the developers of the libraries and frameworks used in this project:

Authors

Support Me

Buy Me A Coffee

About

KTU Announcement Bot: A Python bot that scrapes KTU Announcements and sends updates to Telegram Channel or Chat.

Topics

Resources

License

Stars

Watchers

Forks

Languages