Commit 79c791c2 authored by Volker Krause's avatar Volker Krause
Browse files

Add Pretix pkpass extractor script

parent 20dcd7f0
Pipeline #95375 passed with stage
in 5 minutes and 25 seconds
......@@ -98,6 +98,8 @@
<file>oebb.js</file>
<file>onepagebooking.json</file>
<file>onepagebooking.js</file>
<file>pretix.json</file>
<file>pretix.js</file>
<file>regiojet.json</file>
<file>regiojet.js</file>
<file>regiondo.json</file>
......
/*
SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
function parsePass(content, node) {
var res = node.result[0];
res.reservationFor.name = content.field['eventName'].value;
res.reservationFor.startDate = JsonLd.toDateTime(content.field['doorsOpen'].value, 'dd.MM.yyyy hh:mm', 'de');
res.reservationFor.endDate = JsonLd.toDateTime(content.field['doorsClose'].value, 'dd.MM.yyyy hh:mm', 'de');
res.reservationFor.url = content.field['website'].value;
res.underName = JsonLd.newObject('Person');
res.underName.name = content.field['name'].value;
res.reservationNumber = content.field['orderCode'].value;
return res;
}
{
"filter": [
{
"field": "passTypeIdentifier",
"match": "pass.eu.pretix.ticket",
"mimeType": "application/vnd.apple.pkpass",
"scope": "Current"
}
],
"function": "parsePass",
"mimeType": "application/vnd.apple.pkpass",
"script": "pretix.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