Commit 9132e014 authored by Volker Krause's avatar Volker Krause
Browse files

Merge branch 'release/20.04'

parents 745aee68 bc8b78d4
Pipeline #24138 passed with stage
in 21 minutes and 37 seconds
...@@ -131,11 +131,14 @@ function parseOuigoConfirmation(html) ...@@ -131,11 +131,14 @@ function parseOuigoConfirmation(html)
var productDts = html.eval('//*[@class="product-travel-date"]'); var productDts = html.eval('//*[@class="product-travel-date"]');
var productDetails = html.eval('//table[@class="product-details"]'); var productDetails = html.eval('//table[@class="product-details"]');
var passengerDetails = html.eval('//table[@class="passengers"]');
for (productDetailIdx in productDetails) { for (productDetailIdx in productDetails) {
// date is in the table before us // date is in the table before us
var dt = productDts[productDetailIdx].content.replace(/\S+ (.*)/, "$1"); var dt = productDts[productDetailIdx].content.replace(/\S+ (.*)/, "$1");
var segmentDetail = productDetails[productDetailIdx].eval(".//td")[0]; var segmentDetail = productDetails[productDetailIdx].eval(".//td")[0];
var placement = passengerDetails[productDetailIdx].eval('.//td[@class="placement "]'); // yes, there is a space behind placement there...
var seat = placement[0].content.match(/Voiture (.*?) - Place (.*?) /);
var res = null; var res = null;
while (segmentDetail && !segmentDetail.isNull) { while (segmentDetail && !segmentDetail.isNull) {
var cls = segmentDetail.attribute("class"); var cls = segmentDetail.attribute("class");
...@@ -144,6 +147,10 @@ function parseOuigoConfirmation(html) ...@@ -144,6 +147,10 @@ function parseOuigoConfirmation(html)
res.reservationFor.departureTime = JsonLd.toDateTime(dt + segmentDetail.content, "d MMMMhh'h'mm", "fr"); res.reservationFor.departureTime = JsonLd.toDateTime(dt + segmentDetail.content, "d MMMMhh'h'mm", "fr");
segmentDetail = segmentDetail.nextSibling; segmentDetail = segmentDetail.nextSibling;
res.reservationFor.departureStation.name = segmentDetail.content; res.reservationFor.departureStation.name = segmentDetail.content;
if (seat) {
res.reservedTicket.ticketedSeat.seatSection = seat[1];
res.reservedTicket.ticketedSeat.seatNumber = seat[2];
}
} }
else if (cls.includes("segment-arrival")) { else if (cls.includes("segment-arrival")) {
res.reservationFor.arrivalTime = JsonLd.toDateTime(dt + segmentDetail.content, "d MMMMhh'h'mm", "fr"); res.reservationFor.arrivalTime = JsonLd.toDateTime(dt + segmentDetail.content, "d MMMMhh'h'mm", "fr");
......
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