Commit 0a475e3f authored by Volker Krause's avatar 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
......@@ -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;
}
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