Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 1a032a6f75b0c322ffd0eaef66bb11d8b5adf61b @rumpl committed Mar 20, 2013
Showing with 24 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +17 −0 index.js
  3. +6 −0 package.json
@@ -0,0 +1 @@
+node_modules
@@ -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!");
+ }
+ });
+});
@@ -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.