forked from fabiospampinato/rssa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeeds.js
More file actions
57 lines (53 loc) · 1.72 KB
/
feeds.js
File metadata and controls
57 lines (53 loc) · 1.72 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* IMPORT */
const _ = require ( 'lodash' ),
c = require ( 'chalk' );
/* FEEDS */
module.exports.feeds = {
filter: ( tokens, tokensOld ) => !tokensOld || tokens.value !== tokensOld.value,
groups: [{
name: 'Stock Market',
tokens: {
company: '#sectionTitle h1',
value: ['.sectionQuoteDetail [style]', _.trim]
},
template: `[company] ${c.gray ( '[old:value]' )} -> ${c.yellow ( '[value]' )}`,
feeds: [
'http://www.reuters.com/finance/stocks/overview?symbol=AAPL.O',
'http://www.reuters.com/finance/stocks/overview?symbol=GOOGL.O',
"http://www.reuters.com/finance/stocks/overview?symbol=TSLA.O"
]
}, {
name: 'Social',
feeds: [{
url: 'https://www.youtube.com/watch?v=9bZkp7q19f0',
tokens: {
value: /"view_count":"([0-9]+)"/
},
template: `Gangnam Style (Views) ${c.gray ( '[old:value]' )} -> ${c.yellow ( '[value]' )}`
}, {
url: 'https://twitter.com/barackobama',
tokens: {
value: '.ProfileHeaderCard-bio'
},
template: `Barack Obama (Desc) ${c.gray ( '"[old:value]"' )} -> ${c.yellow ( '"[value]"' )}`
}]
}, {
name: 'GitHub',
tokens: {
fullname: /"full_name":"([^"]+)",/,
value: /"stargazers_count":([^"]+),/
},
template: `[fullname] (Stars) ${c.gray ( '[old:value]' )} -> ${c.yellow ( '[value]' )}`,
feeds: [
'https://api.github.com/repos/twbs/bootstrap',
'https://api.github.com/repos/fabiospampinato/rssa'
]
}],
feed: {
url: 'https://en.wikipedia.org/wiki/Main_Page',
tokens: {
value: '#articlecount [title="Special:Statistics"]'
},
template: `Wikipedia Articles (EN) ${c.gray ( '[old:value]' )} -> ${c.yellow ( '[value]' )}`
},
};