A Python script that checks for new or edited posts on the AIUB Notice page and sends updates to a specified Telegram channel.
https://github.com/origamiofficial/aiub-notice-checker/raw/main/rss.xml
- Automatically checks for updates to the script and updates itself if necessary.
- Checks if the AIUB website is up before attempting to access the notice page.
- Checks if the XPaths values are working or needs to be updated.
- Saves information about old posts in a SQLite database to check for edits.
- Sends formatted updates to a specified Telegram channel using the Telegram Bot API.
- Generates RSS feed from the SQLite database using RSS 2.0 format.
- Python 3.6 or higher
requests
librarylxml
libraryTELEGRAM_CHAT_ID
,TELEGRAM_ADMIN_CHAT_ID
,TELEGRAM_BOT_API_KEY
andGITHUB_RUN_NUMBER
environment variables with valid values
- Clone or download this repository by:
git clone origamiofficial/aiub-notice-checker
- Install the required libraries by:
pip install -r requirements.txt
- Set the environment variables outside the script according to your Telegram info
- Run the script using
python main.py
If the administrators make any changes and break things, we will only need to update the XPath. I would be incredibly grateful for any pull requests that you might have. Just remember, there is no need to update the script version if you have made changes – it will be updated automatically.
The Python script automates the process of checking for new or edited notices on the AIUB Notice page and sending updates to a Telegram channel. It first retrieves environment variables and checks for script updates. Then, it verifies the accessibility of the AIUB website and validates XPath expressions for extracting data from the webpage. Next, it connects to a local SQLite database or creates a new one if it doesn't exist. By iterating through each notice on the AIUB Notice page, the script compares it with the database entries and updates the database accordingly. It also generates an RSS feed containing the latest notices. Finally, it sends Telegram messages for new or edited notices and closes the database connection.
Everything in this repo was developed using natural language processing capabilities from OpenAI's GPT-3.