Skip to content

Instantly share code, notes, and snippets.

@nodew
Created July 21, 2016 14:01
Show Gist options
  • Save nodew/0f7821d44a97a471ea2f24a1ed053d8d to your computer and use it in GitHub Desktop.
Save nodew/0f7821d44a97a471ea2f24a1ed053d8d to your computer and use it in GitHub Desktop.
count 'UCanUup' in the file 'http://106.75.28.160/UCloud.txt'
var http = require('http');
http.get('http://106.75.28.160/UCloud.txt', function(res) {
var body = '';
res.on('data', function(d) {
body += d;
});
res.on('end', function() {
var count = body.match(/UCanUup/g).length
console.log(count);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment