Skip to content

Instantly share code, notes, and snippets.

@jzaefferer
Last active December 17, 2015 21:48
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jzaefferer/5677000 to your computer and use it in GitHub Desktop.
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();
});
});
});
});
# 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