Last active
June 8, 2017 21:09
-
-
Save scripting/823930d76b887b462ed6b2c8c4870073 to your computer and use it in GitHub Desktop.
An 8-line Node.js script to convert the XML version of Scripting News's feed to JSON.
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
const xml2js = require ("xml2js"), request = require ("request"); | |
request ("http://scripting.com/rss.xml", function (error, response, data) { | |
if (!error && (response.statusCode == 200)) { | |
xml2js.parseString (data, function (err, result) { | |
console.log (JSON.stringify (result, undefined, 4)); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment