Created
February 20, 2022 11:39
-
-
Save BolajiAyodeji/8b76cbf713b8473a5dace4d2b96b9d8d to your computer and use it in GitHub Desktop.
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 fs = require("fs"); | |
const url = | |
"https://bolajiayodeji.github.io/fed-unis-perf-eval/lighthouse%20report/"; | |
fs.readFile("text.txt", "utf8", function (err, links) { | |
// get all text per line in links | |
const lines = links.split("\n"); | |
//replace spaces with %20 | |
const linesWithSpaces = lines.map((line) => line.replace(/\s/g, "%20")); | |
// add url to beginning of each linewithspaces | |
const linesWithUrls = linesWithSpaces.map((line) => url + line); | |
fs.readFile("sites.txt", "utf8", function (err, data) { | |
// get all text per line in data concat to lineswithurls | |
const lines = data.split("\n"); | |
console.log(lines); | |
console.log(linesWithUrls); | |
const yeah = linesWithUrls.map((lines) => linesWithUrls + "/" + lines); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment