Introduction
Here you find some information about how to adapt my backend scripts for you university.What you need
The scripts have been developed on a Linux machine. It should run on most Un*x systems though. My scripts use Perl and several modules that you will need to install. See below for more information.To be really useful you will need a machine that can create the database automagically at defined time intervals.
Fetching the data
I have got the following scenario for the RWTH Aachen: There is a website of the Studentenwerk Aachen that I can use to get the data. Then I download the site and replace the HTML entities (this is done in getmensa.pl). Then I parse the data with the HTML::TreeBuilder Perl module and output the needed plain data file (this is done with parsemensa.pl).The plain data file
The file that I use for all my viewers is a plain data file. The name of the file must be mensa.pre in order for the clients to work. I have only tested this with mensa.pre being encoded as ISO-8859-1. The format is really simple:block --- block ... ---Where the first block MUST be:
University name (not more than 15 characters!) Number of Mensas (an int, not more than 16) From Date (format: YYYY/MM/DD) To date (format as from date)The first block must have exactly these four lines.
The second block MUST contain the names of the mensas with one per line. You must provide exactly as many names as you defined in the first block and they may be no longer than 15 characters.
All following blocks contain the menus for the mensas. One block contains the menus for the whole week of one mensa. The blocks must be in the same order as the mensa names in the second block! Each block has exactly six lines. The first line is for monday, the second for tuesday up to the sixth line containing the menu for saturday. Each menu line contains any number of menus separated by double colon (::). Each line may be no longer than 2047 characters! See this example.
There are several assumptions made but this makes it a lot easier on my side to get all the software together.