Commit 268e3ef8 authored by Volker Krause's avatar Volker Krause
Browse files

Enable direct barcode extraction for Renfe

parent 854b9b41
......@@ -35,6 +35,9 @@ function parseBarcode(barcode)
res.reservationFor.departureStation.identifier = "uic:71" + barcode.substr(13, 5);
res.reservationFor.arrivalStation.identifier = "uic:71" + barcode.substr(18, 5);
res.reservationFor.departureDay = JsonLd.toDateTime(barcode.substr(23, 6), 'ddMMyy', 'es');
res.reservationFor.departureStation.name = barcode.substr(13, 5);
res.reservationFor.arrivalStation.name = barcode.substr(18, 5);
return res;
}
......
......@@ -21,4 +21,16 @@
"function": "parsePkPass",
"mimeType": "application/vnd.apple.pkpass",
"script": "renfe.js"
},
{
"filter": [
{
"match": "^\\d{29}.*\\S{6}(\\.\\.\\S{5}| +)?$",
"mimeType": "text/plain",
"scope": "Current"
}
],
"function": "parseBarcode",
"script": "renfe.js",
"mimeType": "text/plain"
}]
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