cleaned out the tags from the UNESCO data

This commit is contained in:
2020-01-05 01:53:21 -05:00
parent 7d09bfafb3
commit 19c91b0a9e
4 changed files with 102 additions and 2 deletions

View File

@ -1,6 +1,7 @@
var con = require('./db');
var fs = require('fs');
var parser = require('fast-xml-parser');
var htmlToText = require('html-to-text');
var string = fs.readFileSync(process.cwd() + '/data/unesco.xml', 'utf8').toString();
@ -15,7 +16,8 @@ val.query.row.forEach(function(site){
s.push(site.http_url);
s.push(site.latitude);
s.push(site.longitude);
s.push(site.short_description);
// Crazy that this works, but it does..
s.push(htmlToText.fromString(htmlToText.fromString(site.short_description), { wordwrap: false }));
s.push(site.site);
s.push(site.unique_number);
// console.log(s);