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

Add extractors for Stuttgarter Bäder PkPass tickets

parent faf889a4
Pipeline #67700 passed with stages
in 12 minutes and 29 seconds
......@@ -101,6 +101,8 @@
<file>sncf.js</file>
<file>stansted-express.json</file>
<file>stansted-express.js</file>
<file>stuttgarter-baeder.json</file>
<file>stuttgarter-baeder.js</file>
<file>swiss.json</file>
<file>swiss.js</file>
<file>terminland-de.json</file>
......
/*
SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
function parseReservation(pass, node) {
var res = node.result[0];
res.reservationFor.name = pass.field['valid-locations'].value;
res.reservationFor.startDate = pass.field['valid-date'].value;
const endTime = pass.field['valid-time-range'].value.match(/-(\d+):(\d+)/);
var endDt = pass.field['valid-date'].value;
endDt.setHours(endTime[1]);
endDt.setMinutes(endTime[2]);
res.reservationFor.endDate = endDt;
res.reservationFor.url = pass.field['website'].value;
res.underName = JsonLd.newObject("Person");
res.underName.name = pass.field['customer_name'].value;
return res;
}
{
"filter": [
{
"field": "passTypeIdentifier",
"match": "pass\\.de\\.bs\\..*-baeder-suite",
"mimeType": "application/vnd.apple.pkpass",
"scope": "Current"
}
],
"function": "parseReservation",
"mimeType": "application/vnd.apple.pkpass",
"script": "stuttgarter-baeder.js"
}
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