Commit 8b09a8eb authored by Volker Krause's avatar Volker Krause
Browse files

Extract onepagebooking.com pkpass files as well

parent 20b287ea
Pipeline #166889 passed with stages
in 1 minute and 50 seconds
......@@ -59,3 +59,18 @@ function main(content) {
return res
}
function parsePkPass(pass)
{
var res = JsonLd.newLodgingReservation();
res.reservationFor.name = pass.organizationName;
res.checkinTime = JsonLd.toDateTime(pass.field['BGcheckin'].value.substr(0, 18), 'dd.MM.yyyy - hh:mm', 'de');
res.checkoutTime = JsonLd.toDateTime(pass.field['BGcheckout'].value.substr(0, 18), 'dd.MM.yyyy - hh:mm', 'de');
res.reservationFor.geo.latitude = pass.locations[0].latitude;
res.reservationFor.geo.longitude = pass.locations[0].longitude;
res.reservationFor.address.streetAddress = pass.field['address'].value;
res.reservationFor.telephone = pass.field['phone'].value;
res.reservationNumber = pass.field['bookId'].value;
res.underName.name = pass.field['guestname'].value;
return res;
}
{
[{
"filter": [
{
"field": "From",
......@@ -10,4 +10,17 @@
"function": "main",
"mimeType": "text/plain",
"script": "onepagebooking.js"
}
},
{
"filter": [
{
"field": "passTypeIdentifier",
"match": "pass.onepagebooking.com",
"mimeType": "application/vnd.apple.pkpass",
"scope": "Current"
}
],
"function": "parsePkPass",
"mimeType": "application/vnd.apple.pkpass",
"script": "onepagebooking.js"
}]
Supports Markdown
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