Skip to content

Instantly share code, notes, and snippets.

@Encosia
Forked from glennblock/gist:3297118
Created August 9, 2012 05:24
Show Gist options
  • Save Encosia/3301296 to your computer and use it in GitHub Desktop.
Save Encosia/3301296 to your computer and use it in GitHub Desktop.
Create counts for modules by category from nodejs.org module wiki
var nom = require('nom');
var categories = [ ];
nom('http://github.com/joyent/node/wiki/modules', function(err, $) {
$('#wiki-body h1:eq(1)~h2~h3').each(function() {
categories.push({
name: $(this).text(),
count: $(this).next().find('a').length
})
});
console.log(categories);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment