yawoffeh / past_questions_bot

A bot hosted on telegram to allow University of Ghana students to download past questions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Legon Past Questions Bot

Unofficial telegram bot for Legon

This is a Python-based Telegram bot designed for the University of Ghana. It enables users to crawl the university's past questions page, search for a specific past question, and return it based on their selection. The bot integrates several powerful libraries, including Python-Telegram-Bot, Selenium, BeautifulSoup4, to provide seamless functionality.

Access

You can find the bot on https://t.me/legon_pasco_bot.

Prerequisites

Before running the script, please make sure you have the following:

  • A telegram token and a telegram bot. Get it from @botfather on telegram.
  • A username(student ID) and a password to access the site. Get it from the Balme library(Legon).
  • If you are using the webhooks option and not polling(local host), you'll need a url from your hosting server.

Getting Started

  1. Clone the repository:

    git clone <https://github.com/Daquiver1/past_questions_bot>
  2. Change to the project directory:

    cd past_questions_bot
  3. Install the required dependencies:

     pip install -r requirements.txt
  4. Rename the .env.template file to .env and update the environment variables with your own values.

  5. Run unit tests.

    python -m unit -v
  6. Run integration tests.

    python -m integration -v 
  7. Run the python file with the following command:

    python src/main.py
  8. The app is now running.

Bot Preview

image1 image2 image3 image4

TODO

  • Include files in the next page.
  • Add an all feature which will download all the available past questions specified.
  • Let the options be displayed in one message instead of a plethora of messages.
  • Add test cases.
  • Cache all files downloaded to avoid downloading them again.
  • Integrate with an s3 bucket to store all downloaded files.
  • Integrate Datadog for monitoring.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please create an issue or submit a pull request.

Contact

Gmail Linkedin Twitter Medium


if youEnjoyed:
    starThisRepository()

About

A bot hosted on telegram to allow University of Ghana students to download past questions.


Languages

Language:Python 99.9%Language:Procfile 0.1%