Last active
December 17, 2015 23:29
-
-
Save jakl/5689738 to your computer and use it in GitHub Desktop.
gunzip
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 characters
(function(exports){ | |
fetchGzipped = function(url, cb){ | |
var req = new XMLHttpRequest() | |
req.open('GET', url, true) | |
req.responseType = 'arraybuffer' | |
req.onload = function(){ | |
gzdata = new Uint8Array(req.response) | |
data = (new Zlib.Gunzip(gzdata)).decompress() | |
var f = new FileReader() | |
f.onload = function(e) { | |
cb(e.target.result) | |
} | |
f.readAsText(new Blob([data])) | |
} | |
req.send() | |
} | |
exports.fetch = function(volume, ready){ | |
if(volume === 'science_and_health') | |
fetchGzipped( | |
'https://dl.dropboxusercontent.com/s/pdw305sr6nwv1bo/science_and_health.gzip?token_hash=AAG7mZT4f8DYxXsXwn9mGyiG4s9mIrIwftCVMC54ij7soA&dl=1' | |
, function(text){ | |
exports.science_and_health = text | |
ready(); | |
} | |
) | |
} | |
})(typeof exports === 'undefined' ? this['cskit']={} : exports) |
View raw
(Sorry about that, but we can’t show files that are this big right now.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment