An unofficial Telegram bot for students of University of Padua (Unipd) - try it at @UnipdBot!
Still in early stage, the code is messy and the bot might be unresponsive. Be careful!
I wanted to make a bot with commands that can be upgraded and changed at any time, without having to mess with the code.
The bot pulls commands from a Deployd app running at unipd.xyz... but this part has to be improved more. An example: http://unipd.xyz/commands
Moreover, the bot can send data parsed from the University's website. An example is in the update_mensa.py file: this one updates the Bot's APIs with data about the Unipd's canteens (today's menu and open or close). More data and commands will be added soon.
Just some simple instructions if you want to test the bot
pip install -r requirements.txt- Rename settings.ini.sample to settings.ini
- Create an access token with Telegram's @Botfather and place it in
settings.ini. - Switch into the
dbfolder and runpython createdb_logs.py. - Run
mydb.pyto create a localpickledbdatabase in which you'll store commands. - If you want to use the
/statscommand, you must retrieve your Telegram User Id and put it intosettings.ini. - The
authsetting insettings.iniis needed inupdate_mensa.py. Only when a validauthtoken is supplied, you'll be able to makePUT/POST/DELETErequests to unipd.xyz.GETrequests are all public.
Using the Unipd's Unofficial APIs.
Feel free to use the data provided by the Unipd's Unofficial APIs! Only GET requests are available.
Endpoints:
- http://unipd.xyz/aulastudio: data about Unipd's study rooms.
- http://unipd.xyz/mensa: data about Unipd's canteens.
- http://unipd.xyz/biblioteca: data about Unipd's libraries.
Read LICENSE file for @UnipdBot's license.
This bot uses also:
- python-telegram-bot
- beautifulsoup4
- requests
- pickledb
- geopy
- simplejson
- arrow
- Python, Internet, Telegram, and all those nice things.
For anything (bugs, contributing, saying hi!), contact me on Telegram at @mikexine or via e-mail at mikexine@gmail.com