Skip to content
GitLab
Menu
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
0a475e3f
Commit
0a475e3f
authored
Apr 25, 2022
by
Volker Krause
Browse files
Handle minor variations in the phone number part from simplebooking.it
Also, extract the guest name while at it.
parent
48e0160c
Pipeline
#168308
passed with stages
in 3 minutes and 28 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/lib/scripts/simplebooking.js
View file @
0a475e3f
...
...
@@ -18,12 +18,15 @@ function parseHtml(doc)
res
.
reservationFor
.
geo
.
latitude
=
text
.
match
(
/Latitude:
\s(
-
?\d
+.
\d
+
)
/
)[
1
]
*
1.0
;
res
.
reservationFor
.
geo
.
longitude
=
text
.
match
(
/Longitude:
\s(
-
?\d
+.
\d
+
)
/
)[
1
]
*
1.0
;
var
addr
=
text
.
match
(
/Lodging information
[\n\s]
+
(
.*
?)\n[\n\s]
+
(
.*
?)\n[\n\s]
+
(
.*
?)\n[\n\s]
+Telephone:
(
.*
?)\n
.*
\n
*
\s
+Email:
\s
+
(
.*
?)\n\s
+Internet:
\s
+
(
.*
?)\n
/
);
var
addr
=
text
.
match
(
/Lodging information
[\n\s]
+
(
.*
?)\n[\n\s]
+
(
.*
?)\n[\n\s]
+
(
.*
?)\n[\n\s]
+
(?:
Telep
|P
)
hone:
(
.*
?)\n
.*
\n
*
\s
+Email:
\s
+
(
.*
?)\n\s
+Internet:
\s
+
(
.*
?)\n
/
);
res
.
reservationFor
.
address
.
streetAddress
=
addr
[
2
];
res
.
reservationFor
.
address
.
addressLocality
=
addr
[
3
];
res
.
reservationFor
.
telephone
=
addr
[
4
];
res
.
reservationFor
.
email
=
addr
[
5
];
res
.
reservationFor
.
url
=
addr
[
6
];
const
guest
=
text
.
match
(
/Guest data
[\n\s]
+Name:
(
.*
)
/
);
res
.
underName
.
name
=
guest
[
1
];
return
res
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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