0.1.4 • Published 10 years ago

html-readability v0.1.4

Weekly downloads
2
License
GPL3
Repository
github
Last release
10 years ago

##html-readability

node.js html readability parser

NPM

###Get started

var readability = require("readability");
var html = "<html>xxxxxxxxxxx</html>";
readability.parse(html, function(err, article){
    /* article
        article = {
            title: "", // page title 
            text: "", //text content
            html: "", //pretty html content
            time: {
               title: 10, //parse title elapsed milliseconds
               article: 100 //parse content elapsed milliseconds
            }
        }
    */
});

###Usage

1. pass an object:

var options = {
    url: "http://example.com/article/some-article.html", // url is optional, if supply, can convert relative url to absolute.
    content: "<html>some html</html>"
};

readability.parse(options, function(err, article){
    //some code
});

2. pass a html string:

var html = "<html>some html</html>";

readability.parse(html, function(err, article){
    //some code
});

3. pass an url:

var url = "http://example.com/article/some-article.html";

readability.parse(url, function(err, article){
    //some code
});
0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago