A simple API to get the weekly/daily ERSUCatania Mensa menu!
Via a regex matching it looks for the current week PDF menu directly from ERSUCatania's website.
After obtaining the link, the file is downloaded and processed with a service called 'Ilovepdf' that extracts the text from the PDF using OCR technologies.
Got the raw text I clean it using regex and applying some replacements to fix problems that may occur due to typos. After that I get a line per line list of the planned dishes for the week.
Finally I can sort the dishes for each day and time.
This process will be performed every 15 minutes when the current week menu is missing on the server.
- PHP 7.2 >=
- Composer
- Cron
- Nginx* or Apache
*Nginx requires a particular block server to make Lumen works.
- Clone this repository on your www folder
- Run composer to install all the dependencies: composer install
- Rename .env.example into .env and fill it with your data
- Add this cronjob to run every minute the Lumen scheduling: * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
- You are ready to go.
- PDF to readable list conversion
- Auto fetch for new menu
- Simple API
- Auto learning system to fix typos
- Error Reporting mailing system
- High customization of the environment
- Clean code style
- The API's documentation is available inside the documentation folder