Created
July 26, 2017 21:44
-
-
Save adamalesandro/503f8b11e99e48f69a90c9dd25366a78 to your computer and use it in GitHub Desktop.
This file contains 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 characters
var cheerio = require('cheerio'); | |
var http = require('http'); | |
var _ = require('lodash'); | |
var str = ""; | |
var options = { | |
host: 'web.archive.org', | |
port: 80, | |
path: '/web/timemap/json/http://www.coinbase.com/about' | |
}; | |
var body = ""; | |
// | |
// var $ = cheerio.load("<div><p></p></div>"); | |
// | |
// console.log($.html()); | |
callback = function(response) { | |
response.on('data', function (chunk) { | |
str += chunk; | |
}); | |
response.on('end', function () { | |
// console.log(req.data); | |
var x = JSON.parse(str); | |
_.each(x, function(i, j){ | |
// console.log(i); | |
var item = i; | |
console.log(i[1]); | |
}); | |
// your code here if you want to use the results ! | |
}); | |
} | |
var req = http.request(options, callback).end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment