Created
June 5, 2020 12:55
-
-
Save hayleyxyz/fa6d7b9e5504b7e8bedb320ee150ea00 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 xmlstr = fs.readFileSync('BingConfiguration\\BingConfiguration_common.xml').toString(); | |
const m = xmlstr.match(/[a-z\.]+\.com/ig); | |
const hosts = [ ]; | |
for (let index = 0; index < m.length; index++) { | |
const element = m[index]; | |
if(!hosts.includes(element)) { | |
hosts.push(element); | |
} | |
} | |
const hostsLine = `127.0.0.1 ${hosts.join(' ')}`; | |
console.log(hostsLine); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment