rsshub 1.0.0-master.db4e8ed → 1.0.0-master.db74812
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 +7 -10
- package/lib/v2/acg17/maintainer.js +3 -0
- package/lib/v2/acg17/post.js +20 -0
- package/lib/v2/acg17/radar.js +13 -0
- package/lib/v2/acg17/router.js +3 -0
- package/lib/v2/apple/exchange_repair.js +28 -21
- package/lib/v2/bdys/index.js +98 -0
- package/lib/v2/bdys/maintainer.js +3 -0
- package/lib/v2/bdys/radar.js +20 -0
- package/lib/v2/bdys/router.js +3 -0
- package/lib/v2/bdys/templates/desc.art +21 -0
- package/lib/v2/bjsk/index.js +52 -0
- package/lib/v2/bjsk/maintainer.js +3 -0
- package/lib/v2/bjsk/radar.js +13 -0
- package/lib/v2/bjsk/router.js +3 -0
- package/lib/v2/cartoonmad/comic.js +70 -0
- package/lib/v2/cartoonmad/maintainer.js +3 -0
- package/lib/v2/cartoonmad/radar.js +13 -0
- package/lib/v2/cartoonmad/router.js +3 -0
- package/lib/v2/cartoonmad/templates/chapter.art +1 -0
- package/lib/{routes/universities → v2}/cas/cg/index.js +4 -2
- package/lib/{routes/universities → v2}/cas/iee/kydt.js +7 -5
- package/lib/v2/cas/maintainer.js +6 -0
- package/lib/v2/cas/mesalab/kb.js +41 -0
- package/lib/v2/cas/radar.js +40 -0
- package/lib/v2/cas/router.js +6 -0
- package/lib/v2/cas/sim/kyjz.js +47 -0
- package/lib/v2/cast/index.js +74 -0
- package/lib/v2/cast/maintainer.js +3 -0
- package/lib/v2/cast/radar.js +13 -0
- package/lib/v2/cast/router.js +3 -0
- package/lib/v2/gov/beijing/bphc/index.js +1 -1
- package/lib/v2/issuehunt/funded.js +28 -0
- package/lib/v2/issuehunt/maintainer.js +3 -0
- package/lib/v2/issuehunt/radar.js +13 -0
- package/lib/v2/issuehunt/router.js +3 -0
- package/lib/v2/jiaoliudao/index.js +35 -0
- package/lib/v2/jiaoliudao/maintainer.js +3 -0
- package/lib/v2/jiaoliudao/radar.js +13 -0
- package/lib/v2/jiaoliudao/router.js +3 -0
- package/lib/v2/jin10/index.js +58 -0
- package/lib/v2/jin10/maintainer.js +3 -0
- package/lib/v2/jin10/radar.js +13 -0
- package/lib/v2/jin10/router.js +3 -0
- package/lib/v2/jin10/templates/description.art +2 -0
- package/lib/v2/mclaren/index.js +96 -0
- package/lib/v2/mclaren/maintainer.js +3 -0
- package/lib/v2/mclaren/radar.js +29 -0
- package/lib/v2/mclaren/router.js +3 -0
- package/lib/v2/mclaren/templates/desc.art +6 -0
- package/lib/v2/misskey/featured-notes.js +29 -0
- package/lib/v2/misskey/maintainer.js +3 -0
- package/lib/v2/misskey/radar.js +35 -0
- package/lib/v2/misskey/router.js +3 -0
- package/lib/v2/misskey/templates/note.art +21 -0
- package/lib/v2/misskey/utils.js +31 -0
- package/lib/v2/nbd/index.js +6 -6
- package/lib/v2/piyao/jrpy.js +39 -0
- package/lib/v2/piyao/maintainer.js +3 -0
- package/lib/v2/piyao/radar.js +13 -0
- package/lib/v2/piyao/router.js +3 -0
- package/lib/v2/qq/fact/index.js +61 -0
- package/lib/v2/qq/maintainer.js +1 -0
- package/lib/v2/qq/radar.js +8 -0
- package/lib/v2/qq/router.js +1 -0
- package/lib/v2/qq/templates/article.art +19 -0
- package/lib/v2/rodong/maintainer.js +3 -0
- package/lib/v2/rodong/news.js +45 -0
- package/lib/v2/rodong/radar.js +13 -0
- package/lib/v2/rodong/router.js +3 -0
- package/lib/v2/sspai/bookmarks.js +41 -0
- package/lib/v2/sspai/maintainer.js +1 -0
- package/lib/v2/sspai/radar.js +6 -0
- package/lib/v2/sspai/router.js +1 -0
- package/lib/v2/stcn/index.js +25 -32
- package/lib/v2/stcn/maintainer.js +0 -3
- package/lib/v2/stcn/radar.js +4 -22
- package/lib/v2/stcn/router.js +1 -1
- package/lib/v2/swjtu/jtys/yjs.js +37 -0
- package/lib/v2/swjtu/maintainer.js +3 -0
- package/lib/v2/swjtu/radar.js +13 -0
- package/lib/v2/swjtu/router.js +3 -0
- package/lib/v2/thepaper/utils.js +50 -64
- package/lib/v2/u9a9/index.js +66 -0
- package/lib/v2/u9a9/maintainer.js +4 -0
- package/lib/v2/u9a9/radar.js +19 -0
- package/lib/v2/u9a9/router.js +4 -0
- package/lib/v2/wechat/maintainer.js +0 -1
- package/lib/v2/wechat/radar.js +0 -11
- package/lib/v2/wechat/router.js +0 -1
- package/package.json +8 -8
- package/lib/routes/cartoonmad/comic.js +0 -69
- package/lib/routes/jinshi/index.js +0 -35
- package/lib/routes/swjtu/tl/news.js +0 -35
- package/lib/routes/tencent/factcheck/index.js +0 -51
- package/lib/routes/universities/cas/mesalab/kb.js +0 -45
- package/lib/routes/universities/cas/sim/academic.js +0 -59
- package/lib/v2/mp4er/index.js +0 -83
- package/lib/v2/mp4er/maintainer.js +0 -3
- package/lib/v2/mp4er/radar.js +0 -13
- package/lib/v2/mp4er/router.js +0 -3
- package/lib/v2/wechat/wemp.js +0 -58
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
const host = 'http://www.sim.cas.cn/';
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const link = new URL('xwzx2016/kyjz/', host).href;
|
|
9
|
+
const response = await got(link);
|
|
10
|
+
|
|
11
|
+
const $ = cheerio.load(response.data);
|
|
12
|
+
|
|
13
|
+
const list = $('.list-news li')
|
|
14
|
+
.toArray()
|
|
15
|
+
.filter((e) => !$(e).attr('style'))
|
|
16
|
+
.map((e) => {
|
|
17
|
+
e = $(e);
|
|
18
|
+
return {
|
|
19
|
+
link: new URL(e.find('a').attr('href'), link).href,
|
|
20
|
+
pubDate: e.find('span').text().replace('[', '').replace(']', ''),
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const out = await Promise.all(
|
|
25
|
+
list.map((item) =>
|
|
26
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
27
|
+
const response = await got(item.link);
|
|
28
|
+
const $ = cheerio.load(response.data);
|
|
29
|
+
|
|
30
|
+
const author = $('.qtinfo.hidden-lg.hidden-md.hidden-sm').text();
|
|
31
|
+
const reg = /文章来源:(.*?)\|/g;
|
|
32
|
+
|
|
33
|
+
item.title = $('p.wztitle').text().trim();
|
|
34
|
+
item.author = reg.exec(author)[1].toString().trim();
|
|
35
|
+
item.description = $('.TRS_Editor').html();
|
|
36
|
+
item.pubDate = parseDate(item.pubDate);
|
|
37
|
+
return item;
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
ctx.state.data = {
|
|
43
|
+
title: '中国科学院上海微系统与信息技术研究所 -- 科技进展',
|
|
44
|
+
link,
|
|
45
|
+
item: out,
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
5
|
+
const baseUrl = 'https://www.cast.org.cn';
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const { column = 457 } = ctx.params;
|
|
9
|
+
const { limit = 10 } = ctx.query;
|
|
10
|
+
const link = `${baseUrl}/col/col${column}/index.html`;
|
|
11
|
+
const { data: response } = await got.post(`${baseUrl}/module/web/jpage/dataproxy.jsp`, {
|
|
12
|
+
searchParams: {
|
|
13
|
+
startrecord: 1,
|
|
14
|
+
endrecord: limit,
|
|
15
|
+
perpage: limit,
|
|
16
|
+
},
|
|
17
|
+
form: {
|
|
18
|
+
col: 1,
|
|
19
|
+
appid: 1,
|
|
20
|
+
webid: 1,
|
|
21
|
+
path: '/',
|
|
22
|
+
columnid: column,
|
|
23
|
+
sourceContentType: 1,
|
|
24
|
+
unitid: 335,
|
|
25
|
+
webname: '中国科学技术协会',
|
|
26
|
+
permissiontype: 0,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const $ = cheerio.load(response, {
|
|
31
|
+
xml: {
|
|
32
|
+
xmlMode: true,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const pageTitle = await ctx.cache.tryGet(link, async () => {
|
|
37
|
+
const { data: response } = await got(link);
|
|
38
|
+
const $ = cheerio.load(response);
|
|
39
|
+
return $('head title').text();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const list = $('record')
|
|
43
|
+
.toArray()
|
|
44
|
+
.map((item) => {
|
|
45
|
+
item = cheerio.load($(item).html(), null, false);
|
|
46
|
+
const a = item('a').first();
|
|
47
|
+
return {
|
|
48
|
+
title: a.text(),
|
|
49
|
+
pubDate: parseDate(item('.list-data').text().trim(), 'DDYYYY/MM'),
|
|
50
|
+
link: `${baseUrl}${a.attr('href')}`,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const items = await Promise.all(
|
|
55
|
+
list.map((item) =>
|
|
56
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
57
|
+
const { data: response } = await got(item.link);
|
|
58
|
+
const $ = cheerio.load(response);
|
|
59
|
+
|
|
60
|
+
item.description = $('#zoom').html();
|
|
61
|
+
item.pubDate = timezone(parseDate($('meta[name=PubDate]').attr('content'), 'YYYY-MM-DD HH:mm'), +8);
|
|
62
|
+
|
|
63
|
+
return item;
|
|
64
|
+
})
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
ctx.state.data = {
|
|
69
|
+
title: pageTitle,
|
|
70
|
+
link,
|
|
71
|
+
image: 'https://www.cast.org.cn/favicon.ico',
|
|
72
|
+
item: items,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'cast.org.cn': {
|
|
3
|
+
_name: '中国科学技术协会',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '通用',
|
|
7
|
+
docs: 'https://docs.rsshub.app/government.html#zhong-guo-ke-xue-ji-shu-xie-hui',
|
|
8
|
+
source: ['/col/:column/index.html'],
|
|
9
|
+
target: (params) => `/cast/${params.column.replace('col', '')}`,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -18,7 +18,7 @@ const mapping = {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
module.exports = async (ctx) => {
|
|
21
|
-
const rootUrl = '
|
|
21
|
+
const rootUrl = 'https://gycpt.bphc.com.cn';
|
|
22
22
|
const defaultPath = 'announcement';
|
|
23
23
|
|
|
24
24
|
const pathname = ctx.path.replace(/(^\/beijing\/bphc|\/$)/g, '');
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const MarkdownIt = require('markdown-it');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const { username, repo } = ctx.params;
|
|
6
|
+
const response = await got(`https://issuehunt.io/apis/pages/repos/show?repositoryOwnerName=${username}&repositoryName=${repo}`);
|
|
7
|
+
|
|
8
|
+
const { issues } = response.data;
|
|
9
|
+
if (issues === undefined) {
|
|
10
|
+
throw new Error('没有获取到数据');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const md = MarkdownIt({
|
|
14
|
+
html: true,
|
|
15
|
+
});
|
|
16
|
+
ctx.state.data = {
|
|
17
|
+
title: `Issue Hunt 的悬赏 -- ${username}/${repo}`,
|
|
18
|
+
link: `https://issuehunt.io/r/${username}/${repo}`,
|
|
19
|
+
description: ``,
|
|
20
|
+
item: issues.map((item) => ({
|
|
21
|
+
title: item.title,
|
|
22
|
+
description: md.render(item.body),
|
|
23
|
+
pubDate: item.fundedAt,
|
|
24
|
+
link: `https://issuehunt.io/r/${username}/${repo}/issues/${item.number}`,
|
|
25
|
+
author: item.userName,
|
|
26
|
+
})),
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'issuehunt.io': {
|
|
3
|
+
_name: 'Issue Hunt',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '项目悬赏',
|
|
7
|
+
docs: 'https://docs.rsshub.app/programming.html#issue-hunt-xiang-mu-xuan-shang',
|
|
8
|
+
source: '/r/:username/:repo',
|
|
9
|
+
target: ({ username, repo }) => `/issuehunt/funded/${username}/${repo}`,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const baseUrl = 'https://www.jiaoliudao.com';
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const { data } = await got(`${baseUrl}/wp-json/wp/v2/posts`, {
|
|
8
|
+
searchParams: {
|
|
9
|
+
per_page: ctx.query.limit ? parseInt(ctx.query.limit) : 100,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const items = data.map((item) => {
|
|
14
|
+
const $ = cheerio.load(item.content.rendered, null, false);
|
|
15
|
+
$('img').each((_, img) => {
|
|
16
|
+
if (img.attribs['data-original']) {
|
|
17
|
+
img.attribs.src = img.attribs['data-original'];
|
|
18
|
+
delete img.attribs['data-original'];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
title: item.title.rendered,
|
|
23
|
+
description: $.html(),
|
|
24
|
+
pubDate: parseDate(item.date_gmt),
|
|
25
|
+
link: item.link,
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
ctx.state.data = {
|
|
30
|
+
title: '交流岛资源网-专注网络资源收集',
|
|
31
|
+
image: `${baseUrl}/favicon.ico`,
|
|
32
|
+
link: baseUrl,
|
|
33
|
+
item: items,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const config = require('@/config').value;
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const { important = false } = ctx.params;
|
|
10
|
+
const data = await ctx.cache.tryGet(
|
|
11
|
+
'jin10:index',
|
|
12
|
+
async () => {
|
|
13
|
+
const { data: response } = await got('https://flash-api.jin10.com/get_flash_list', {
|
|
14
|
+
headers: {
|
|
15
|
+
'x-app-id': 'bVBF4FyRTn5NJF5n',
|
|
16
|
+
'x-version': '1.0.0',
|
|
17
|
+
},
|
|
18
|
+
searchParams: {
|
|
19
|
+
channel: '-8200',
|
|
20
|
+
vip: '1',
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return response.data.filter((item) => item.type !== 1);
|
|
24
|
+
},
|
|
25
|
+
config.cache.routeExpire,
|
|
26
|
+
false
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const item = data.map((item) => {
|
|
30
|
+
const titleMatch = item.data.content.match(/^【(.*?)】/);
|
|
31
|
+
let title;
|
|
32
|
+
let content = item.data.content;
|
|
33
|
+
if (titleMatch) {
|
|
34
|
+
title = titleMatch[1];
|
|
35
|
+
content = content.replace(titleMatch[0], '');
|
|
36
|
+
} else {
|
|
37
|
+
title = item.data.vip_title || item.data.content;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
title,
|
|
42
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
43
|
+
content,
|
|
44
|
+
pic: item.data.pic,
|
|
45
|
+
}),
|
|
46
|
+
pubDate: timezone(parseDate(item.time), 8),
|
|
47
|
+
link: item.data.link,
|
|
48
|
+
guid: `jin10:index:${item.id}`,
|
|
49
|
+
important: item.important,
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
ctx.state.data = {
|
|
54
|
+
title: '金十数据',
|
|
55
|
+
link: 'https://www.jin10.com/',
|
|
56
|
+
item: important ? item.filter((item) => item.important) : item,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
let baseUrl, apiUrl;
|
|
8
|
+
let title, description;
|
|
9
|
+
let lang = ctx.params.lang;
|
|
10
|
+
switch (lang) {
|
|
11
|
+
case 'en':
|
|
12
|
+
baseUrl = 'https://www.mclaren.com';
|
|
13
|
+
title = 'McLaren Racing – Official Website';
|
|
14
|
+
description = 'Latest news and insight from McLaren Racing. Team and driver updates, videos and McLaren Formula 1 LIVE commentary.';
|
|
15
|
+
lang = 'en-UK';
|
|
16
|
+
break;
|
|
17
|
+
case 'zh':
|
|
18
|
+
baseUrl = 'https://cn.mclaren.com';
|
|
19
|
+
title = '迈凯伦赛车 — 官方网站';
|
|
20
|
+
description = '来自迈凯伦一级方程式车队的最新消息。 查看车队和车手近况、视频以及比赛中的迈凯伦实况评论和实时数据。';
|
|
21
|
+
lang = 'zh-CN';
|
|
22
|
+
break;
|
|
23
|
+
case 'es':
|
|
24
|
+
baseUrl = 'https://es.mclaren.com';
|
|
25
|
+
title = 'McLaren Racing - Sitio web oficial';
|
|
26
|
+
description =
|
|
27
|
+
'Consulta las últimas noticias del equipo de Fórmula 1 McLaren. Incluye información sobre el equipo, las últimas actualizaciones de los pilotos y McLaren LIVE, una aplicación con la que podrás seguir los comentarios en directo.';
|
|
28
|
+
lang = 'es-ES';
|
|
29
|
+
break;
|
|
30
|
+
default:
|
|
31
|
+
throw Error(`Language '${lang}' is not supported.`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const { category = 'all' } = ctx.params;
|
|
35
|
+
const categoryArr = ['all', 'article', 'report', 'gallery', 'video', 'blog', 'photo_essay'];
|
|
36
|
+
if (!categoryArr.includes(category)) {
|
|
37
|
+
throw Error(`Category '${category}' is not supported.`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const link = baseUrl + '/racing/articles/';
|
|
41
|
+
apiUrl = baseUrl + '/racing/api/grid-search/?count=30&offset=0&type=';
|
|
42
|
+
// count: number of requested entries; default to 16, up to 30.
|
|
43
|
+
// offset: default to 0.
|
|
44
|
+
if (category !== 'all') {
|
|
45
|
+
apiUrl += category;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const response = await got(apiUrl);
|
|
49
|
+
|
|
50
|
+
const html = response.data.html;
|
|
51
|
+
const $ = cheerio.load(html);
|
|
52
|
+
const list = $('li')
|
|
53
|
+
.toArray()
|
|
54
|
+
.map((item) => {
|
|
55
|
+
item = $(item);
|
|
56
|
+
const thumbnailUrl = item.find('div.start-grid-content__img').attr('style').slice(22, -2);
|
|
57
|
+
return {
|
|
58
|
+
link: baseUrl + item.find('a.start-grid-content__link').attr('href'),
|
|
59
|
+
thumbnailUrl, // Pass the thumbnail image
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const items = await Promise.all(
|
|
64
|
+
list.map((item) =>
|
|
65
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
66
|
+
const itemRep = await got(item.link);
|
|
67
|
+
const $ = cheerio.load(itemRep.data);
|
|
68
|
+
$('.livestream--wrapper').last().remove();
|
|
69
|
+
item.title = $('meta[property="og:title"]').attr('content').slice(17);
|
|
70
|
+
item.pubDate = Date.parse($('time[datetime]').first().attr('datetime'));
|
|
71
|
+
const artParams = {
|
|
72
|
+
desc: $('meta[property="og:description"]').attr('content'),
|
|
73
|
+
heroUrl: $('meta[property="og:image"]').attr('content'),
|
|
74
|
+
videoId: $('a[data-video-id]').attr('data-video-id'),
|
|
75
|
+
};
|
|
76
|
+
$('.meta--hold, .show-for-small').remove();
|
|
77
|
+
artParams.content = $('div.article-body').html();
|
|
78
|
+
item.description = art(path.join(__dirname, 'templates/desc.art'), artParams);
|
|
79
|
+
item.media = {
|
|
80
|
+
thumbnail: {
|
|
81
|
+
url: item.thumbnailUrl,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
return item;
|
|
85
|
+
})
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
ctx.state.data = {
|
|
90
|
+
language: lang,
|
|
91
|
+
title,
|
|
92
|
+
description,
|
|
93
|
+
link,
|
|
94
|
+
item: items,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'mclaren.com': {
|
|
3
|
+
_name: 'Mclaren Racing',
|
|
4
|
+
www: [
|
|
5
|
+
{
|
|
6
|
+
title: 'Mclaren Racing',
|
|
7
|
+
docs: 'https://docs.rsshub.app/new-media.html#mai-kai-lun-sai-che',
|
|
8
|
+
source: '/racing/articles/',
|
|
9
|
+
target: '/mclaren/en/all',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
cn: [
|
|
13
|
+
{
|
|
14
|
+
title: '迈凯伦赛车',
|
|
15
|
+
docs: 'https://docs.rsshub.app/new-media.html#mai-kai-lun-sai-che',
|
|
16
|
+
source: '/racing/articles/',
|
|
17
|
+
target: '/mclaren/zh/all',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
es: [
|
|
21
|
+
{
|
|
22
|
+
title: 'Mclaren Racing',
|
|
23
|
+
docs: 'https://docs.rsshub.app/new-media.html#mai-kai-lun-sai-che',
|
|
24
|
+
source: '/racing/articles/',
|
|
25
|
+
target: '/mclaren/es/all',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<p>{{ desc }}</p><br>
|
|
2
|
+
<center><img src="{{ heroUrl }}"></center><br>
|
|
3
|
+
{{ if videoId }}
|
|
4
|
+
<center><iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube-nocookie.com/embed/{{ videoId }}" frameborder="0" allowfullscreen></iframe></center><br>
|
|
5
|
+
{{ /if }}
|
|
6
|
+
{{@ content }}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const utils = require('./utils');
|
|
3
|
+
const config = require('@/config').value;
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const site = ctx.params.site;
|
|
7
|
+
if (!config.feature.allow_user_supply_unsafe_domain && !utils.allowSiteList.includes(site)) {
|
|
8
|
+
ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// docs on: https://misskey-hub.net/docs/api/endpoints/notes/featured.html
|
|
12
|
+
const url = `https://${site}/api/notes/featured`;
|
|
13
|
+
const response = await got({
|
|
14
|
+
method: 'post',
|
|
15
|
+
url,
|
|
16
|
+
json: {
|
|
17
|
+
limit: 10,
|
|
18
|
+
offset: 0,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const list = response.data;
|
|
23
|
+
|
|
24
|
+
ctx.state.data = {
|
|
25
|
+
title: `Featured Notes on ${site}`,
|
|
26
|
+
link: `https://${site}/explore`,
|
|
27
|
+
item: utils.parseNotes(list, site),
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'misskey.io': {
|
|
3
|
+
_name: 'Misskey',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: 'Featured Notes',
|
|
7
|
+
docs: 'https://docs.rsshub.app/social-media.html#misskey',
|
|
8
|
+
source: ['/explore'],
|
|
9
|
+
target: '/misskey/notes/featured/misskey.io',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
'madost.one': {
|
|
14
|
+
_name: 'Misskey',
|
|
15
|
+
'.': [
|
|
16
|
+
{
|
|
17
|
+
title: 'Featured Notes',
|
|
18
|
+
docs: 'https://docs.rsshub.app/social-media.html#misskey',
|
|
19
|
+
source: ['/explore'],
|
|
20
|
+
target: '/misskey/notes/featured/madost.one',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
'mk.nixnet.social': {
|
|
25
|
+
_name: 'Misskey',
|
|
26
|
+
'.': [
|
|
27
|
+
{
|
|
28
|
+
title: 'Featured Notes',
|
|
29
|
+
docs: 'https://docs.rsshub.app/social-media.html#misskey',
|
|
30
|
+
source: ['/explore'],
|
|
31
|
+
target: '/misskey/notes/featured/mk.nixnet.social',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{{ text.replace(/\n/g, '<br>') }}
|
|
2
|
+
|
|
3
|
+
{{ each files file }}
|
|
4
|
+
<br>
|
|
5
|
+
{{ if file.type.includes('image') }}
|
|
6
|
+
<img src="{{ file.url }}" />
|
|
7
|
+
{{ else if file.type.includes('video') }}
|
|
8
|
+
<video controls poster="{{ file.thumbnailUrl }}">
|
|
9
|
+
<source src="{{ file.url }}" type="{{ file.type }}">
|
|
10
|
+
</video>
|
|
11
|
+
{{ else if file.type.includes('audio') }}
|
|
12
|
+
<audio controls>
|
|
13
|
+
<source src="{{ file.url }}" type="{{ file.type }}">
|
|
14
|
+
</audio>
|
|
15
|
+
{{ else }}
|
|
16
|
+
<a href="{{ file.url }}" target="_blank">{{ file.name }}</a>
|
|
17
|
+
{{ /if }}
|
|
18
|
+
{{ if file.comment }}
|
|
19
|
+
<p>{{ file.comment }}</p>
|
|
20
|
+
{{ /if }}
|
|
21
|
+
{{ /each }}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const { art } = require('@/utils/render');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const allowSiteList = ['misskey.io', 'madost.one', 'mk.nixnet.social'];
|
|
6
|
+
|
|
7
|
+
// docs on: https://misskey-hub.net/docs/api/entity/note.html
|
|
8
|
+
const parseNotes = (data, site) =>
|
|
9
|
+
data.map((item) => {
|
|
10
|
+
const host = item.user.host === null ? site : item.user.host;
|
|
11
|
+
const author = `${item.user.name} (@${item.user.username}@${host})`;
|
|
12
|
+
const description = art(path.join(__dirname, 'templates/note.art'), {
|
|
13
|
+
text: item.text,
|
|
14
|
+
files: item.files,
|
|
15
|
+
});
|
|
16
|
+
const title = `${author}: "${description}"`;
|
|
17
|
+
const link = `https://${host}/notes/${item.id}`;
|
|
18
|
+
const pubDate = parseDate(item.createdAt);
|
|
19
|
+
return {
|
|
20
|
+
title,
|
|
21
|
+
description,
|
|
22
|
+
pubDate,
|
|
23
|
+
link,
|
|
24
|
+
author,
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
module.exports = {
|
|
29
|
+
parseNotes,
|
|
30
|
+
allowSiteList,
|
|
31
|
+
};
|