Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Djordje Lukic committed Mar 20, 2013
0 parents commit 1a032a6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
17 changes: 17 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var fs = require('fs');
var readability = require('node-readability');
var md = require('html-md');

readability.read(process.argv[2], function(err, article) {
var title = article.getTitle();
var fileTitle = title.replace(/\ /g, '_') + '.md';
var content = md(article.getContent());

fs.writeFile(fileTitle, content, function (error) {
if(err) {
console.log(err);
} else {
console.log("The file " + fileTitle + " was saved!");
}
});
});
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {
"node-readability": "git://github.com/rumpl/node-readability.git",
"html-md": "~2.0.2"
}
}

0 comments on commit 1a032a6

Please sign in to comment.