Skip to content

Instantly share code, notes, and snippets.

@scripting
Last active August 29, 2015 14:18
Show Gist options
  • Save scripting/bc3690a275697f2c53a2 to your computer and use it in GitHub Desktop.
Save scripting/bc3690a275697f2c53a2 to your computer and use it in GitHub Desktop.
This code doesn't work. Trying to figure out why! :-)
var requestSettings = {
method: 'GET',
url: theEnclosure.url,
encoding: null
};
request (requestSettings, function (error, response, body) {
if (!error && (response.statusCode == 200)) {
fs.writeFile ("podcast.mp3", body, function (err) {
console.log (body.length + " bytes written to file.");
});
}
});
@scripting
Copy link
Author

This is the solution to the programming puzzle explained here..

http://scripting.com/2015/04/10/nodejsProgrammingQuestion.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment