Last active
August 29, 2015 14:15
-
-
Save underr/513e3715c4746fac3efa 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
var readline = require('readline'); | |
var fs = require('fs'); | |
var isChannel = require('is-youtube-channel') | |
var rl = readline.createInterface({ | |
input : fs.createReadStream('/home/under/urls.txt'), | |
output: process.stdout, | |
terminal: false | |
}); | |
rl.on('line', function(line){ | |
channel = line.split('/')[4]; | |
isChannel(channel, function(err, valid){ | |
if (valid) { | |
fs.appendFile('valid-yt.txt', line + '\n'); | |
} else { | |
fs.appendFile('disabled-yt.txt', line + '\n') | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment