File tree Expand file tree Collapse file tree 3 files changed +44
-3
lines changed Expand file tree Collapse file tree 3 files changed +44
-3
lines changed Original file line number Diff line number Diff line change 1
1
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
+
2
8
1.0.2 / 2015-02-05
3
9
==================
4
10
Original file line number Diff line number Diff line change 1
1
![ x-ray] ( https://cldup.com/r-PhcugeZ0.svg )
2
2
3
- ## Introduction
3
+ ## Introduction
4
4
5
5
[ ![ img] ( https://gittask.com/lapwinglabs/x-ray.svg )] ( https://gittask.com/lapwinglabs/x-ray )
6
6
@@ -212,6 +212,41 @@ xray('http://github.com')
212
212
.delay (5000 )
213
213
```
214
214
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
+
215
250
#### Xray#format(<function > fn)
216
251
217
252
Specify a custom formatting function for each selected element.
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " x-ray" ,
3
- "version" : " 1.0.2 " ,
3
+ "version" : " 1.0.3 " ,
4
4
"description" : " structure any website" ,
5
5
"keywords" : [
6
6
" scraper" ,
27
27
"subs" : " 0.0.1"
28
28
},
29
29
"main" : " index"
30
- }
30
+ }
You can’t perform that action at this time.
0 commit comments