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 fs = require( "fs" ), | |
request = require( "request" ), | |
xml2js = require( "xml2js").parseString, | |
exec = require( "child_process" ).exec, | |
pages = [1, 2, 3, 4, 5, 6, 7], | |
team = "core"; | |
pages.forEach(function(page) { | |
request.get("http://jquery.org/updates/category/" + team + "/feed/atom/?paged=" + page, function(request, response, body) { | |
xml2js(body, {explicitArray: false}, function( err, result ) { | |
result.feed.entry.forEach(function( entry ) { | |
var outputFileName = "minutes/" + team + "/" + entry.published.replace(/T.+/, "") + ".md"; | |
var cmd = "pandoc -o "+ outputFileName + " -f html -t markdown-escaped_line_breaks"; | |
var child = exec(cmd, function(error, stdout, stderr) { | |
console.log("Wrote " + outputFileName); | |
}); | |
child.stdin.write(entry.content._); | |
child.stdin.end(); | |
}); | |
}); | |
}); | |
}); |
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
# make sure `pandoc` is installed already | |
npm install request xml2js | |
node md-generator.js | |
# replace "core" with "testing", run again |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment