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

Remove another obsolete extractor script

This is all covered by the generic boarding pass extractor now.
parent 36199bec
Pipeline #82846 passed with stage
in 17 minutes and 15 seconds
/*
SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
function main(pdf, node) {
var res = [];
for (barcode of node.findChildNodes({ scope: "Descendants", mimeType: "internal/iata-bcbp" })) {
if (barcode.location == undefined)
continue;
res.push(parsePage(pdf.pages[barcode.location], barcode));
}
return res;
}
function parsePage(page, node)
{
var res = node.result[0];
var time = page.text.match(/Departing at\s+(\d{1,2}:\d{2}[AP]M)/);
if (time)
res.reservationFor.departureTime = JsonLd.toDateTime(time[1], "h:mmA", "en")
time = page.text.match(/Arriving at:\s+(\d{1,2}:\d{2}[AP]M)/);
if (time)
res.reservationFor.arrivalTime = JsonLd.toDateTime(time[1], "h:mmA", "en")
return res;
}
{
"mimeType": "application/pdf",
"filter": [
{ "field": "From", "match": "americanairlines@aa.com", "mimeType": "message/rfc822", "scope": "Ancestors" },
{ "field": "operatingCarrierDesignator", "match": "AA", "mimeType": "internal/iata-bcbp", "scope": "Descendants" }
],
"script": "americanairlines.js"
}
......@@ -18,8 +18,6 @@
<file>airdo.js</file>
<file>amadeus.json</file>
<file>amadeus.js</file>
<file>americanairlines.json</file>
<file>americanairlines.js</file>
<file>aohostels.json</file>
<file>aohostels.js</file>
<file>availpro.json</file>
......
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