aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-20course: use a proper type to iterate over a course descriptionAlban Gruin
Currently, to find a course's summary and location, there is a pattern matching over a ad-hoc 3-uple of a boolean and two strings. To make it clear, this badly defined structure is replaced by an actual ADT, `loc_and_sum', containing 4 cases: - `Nothing', when the groups has not been found yet; - `Groups', when the groups has been found by `check_groups'. This means that the next line should be the course's location; - `Location', when the location has been found. If there is no new line to read, the string is the location, otherwise it's the summary, and the next line should be the actual location; - `Summary', when the location and summary has been both found. All subsequent lines will be ignored. A function is also added to convert a `loc_and_sum' to a couple of string containing the location and the summary. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-19course: use a match/with instead of a if-chain in `location_and_summary'Alban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-19course: memoized version of `get_unicode'Alban Gruin
To avoid creating buffers to decode an HTML entity, this create a memoized version of `get_unicode' in hope to operate a bit faster and reduce memory allocations. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-19course: invert the `group_affix' list orderAlban Gruin
Each affix is tested with a `List.fold_left', which means that the list is traversed in order. Hence, the most likely results should be at the beginning of the list, not at the end. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-19course: return the summary if there is no " - " in the event's full nameAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-14ics: timestamps are in local time, not UTCAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13µCS v0.1.0v0.1.0Alban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13ucs: add command line parameters, powered by cmdlinerAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13server: set the range to fetch to a year and a monthAlban Gruin
To fetch all interesting courses, the start date is set to a month before today, and the end date is set to a year after today. This should be enough for our iCalendar files. Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13ucs: move the server to its own moduleAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13ucs: remove use of `ignore' an the main functionAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13ucs: show parameters in the logAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13ucs: add URLs to the HTML pages, read parameters in the URLAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13ucs: add a helper to send quickly a 200 OK responseAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13Add webpages and styleAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13course: remove the part before " - " (module ID) in the course summaryAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-13course: convert html entities to unicode charactersAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-12ucs: log queriesAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-12ucs: fetch group based on URLAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-12ucs: adding a basic webserver, only returning an ICS file on GET queriesAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-12course: use Astring to split strings and to check for prefixesAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-12Remove unused functions and useless type specificationsAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-12ics: split long lines according to the iCalendar specificationAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-12course: avoid crashes for events spanning on a whole dayAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-11course: stop parsing unused fieldsAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-11ics: clean Event module, conversion to stringAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-10course: properly decode location and course nameAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-09course, ics: proper modules, proper datetime storageAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-09main: add license noticeAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-07ucs: first basic parser of json eventsAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>
2020-09-06hello, worldAlban Gruin
Signed-off-by: Alban Gruin <alban@pa1ch.fr>