Skip to content

A Python script that checks for new or edited posts on the AIUB Notice page and sends updates to a specified Telegram channel.

License

Notifications You must be signed in to change notification settings

origamiofficial/aiub-notice-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIUB Notice Checker

Facebook Telegram Twitter LinkedIn Discord
AIUB Notice Checker We Support

A Python script that checks for new or edited posts on the AIUB Notice page and sends updates to a specified Telegram channel.

RSS Feed | Valid RSS

https://github.com/origamiofficial/aiub-notice-checker/raw/main/rss.xml

Features

  • 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.

Requirements

  • Python 3.6 or higher
  • requests library
  • lxml library
  • TELEGRAM_CHAT_ID, TELEGRAM_ADMIN_CHAT_ID, TELEGRAM_BOT_API_KEY and GITHUB_RUN_NUMBER environment variables with valid values

Usage

  1. Clone or download this repository by:
git clone origamiofficial/aiub-notice-checker
  1. Install the required libraries by:
pip install -r requirements.txt
  1. Set the environment variables outside the script according to your Telegram info
  2. Run the script using
python main.py

Contribution

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.

How it works

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.

Credit

Everything in this repo was developed using natural language processing capabilities from OpenAI's GPT-3.

Hits