Skip to content

Instantly share code, notes, and snippets.

View jianghaizhi's full-sized avatar
😎
牛气冲天

Tao Hou jianghaizhi

😎
牛气冲天
View GitHub Profile
@jianghaizhi
jianghaizhi / alexa.js
Created September 21, 2017 01:15 — forked from chilts/alexa.js
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
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);
})
;