Last active
June 17, 2022 10:32
-
-
Save ahmadbilaldev/eb2627f43358325186eab1fe1ddcd780 to your computer and use it in GitHub Desktop.
Save sitemap links from two URLs into separate files.
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
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