This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var https = require('https'); | |
var xml2js = require('xml2js'); | |
var parser = new xml2js.Parser(); | |
const fs = require('fs'); | |
parser.on('error', function(err) { console.log('Parser error', err); }); | |
var data = ''; | |
https.get('https://www.trafikoa.eus/servicios/IncidenciasTDT/IncidenciasTrafikoTDTGeo', function(res) { | |
if (res.statusCode >= 200 && res.statusCode < 400) { | |
res.on('data', function(data_) { data += data_.toString(); }); |