var x2js = require('xml2js');
var fs = require('fs');
var _ = require('underscore');

function imp(xml){
	x2js.parseString(xml, function(err, result){
		var posts = result.rss.channel[0].item;

		_.each(posts, function(post){
			var file = '../pages/imported/' + post['wp:post_name'][0];
			json = {
				title: post.title[0],
				author: post['dc:creator'][0],
				date: post.pubDate[0],
				tags: _.pluck(post.category, '_')
			};
			content= post['content:encoded'][0].trim();

			fs.writeFile(file + '.json', JSON.stringify(json, null, '\t'));
			fs.writeFile(file + '.mkd', content);
		});
	});
}
fs.mkdir('../pages/imported/',null, function(err){
	fs.readFile(process.argv[2], function(err, data){
		imp(data);
	});
});

@@ -391,16 +391,25 @@
 %09%09tags: 
+_.filter(
 _.pluck(
@@ -427,16 +427,60 @@
 ry, '_')
+, function(c)%7B return c != 'Uncategorized';%7D
 %0A%09%09%09%7D;%0A%09

exclude uncategorized cat