Commit 2dc7df32 authored by Volker Krause's avatar Volker Krause
Browse files

Improve Indico extractor

This allows to differentiate the e.g. the Akademy 2021 and QtCS 2021
booking, which only differ in the subtitle.
parent 8a2325f4
Pipeline #70194 passed with stage
in 10 minutes and 4 seconds
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
function parseRegistration(html) { function parseRegistration(html) {
var res = JsonLd.newEventReservation(); var res = JsonLd.newEventReservation();
res.reservationFor.name = html.eval('//h1')[0].content; res.reservationFor.name = html.eval('//h1')[0].content;
const subtitle = html.eval('//h3')[0].content;
if (subtitle)
res.reservationFor.name += ' - ' + subtitle;
res.reservationNumber = html.eval('//h3/span')[0].content.match(/#(.*)/)[1]; res.reservationNumber = html.eval('//h3/span')[0].content.match(/#(.*)/)[1];
res.modifyReservationUrl = html.eval('//a')[0].attribute('href'); res.modifyReservationUrl = html.eval('//a')[0].attribute('href');
...@@ -14,5 +17,11 @@ function parseRegistration(html) { ...@@ -14,5 +17,11 @@ function parseRegistration(html) {
res.reservationFor.startDate = JsonLd.toDateTime(time[1], "dd MMM yyyy, hh:mm", "en"); res.reservationFor.startDate = JsonLd.toDateTime(time[1], "dd MMM yyyy, hh:mm", "en");
res.reservationFor.endDate = JsonLd.toDateTime(time[2], "dd MMM yyyy, hh:mm", "en"); res.reservationFor.endDate = JsonLd.toDateTime(time[2], "dd MMM yyyy, hh:mm", "en");
const dds = html.eval('//dd');
if (dds.length >= 2) {
res.underName.givenName = dds[0].content;
res.underName.familyName = dds[1].content;
}
return res; return res;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment