Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
9132e014
Commit
9132e014
authored
Jun 17, 2020
by
Volker Krause
Browse files
Merge branch 'release/20.04'
parents
745aee68
bc8b78d4
Pipeline
#24138
passed with stage
in 21 minutes and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/extractors/sncf.js
View file @
9132e014
...
...
@@ -131,11 +131,14 @@ function parseOuigoConfirmation(html)
var
productDts
=
html
.
eval
(
'
//*[@class="product-travel-date"]
'
);
var
productDetails
=
html
.
eval
(
'
//table[@class="product-details"]
'
);
var
passengerDetails
=
html
.
eval
(
'
//table[@class="passengers"]
'
);
for
(
productDetailIdx
in
productDetails
)
{
// date is in the table before us
var
dt
=
productDts
[
productDetailIdx
].
content
.
replace
(
/
\S
+
(
.*
)
/
,
"
$1
"
);
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
;
while
(
segmentDetail
&&
!
segmentDetail
.
isNull
)
{
var
cls
=
segmentDetail
.
attribute
(
"
class
"
);
...
...
@@ -144,6 +147,10 @@ function parseOuigoConfirmation(html)
res
.
reservationFor
.
departureTime
=
JsonLd
.
toDateTime
(
dt
+
segmentDetail
.
content
,
"
d MMMMhh'h'mm
"
,
"
fr
"
);
segmentDetail
=
segmentDetail
.
nextSibling
;
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
"
))
{
res
.
reservationFor
.
arrivalTime
=
JsonLd
.
toDateTime
(
dt
+
segmentDetail
.
content
,
"
d MMMMhh'h'mm
"
,
"
fr
"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment