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.
You can find the bot on https://t.me/legon_pasco_bot.
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.
-
Clone the repository:
git clone <https://github.com/Daquiver1/past_questions_bot>
-
Change to the project directory:
cd past_questions_bot
-
Install the required dependencies:
pip install -r requirements.txt
-
Rename the
.env.template
file to.env
and update the environment variables with your own values. -
Run unit tests.
python -m unit -v
-
Run integration tests.
python -m integration -v
-
Run the python file with the following command:
python src/main.py
-
The app is now running.
- 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.
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please create an issue or submit a pull request.
if youEnjoyed:
starThisRepository()