-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathys.js
30 lines (28 loc) · 794 Bytes
/
ys.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var Xray = require('x-ray');
var x = Xray();
var count = 0;
var html = 'http://yourstory.com/ys-stories/';
var selector = '.sectionProfile_postsWrapper ul.gridPostsList li.grid-full';
x(html, selector,[{
link: 'a.block@href',
text: '.fl.content .title-small'
// count: count + 1
}])
.paginate('a.pagesNav-nextPage@href')
.limit(100/18)
(function (err, obj) {
//var inf = obj.replace(/^\s+|\s+$/gm,'');
// console.log(err);
for (count = 0; count < obj.length; count++){
formatTitle[count] = obj[count]['text'].trim()
UpdatedTitle[count] = {
'link-count': count + 1,
'link': obj[count]['link'],
'title': formatTitle[count]
}
}
console.log(UpdatedTitle)
//obj['text'].trim().write('results2.json')
})
//obj[2]['text'].write('results2.json')
//.write('results1.json')