Commit d8766f75 authored by Volker Krause's avatar Volker Krause
Browse files

Add extractor for the Indico conference management system

That's used by LAS for example.
parent a2d69527
Pipeline #35475 passed with stage
in 21 minutes and 3 seconds
......@@ -48,6 +48,8 @@
<file>hotels.com.js</file>
<file>iberia.json</file>
<file>iberia.js</file>
<file>indico.json</file>
<file>indico.js</file>
<file>indigo.json</file>
<file>indigo.js</file>
<file>irctc.json</file>
......
/*
SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
function parseRegistration(html) {
var res = JsonLd.newEventReservation();
res.reservationFor.name = html.eval('//h1')[0].content;
res.reservationNumber = html.eval('//h3/span')[0].content.match(/#(.*)/)[1];
res.modifyReservationUrl = html.eval('//a')[0].attribute('href');
var time = html.eval('//div/div/p/strong/..')[0].content.match(/\((.*)\s+-\s+(.*)\)/);
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");
return res;
}
{
"filter": [
{
"header": "Subject",
"match": "^\\[Indico\\] ",
"type": "Email"
}
],
"function": "parseRegistration",
"script": "indico.js",
"type": "Html"
}
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