Skip to content

Instantly share code, notes, and snippets.

@aowongster
Forked from chilts/alexa.js
Last active June 28, 2024 05:14
Show Gist options
  • Select an option

  • Save aowongster/a69c84b66c74ca037e7094bed61e48b0 to your computer and use it in GitHub Desktop.

Select an option

Save aowongster/a69c84b66c74ca037e7094bed61e48b0 to your computer and use it in GitHub Desktop.

Revisions

  1. aowongster revised this gist Apr 7, 2017. 1 changed file with 13 additions and 2 deletions.
    15 changes: 13 additions & 2 deletions alexa.js
    Original 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 = [alexa, majestic];
    const sources = [majestic];
    const zSources = [alexa];

    source.forEach(getFile);
    zSources.forEach(getZFile);

    sources.forEach((url)=> {
    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) {
  2. aowongster revised this gist Apr 7, 2017. 1 changed file with 12 additions and 6 deletions.
    18 changes: 12 additions & 6 deletions alexa.js
    Original 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');

    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);
    })
    ;
    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);
    });
    }
  3. @chilts chilts created this gist Oct 30, 2013.
    10 changes: 10 additions & 0 deletions alexa.js
    Original 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);
    })
    ;