Created
August 17, 2013 04:18
-
-
Save kanzure/6255244 to your computer and use it in GitHub Desktop.
i don't know how to node
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 through = require("through"); | |
var hyperquest = require("hyperquest"); | |
var trumpet = require("trumpet"); | |
module.exports.download = function download(url, options) { | |
var output = through(); | |
var trumpeter = trumpet(); | |
var request = hyperquest.get(url); | |
trumpeter.selectAll("title", function (title) { | |
output.queue({title: title}); // ??? | |
}); | |
request.pipe(trumpeter); // ??? | |
//request.on("response", function(response){}); | |
//request.on("error", function(error){..}); | |
// TODO: how to let the user hook into request.on("error") ? | |
// TODO: how to let the user hook into the "output" stream ? | |
return output; // TODO | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment