-
-
Save polotek/3948783 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 request = require('request') | |
, gunzip = require('zlib').createGunzip() | |
, json = new (require('jstream'))(); | |
request('http://data.githubarchive.org/2012-03-11-12.json.gz') | |
.pipe(gunzip) | |
.pipe(json) | |
.on('data', function(obj) { | |
console.log(obj); | |
}); |
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
require 'open-uri' | |
require 'zlib' | |
require 'yajl' | |
gz = open('http://data.githubarchive.org/2012-03-11-12.json.gz') | |
js = Zlib::GzipReader.new(gz).read | |
Yajl::Parser.parse(js) do |event| | |
print event | |
end |
Not sure. I haven't used jsonstream or jstream before. I just looked around for the first thing that looked promising and depended on @dscape's clarinet. But it seems to be a valid stream.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
does jstream have the same semantics as JSONStream?