Debug
This commit is contained in:
parent
5d6fa2c909
commit
6de5e087df
1 changed files with 11 additions and 7 deletions
|
@ -141,10 +141,14 @@ const getStationName = (start, callback) => {
|
||||||
} else {
|
} else {
|
||||||
const html = htmlparser(body);
|
const html = htmlparser(body);
|
||||||
const name = html
|
const name = html
|
||||||
.querySelector("strong")?
|
.querySelector("strong");
|
||||||
.toString()?
|
|
||||||
.replace(/[<>/]/g, "")?
|
if ( name ) {
|
||||||
.replace(/strong/g, "") || null;
|
name = name
|
||||||
|
.toString()?
|
||||||
|
.replace(/[<>/]/g, "")?
|
||||||
|
.replace(/strong/g, "") || null;
|
||||||
|
}
|
||||||
|
|
||||||
if (name) {
|
if (name) {
|
||||||
item.name = name;
|
item.name = name;
|
||||||
|
@ -209,9 +213,9 @@ fs.readFile("public/gas-stations.xml", function(err, data) {
|
||||||
},
|
},
|
||||||
prices: extractPrice(currentStation),
|
prices: extractPrice(currentStation),
|
||||||
services:
|
services:
|
||||||
currentStation.services && currentStation.services.service
|
currentStation.services && currentStation.services.service
|
||||||
? currentStation.services.service
|
? currentStation.services.service
|
||||||
: [],
|
: [],
|
||||||
postCode: currentStation.cp.toString(),
|
postCode: currentStation.cp.toString(),
|
||||||
address: currentStation.adresse,
|
address: currentStation.adresse,
|
||||||
city: currentStation.ville
|
city: currentStation.ville
|
||||||
|
|
Loading…
Reference in a new issue