Skip to content

Commit d9d93aa

Browse files
Release 1.0.3
1 parent 4cf1897 commit d9d93aa

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

History.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11

2+
1.0.3 / 2015-02-07
3+
==================
4+
5+
* add xray.prepare(str, fn) for custom 'title | uppercase' filters
6+
* better spot for badges
7+
28
1.0.2 / 2015-02-05
39
==================
410

Readme.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![x-ray](https://cldup.com/r-PhcugeZ0.svg)
22

3-
## Introduction
3+
## Introduction
44

55
[![img](https://gittask.com/lapwinglabs/x-ray.svg)](https://gittask.com/lapwinglabs/x-ray)
66

@@ -212,6 +212,41 @@ xray('http://github.com')
212212
.delay(5000)
213213
```
214214

215+
#### Xray#prepare(<string|object> str, <function> fn)
216+
217+
You can prepare the data that you scrape for output
218+
219+
```js
220+
function uppercase(str) {
221+
return str.toUpperCase();
222+
}
223+
224+
xray('mat.io')
225+
.prepare('uppercase', uppercase)
226+
.select('title | uppercase')
227+
.run(function(err, title) {
228+
// title == MAT.IO
229+
});
230+
```
231+
232+
You can also pass in objects:
233+
234+
```js
235+
var prepare = {
236+
uppercase: function (str) {
237+
return str.toUpperCase();
238+
}
239+
}
240+
241+
xray('mat.io')
242+
.prepare(prepare)
243+
.select('title | uppercase')
244+
.run(function(err, title) {
245+
// title == MAT.IO
246+
});
247+
```
248+
249+
215250
#### Xray#format(<function> fn)
216251

217252
Specify a custom formatting function for each selected element.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "x-ray",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "structure any website",
55
"keywords": [
66
"scraper",
@@ -27,4 +27,4 @@
2727
"subs": "0.0.1"
2828
},
2929
"main": "index"
30-
}
30+
}

0 commit comments

Comments
 (0)