Created
June 1, 2015 20:41
-
-
Save jaime-ez/67a17ff8869b547e33b3 to your computer and use it in GitHub Desktop.
forbidden usernames
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
// alexa most visited domains: http://s3.amazonaws.com/alexa-static/top-1m.csv.zip | |
var domains = require('./domains.json'); | |
//consider the first x most visited urls | |
var limit = 50000; | |
//forbidden words: https://github.com/shouldbee/reserved-usernames/blob/master/reserved-usernames.json | |
var forbidden = require('./forbidden.json'); | |
var output = {}; | |
for (i=0; i < limit ; i++) { | |
var temp = domains[i]; | |
var n = temp.split('.')[0]; | |
//just keep the most visited domain and do not consider number domains | |
if (!output[n] && !Number(n)) { | |
output[n] = temp; | |
} | |
} | |
for (j=0; j< forbidden.length; j++) { | |
var f = forbidden[j]; | |
if(!output[f]){ | |
output[f] = f; | |
} | |
} | |
console.log(JSON.stringify(output)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment