Skip to content

Instantly share code, notes, and snippets.

@ahmadbilaldev
Last active June 17, 2022 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmadbilaldev/eb2627f43358325186eab1fe1ddcd780 to your computer and use it in GitHub Desktop.
Save ahmadbilaldev/eb2627f43358325186eab1fe1ddcd780 to your computer and use it in GitHub Desktop.
Save sitemap links from two URLs into separate files.
const getLinks = require('sitemap-links');
fs = require('fs');
(async () => {
const newSitemapLink = '';
const oldSitemapLink = '';
const newLinks = await getLinks(newSitemapLink);
const oldLinks = await getLinks(oldSitemapLink);
newLinks.sort();
oldLinks.sort();
fs.writeFile('new.md', newLinks.join('\n'), function (err) {
console.log('Extract saved successful');
});
fs.writeFile('old.md', oldLinks.join('\n'), function (err) {
console.log('Extract saved successful');
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment