-
-
Save aowongster/a69c84b66c74ca037e7094bed61e48b0 to your computer and use it in GitHub Desktop.
Revisions
-
aowongster revised this gist
Apr 7, 2017 . 1 changed file with 13 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,20 @@ var csv2 = require('csv2'); const alexa = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip' const majestic = 'http://downloads.majesticseo.com/majestic_million.csv' const sources = [majestic]; const zSources = [alexa]; source.forEach(getFile); zSources.forEach(getZFile); const getFile = (url) => { request.get(url) .on('entry', function (entry) { entry.pipe(csv2()).on('data', console.log); }); } const getZFile = (url) => { request.get(url) .pipe(unzip.Parse()) .on('entry', function (entry) { -
aowongster revised this gist
Apr 7, 2017 . 1 changed file with 12 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,9 +2,15 @@ var request = require('request'); var unzip = require('unzip'); var csv2 = require('csv2'); const alexa = 'http://s3.amazonaws.com/alexa-static/top-1m.csv.zip' const majestic = 'http://downloads.majesticseo.com/majestic_million.csv' const sources = [alexa, majestic]; sources.forEach((url)=> { request.get(url) .pipe(unzip.Parse()) .on('entry', function (entry) { entry.pipe(csv2()).on('data', console.log); }); } -
chilts created this gist
Oct 30, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ var request = require('request'); var unzip = require('unzip'); var csv2 = require('csv2'); request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip') .pipe(unzip.Parse()) .on('entry', function (entry) { entry.pipe(csv2()).on('data', console.log); }) ;