Browse Source

Started working on site map generator

pull/4/head
jrtechs 6 years ago
parent
commit
d177de6a16
4 changed files with 33 additions and 1 deletions
  1. +1
    -1
      README.md
  2. +5
    -0
      generateSitemap
  3. +19
    -0
      utils/generateSiteMap.js
  4. +8
    -0
      utils/sql.js

+ 1
- 1
README.md View File

@ -1,5 +1,5 @@
# NodeJSBlog
Recreating my wordpress blog in node JS.
Recreating my Wordpress blog in node JS.
## MYSQL Information

+ 5
- 0
generateSitemap View File

@ -0,0 +1,5 @@
#!/bin/bash
#
# 2/21/18 Jeffery Russell
nodejs ./utils/generateSiteMap.js

+ 19
- 0
utils/generateSiteMap.js View File

@ -0,0 +1,19 @@
const fs = require('fs');
const sql = require('../utils/sql');
var stream = fs.createWriteStream("../sitemap.txt");
stream.once('open', function(fd)
{
sql.getSiteMap().then(function(result)
{
stream.write(result);
}).then(function()
{
stream.end();
}).catch(function(err)
{
console.log(err);
});
});

+ 8
- 0
utils/sql.js View File

@ -264,5 +264,13 @@ module.exports=
var cleanD = sanitizer.sanitize(downloadURL);
var q = "select * from downloads where url='" + cleanD + "' limit 1";
return fetch(q);
},
getSiteMap: function()
{
return new Promise(function(resolve, reject)
{
});
}
};

Loading…
Cancel
Save