Skip to content

Instantly share code, notes, and snippets.

@underr
Last active August 29, 2015 14:15
Show Gist options
  • Save underr/513e3715c4746fac3efa to your computer and use it in GitHub Desktop.
Save underr/513e3715c4746fac3efa to your computer and use it in GitHub Desktop.
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