Comparing version 0.0.5 to 0.0.6
var read = require('../'); | ||
read('http://house.xinmin.cn/fczx/2014/05/12/24282958.html', function(err, art){ | ||
read('http://auto.rednet.cn/html/tupian/20145/20145124642220.html', function(err, art){ | ||
if(err){ | ||
@@ -5,0 +5,0 @@ console.log('[ERROR]', err.message); |
@@ -91,5 +91,7 @@ // Copyright 2014 Tjatse | ||
if(o.options.killBreaks){ | ||
// replace <br />(blanks goes here) to <br />. | ||
o.html = o.html.replace(/(<br\s*\/?>(\s| ?)*){1,}/g,'<br />'); | ||
// remove formats like \r\t\n | ||
o.html = o.html.replace(/([\n\r\t]*){2,}/gi, ''); | ||
} | ||
o.html = o.html.replace(/[\n\t]/g,''); | ||
@@ -96,0 +98,0 @@ var co = {}; |
@@ -130,3 +130,2 @@ // Copyright 2014 Tjatse | ||
//console.log(node.get(0).name, node.attr('class') || node.attr('id') || '', score); | ||
if(!topCandidate || score > topCandidate.data(scoreKey)){ | ||
@@ -158,3 +157,2 @@ topCandidate = node; | ||
append = false; | ||
if(node.is(topCandidate) || (node.data(scoreKey) || 0) > siblingScoreThreshold){ | ||
@@ -161,0 +159,0 @@ append = true; |
{ | ||
"name": "read-art", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Scrape article from any page, automatically, make web page readability.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
30197
727