Skip to content

Instantly share code, notes, and snippets.

@BolajiAyodeji
Created February 20, 2022 11:39
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 BolajiAyodeji/8b76cbf713b8473a5dace4d2b96b9d8d to your computer and use it in GitHub Desktop.
Save BolajiAyodeji/8b76cbf713b8473a5dace4d2b96b9d8d to your computer and use it in GitHub Desktop.
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