Comparing version 0.4.0 to 0.4.1
@@ -0,1 +1,7 @@ | ||
# 2015/12/18 | ||
- only fetch body when uri is provided but html is empty | ||
- fix the links of img,a,object,embed... - relative to absolute | ||
- customize selectors | ||
- refactor: extract data | ||
# 2015/12/09 | ||
@@ -2,0 +8,0 @@ - Supports `cheerio` output type. @entertainyou |
@@ -127,3 +127,3 @@ "use strict"; | ||
} else { | ||
isObject = util.isObject(extract); | ||
isObject = Object.prototype.toString.call(extract) == '[object Object]'; | ||
if (isObject) { | ||
@@ -130,0 +130,0 @@ props = Object.keys(extract); |
{ | ||
"name": "read-art", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Scrape/Crawl article from any site automatically. Make any web page readable, no matter Chinese or English.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -156,3 +156,4 @@ read-art [](http://badge.fury.io/js/read-art) [](https://travis-ci.org/Tjatse/node-readability) | ||
<a name="selectors" /> | ||
Some times we wanna extract article somehow, e.g. pick the title of `.article>h3` as title, and pick `.article>.author` as the author data: | ||
## Extract Selectors | ||
Some times we wanna extract article somehow, e.g.: pick the text of `.article>h3` as title, and pick `.article>.author` as the author data: | ||
```javascript | ||
@@ -182,3 +183,3 @@ read({ | ||
**Notes** The binding data will be an object if the `extract` option is an array object, but `content` depends on the `output` option. | ||
**Notes** The binding data will be an object or array (object per item) if the `extract` option is an array object, `title` and `content` will override the default extracting methods, and the output of `content` depends on the `output` option. | ||
@@ -185,0 +186,0 @@ <a name="cus_sets" /> |
67664
427