-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
98 lines (98 loc) · 3.41 KB
/
config.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
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
module.exports = {
scrapesDirectory: './scrapes/',
outputDirectory: './output/',
outputFileName:'timeline.json',
scrapes: [{
id: 'github',
url: 'https://github.com/davelinke?tab=repositories',
type: 'html',
itemsPath: '#user-repositories-list li',
items: {
source: {
selector: 'title',
convert: x => 'github'
},
image: {
selector: 'title',
convert: x => false
},
title: '[itemprop="name codeRepository"]',
url: {
selector: '[itemprop="name codeRepository"]',
attr: 'href',
convert: x => {
return 'https://github.com' + x;
}
},
description: '[itemprop="description"]',
date: {
selector: 'relative-time',
attr: 'datetime',
convert: x => {
let zeDate = new Date(x);
return zeDate.toISOString();
}
}
}
},
{
id: 'codepen',
url: 'https://codepen.io/davelinke/public/feed',
type: 'xml',
itemsPath: 'rss > channel > 0 > item',
items: {
source: () => { return 'codepen' },
image: () => { return false },
title: (item) => { return item['title'][0] },
url: (item) => { return item['link'][0] },
description: (item) => {
return item['description'][0].split('\n')[11].trim();
},
date: (item) => {
let zeDate = new Date(item['dc:date'][0].split('\n')[1].trim());
return zeDate.toISOString();
}
}
},
{
id: 'behance',
url: 'https://www.behance.net/feeds/user?username=davidlinke',
type: 'xml',
itemsPath: 'rss > channel > 0 > item',
items: {
source: () => { return 'behance' },
image: (item) => { return item['description'][0].split("'")[1] },
title: (item) => { return item['title'][0] },
url: (item) => { return item['link'][0] },
description: (item) => { return item['description'][0].split('<br />')[1].trim() },
date: (item) => {
let zeDate = new Date(item['pubDate'][0]);
return zeDate.toISOString();
}
}
}, {
id: 'medium',
url: 'https://medium.com/feed/@davelinke',
type: 'xml',
itemsPath: 'rss > channel > 0 > item',
items: {
source: () => { return 'medium' },
image: (item) => { return false },
title: (item) => { return item['title'][0] },
url: (item) => { return item['link'][0] },
description: (item) => {
const Entities = require('html-entities').AllHtmlEntities;
const entities = new Entities();
let desc = item['content:encoded'][0].split('<img src="https://medium.com/_/stat?event=post.clientViewed')[0].trim();
desc = entities.decode(desc);
desc = desc.replace(/(<([^>]+)>)/ig,"");
return desc;
},
date: (item) => {
let zeDate = new Date(item['pubDate'][0]);
return zeDate.toISOString();
}
}
}
]
};