Skip to content

This is a Telegram bot written in Python that gets student's marks based on their ID number

License

Notifications You must be signed in to change notification settings

ObaidaNa/albaath-marks

Repository files navigation

Telegram Bot for University Marks Scraping

Made with Python Open Source Love MIT License

This is a Telegram bot written in Python that generates an HTML file or a text message for a student's marks based on their ID number in Albaath-Universty - IT College.

Table of Contents

About the Code

This project is a modular bot, made using Python 3 and the following libraries:

How the bot works

The bot scrapes a student marks table and converts the list of students' marks into an HTML table. For example:

university_page_example

The list of students' marks will look like this in HTML:

html_table

Features

  • The bot allows the user to obtain an HTML file of a single student's marks by providing their ID number using the /html command.
  • The bot also sends a normal text message of a student's marks to the user.
  • The bot can also generate an HTML file of all students whose ID numbers are within a certain range using the /in_range command.
  • The bot can work in inline mode, so you can type your bot username then the ID number of a students (you should enable inline mode in your bot from @BotFather settings > Inline Mode > Turn on).

Prerequisites

Before you use this bot, you need to have:

  • A working Telegram account.
  • A bot token, which can be obtained by talking to BotFather on Telegram.

Getting Started

  1. Clone this repository to your local machine.

    git clone https://github.com/ObaidaNa/albaath-marks.git
    cd albaath-marks
  2. Add your bot token to the config.json file.

  3. Install the required packages using the following command:

    pip install -r requirements.txt
  4. Run the bot:

    python source/main.py

Notes:

  • You can change the start message in the config.json file.
  • Also you can specify the html file caption (when it sended to the user) and the HTML sign (which appears on the top of the HTML file)
  • Environment variables have a priority over the config.json file variables, so you can leave config.json empty and only pass environment variables instead.
  • To convert an HTML file to PDF, here's some websites I've tested and was working fine with Arabic:

Contributions

If you would like to contribute to this project, feel free to submit a pull request. All contributions are welcome and appreciated!

License

This project is licensed under the MIT License.

About

This is a Telegram bot written in Python that gets student's marks based on their ID number

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published