Commit 20b287ea authored by Volker Krause's avatar Volker Krause
Browse files

Make the onepagebooking.com email extractor slightly more tolerant

parent c0145091
......@@ -6,12 +6,12 @@
function main(content) {
const resId = content.match(/Buchungsnummer:(.+)/)[1]
const resId = content.match(/Buchungsnummer:\n?\s*(.+)/)[1]
const arrivalDate = content.match(/Anreisetag: (.+)/)[1]
const departureDate = content.match(/Abreisetag: (.+)/)[1]
const arrivalDate = content.match(/Anreisetag:\n? (.+)/)[1]
const departureDate = content.match(/Abreisetag:\n? (.+)/)[1]
const guestName = content.match(/Gastname: (Herr|Frau) (.+)/)[2]
const guestName = content.match(/Gastname:\n? (?:Herr|Frau)? ?(.+)/)[1]
const addressBlock = content.match(/Ihr\n(.*)\n(.*)\n(.*)/)
......@@ -30,11 +30,11 @@ function main(content) {
const telephone = content.match(/Tel.: (.*)/)[1]
const email = content.match(/E-Mail: (.*)/)[1]
const price = content.match(/Gesamtpreis: (.*) EUR/)[1].replace(',', '.')
const price = content.match(/Gesamtpreis:\n? (.*) EUR/)[1].replace(',', '.')
const numberAdults = content.match(/Anzahl der Erwachsene[rn]: ([0-9]+)/)[1]
const numberAdults = content.match(/Anzahl der Erwachsene[rn]:\n? ([0-9]+)/)[1]
const numberChildren = content.match(/Anzahl der Kinder: ([0-9]+)/)[1]
const numberChildren = content.match(/Anzahl der Kinder:\n? ([0-9]+)/)[1]
var res = JsonLd.newLodgingReservation()
......
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