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

Extract SNCF discount card barcodes

CCBUG: 453322
parent 141af23a
Pipeline #171772 passed with stage
in 8 minutes and 31 seconds
......@@ -491,3 +491,12 @@ function parseOuigoConfirmation(html) {
}
return reservations;
}
// see https://community.kde.org/KDE_PIM/KItinerary/SNCF_Barcodes#Carte_Advantage
function parseSncfCarte(code) {
var carte = JsonLd.newObject("ProgramMembership");
carte.programName = tariffs[code.substr(111, 4)];
carte.membershipNumber = code.substr(53, 17);
carte.token = 'aztec:' + code;
return carte.programName != undefined ? carte : undefined;
}
......@@ -111,5 +111,17 @@
"function": "parseOuigoConfirmation",
"mimeType": "text/html",
"script": "sncf.js"
},
{
"filter": [
{
"match": "^h0FV",
"mimeType": "text/plain",
"scope": "Current"
}
],
"function": "parseSncfCarte",
"mimeType": "text/plain",
"script": "sncf.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