rsshub 1.0.0-master.c1cbcc1 → 1.0.0-master.c27da99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/router.js +8 -6
- package/lib/v2/bandcamp/maintainer.js +2 -0
- package/lib/v2/bandcamp/radar.js +12 -0
- package/lib/v2/bandcamp/router.js +2 -0
- package/lib/{routes → v2}/bandcamp/tag.js +0 -0
- package/lib/v2/bandcamp/templates/weekly.art +1 -0
- package/lib/v2/bandcamp/weekly.js +29 -0
- package/lib/v2/orcid/index.js +54 -0
- package/lib/v2/orcid/maintainer.js +3 -0
- package/lib/v2/orcid/radar.js +13 -0
- package/lib/v2/orcid/router.js +3 -0
- package/lib/v2/orcid/templates/description.art +3 -0
- package/lib/v2/telegram/templates/video.art +2 -2
- package/lib/v2/xiaoyuzhou/maintainer.js +4 -0
- package/lib/{routes → v2}/xiaoyuzhou/pickup.js +0 -0
- package/lib/v2/xiaoyuzhou/podcast.js +36 -0
- package/lib/v2/xiaoyuzhou/radar.js +19 -0
- package/lib/v2/xiaoyuzhou/router.js +4 -0
- package/package.json +1 -1
package/lib/router.js
CHANGED
|
@@ -14,7 +14,7 @@ const lazyloadRouteHandler = (routeHandlerPath) => (ctx) => {
|
|
|
14
14
|
return handler(ctx);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
// Deprecated: DO NOT ADD
|
|
17
|
+
// Deprecated: DO NOT ADD ANY NEW ROUTES HERE
|
|
18
18
|
|
|
19
19
|
// RSSHub migrated to v2
|
|
20
20
|
// router.get('/rsshub/rss', lazyloadRouteHandler('./routes/rsshub/routes')); // 弃用
|
|
@@ -3128,8 +3128,9 @@ router.get('/manxiaosi/book/:id', lazyloadRouteHandler('./routes/manxiaosi/book'
|
|
|
3128
3128
|
// 吉林大学校内通知
|
|
3129
3129
|
router.get('/jlu/oa', lazyloadRouteHandler('./routes/universities/jlu/oa'));
|
|
3130
3130
|
|
|
3131
|
-
// 小宇宙
|
|
3132
|
-
router.get('/xiaoyuzhou', lazyloadRouteHandler('./routes/xiaoyuzhou/pickup'));
|
|
3131
|
+
// 小宇宙 migrated to v2
|
|
3132
|
+
// router.get('/xiaoyuzhou', lazyloadRouteHandler('./routes/xiaoyuzhou/pickup'));
|
|
3133
|
+
// router.get('/xiaoyuzhou/podcast/:id', lazyloadRouteHandler('./routes/xiaoyuzhou/podcast'));
|
|
3133
3134
|
|
|
3134
3135
|
// 合肥工业大学
|
|
3135
3136
|
router.get('/hfut/tzgg', lazyloadRouteHandler('./routes/universities/hfut/tzgg'));
|
|
@@ -3999,8 +4000,9 @@ router.get('/wanwansub/:id?', lazyloadRouteHandler('./routes/wanwansub/index'));
|
|
|
3999
4000
|
router.get('/zimuxia/portfolio/:id', lazyloadRouteHandler('./routes/zimuxia/portfolio'));
|
|
4000
4001
|
router.get('/zimuxia/:category?', lazyloadRouteHandler('./routes/zimuxia/index'));
|
|
4001
4002
|
|
|
4002
|
-
// Bandcamp
|
|
4003
|
-
router.get('/bandcamp/tag/:tag?', lazyloadRouteHandler('./routes/bandcamp/tag'));
|
|
4003
|
+
// Bandcamp migrated to v2
|
|
4004
|
+
// router.get('/bandcamp/tag/:tag?', lazyloadRouteHandler('./routes/bandcamp/tag'));
|
|
4005
|
+
// router.get('/bandcamp/weekly', lazyloadRouteHandler('./routes/bandcamp/weekly'));
|
|
4004
4006
|
|
|
4005
4007
|
// Hugo 更新日志
|
|
4006
4008
|
router.get('/hugo/releases', lazyloadRouteHandler('./routes/hugo/releases'));
|
|
@@ -4175,6 +4177,6 @@ router.get('/mirror/:id', lazyloadRouteHandler('./routes/mirror/entries'));
|
|
|
4175
4177
|
// KBS
|
|
4176
4178
|
router.get('/kbs/today/:language?', lazyloadRouteHandler('./routes/kbs/today'));
|
|
4177
4179
|
|
|
4178
|
-
// Deprecated: DO NOT ADD
|
|
4180
|
+
// Deprecated: DO NOT ADD ANY NEWS ROUTES HERE
|
|
4179
4181
|
|
|
4180
4182
|
module.exports = router;
|
package/lib/v2/bandcamp/radar.js
CHANGED
|
@@ -2,12 +2,24 @@ module.exports = {
|
|
|
2
2
|
'bandcamp.com': {
|
|
3
3
|
_name: 'Bandcamp',
|
|
4
4
|
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: 'Tag',
|
|
7
|
+
docs: 'https://docs.rsshub.app/multimedia.html#bandcamp',
|
|
8
|
+
source: ['/tag/:tag'],
|
|
9
|
+
target: '/bandcamp/tag/:tag',
|
|
10
|
+
},
|
|
5
11
|
{
|
|
6
12
|
title: 'Upcoming Live Streams',
|
|
7
13
|
docs: 'https://docs.rsshub.app/multimedia.html#bandcamp-upcoming-live-streams',
|
|
8
14
|
source: ['/live_schedule'],
|
|
9
15
|
target: '/bandcamp/live',
|
|
10
16
|
},
|
|
17
|
+
{
|
|
18
|
+
title: 'Weekly',
|
|
19
|
+
docs: 'https://docs.rsshub.app/multimedia.html#bandcamp',
|
|
20
|
+
source: ['/'],
|
|
21
|
+
target: '/bandcamp/weekly',
|
|
22
|
+
},
|
|
11
23
|
],
|
|
12
24
|
},
|
|
13
25
|
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<img src="https://f4.bcbits.com/img/00{{ v2_image_id }}_0"><p>{{ desc }}</p>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { art } = require('@/utils/render');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const rootUrl = 'https://bandcamp.com';
|
|
8
|
+
const apiUrl = `${rootUrl}/api/bcweekly/3/list`;
|
|
9
|
+
const response = await got({
|
|
10
|
+
method: 'get',
|
|
11
|
+
url: apiUrl,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const items = response.data.results.slice(0, 50).map((item) => ({
|
|
15
|
+
title: item.title,
|
|
16
|
+
link: `${rootUrl}/?show=${item.id}`,
|
|
17
|
+
pubDate: parseDate(item.published_date),
|
|
18
|
+
description: art(path.join(__dirname, 'templates/weekly.art'), {
|
|
19
|
+
v2_image_id: item.v2_image_id,
|
|
20
|
+
desc: item.desc,
|
|
21
|
+
}),
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
ctx.state.data = {
|
|
25
|
+
title: 'Bandcamp Weekly',
|
|
26
|
+
link: rootUrl,
|
|
27
|
+
item: items,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { art } = require('@/utils/render');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const id = ctx.params.id;
|
|
7
|
+
const rootUrl = 'https://orcid.org/';
|
|
8
|
+
const currentUrl = `${rootUrl}${id}/worksPage.json?offset=0&sort=date&sortAsc=false&pageSize=20`;
|
|
9
|
+
const response = await got(currentUrl);
|
|
10
|
+
|
|
11
|
+
const items = response.data.groups;
|
|
12
|
+
const works = new Array();
|
|
13
|
+
const out = new Array();
|
|
14
|
+
|
|
15
|
+
for (let i = 0; i < items.length; i++) {
|
|
16
|
+
for (let j = 0; j < items[i].works.length; j++) {
|
|
17
|
+
works.push(items[i].works[j]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
works.map((work) => {
|
|
22
|
+
let Str = '';
|
|
23
|
+
|
|
24
|
+
for (let l = 0; l < work.workExternalIdentifiers.length; l++) {
|
|
25
|
+
if (work.workExternalIdentifiers[l].url) {
|
|
26
|
+
Str += '<a href="' + work.workExternalIdentifiers[l].url.value + '">' + work.workExternalIdentifiers[l].externalIdentifierType.value + ': ' + work.workExternalIdentifiers[l].externalIdentifierId.value + '</a><br>';
|
|
27
|
+
} else {
|
|
28
|
+
Str += work.workExternalIdentifiers[l].externalIdentifierType.value + ': ' + work.workExternalIdentifiers[l].externalIdentifierId.value + '<br>';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const info = {
|
|
33
|
+
title: work.title.value,
|
|
34
|
+
link: work.url,
|
|
35
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
36
|
+
title: work.title.value,
|
|
37
|
+
journalTitle: work.journalTitle.value,
|
|
38
|
+
publicationDate: work.publicationDate,
|
|
39
|
+
workType: work.workType.value,
|
|
40
|
+
Str,
|
|
41
|
+
sourceName: work.sourceName,
|
|
42
|
+
}),
|
|
43
|
+
guid: work.putCode.value,
|
|
44
|
+
};
|
|
45
|
+
out.push(info);
|
|
46
|
+
return info;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
ctx.state.data = {
|
|
50
|
+
title: 'ORCID Works List' + id,
|
|
51
|
+
link: currentUrl,
|
|
52
|
+
item: out,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<h2>{{ title }}</h2><h3>{{ journalTitle }}</h3>
|
|
2
|
+
<span>{{ if publicationDate.year }}{{ publicationDate.year }}{{ /if }}{{ if publicationDate.month }}-{{ publicationDate.month }}{{ /if }}{{ if publicationDate.day }}-{{ publicationDate.day }}{{ /if }} | {{ workType }}</span><br>
|
|
3
|
+
<span>{{@ Str }}</span><span>Source: {{ sourceName }}</span>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{{ if source }}
|
|
2
|
-
<video src="{{ source }}" controls="controls" poster="{{ poster }}" style="width: 100%"></video
|
|
2
|
+
<video src="{{ source }}" controls="controls" poster="{{ poster }}" style="width: 100%"></video>
|
|
3
3
|
{{ else }}
|
|
4
4
|
<b>Media is too big</b>
|
|
5
|
-
{{ /if }}
|
|
5
|
+
{{ /if }}
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const link = `https://www.xiaoyuzhoufm.com/podcast/${ctx.params.id}`;
|
|
7
|
+
const response = await got({
|
|
8
|
+
method: 'get',
|
|
9
|
+
url: link,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const $ = cheerio.load(response.data);
|
|
13
|
+
|
|
14
|
+
const page_data = JSON.parse($('#__NEXT_DATA__')[0].children[0].data);
|
|
15
|
+
|
|
16
|
+
const episodes = page_data.props.pageProps.podcast.episodes.map((item) => ({
|
|
17
|
+
title: item.title,
|
|
18
|
+
enclosure_url: item.enclosure.url,
|
|
19
|
+
enclosure_length: item.duration,
|
|
20
|
+
enclosure_type: 'audio/mpeg',
|
|
21
|
+
link: `https://www.xiaoyuzhoufm.com/episode/${item.eid}`,
|
|
22
|
+
pubDate: parseDate(item.pubDate),
|
|
23
|
+
description: item.shownotes,
|
|
24
|
+
itunes_item_image: item.image.smallPicUrl,
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
ctx.state.data = {
|
|
28
|
+
title: page_data.props.pageProps.podcast.title,
|
|
29
|
+
link: `https://www.xiaoyuzhoufm.com/podcast/${page_data.props.pageProps.podcast.pid}`,
|
|
30
|
+
itunes_author: page_data.props.pageProps.podcast.author,
|
|
31
|
+
itunes_category: '',
|
|
32
|
+
image: page_data.props.pageProps.podcast.image.smallPicUrl,
|
|
33
|
+
item: episodes,
|
|
34
|
+
description: page_data.props.pageProps.podcast.description,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'xiaoyuzhoufm.com': {
|
|
3
|
+
_name: '小宇宙',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '发现',
|
|
7
|
+
docs: 'https://docs.rsshub.app/multimedia.html#xiao-yu-zhou',
|
|
8
|
+
source: ['/'],
|
|
9
|
+
target: '/xiaoyuzhou',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '播客',
|
|
13
|
+
docs: 'https://docs.rsshub.app/multimedia.html#xiao-yu-zhou',
|
|
14
|
+
source: ['/podcast/:id'],
|
|
15
|
+
target: '/xiaoyuzhou/podcast/:id',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
};
|