Last active
August 29, 2015 14:18
-
-
Save scripting/bc3690a275697f2c53a2 to your computer and use it in GitHub Desktop.
This code doesn't work. Trying to figure out why! :-)
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
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."); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the solution to the programming puzzle explained here..
http://scripting.com/2015/04/10/nodejsProgrammingQuestion.html