rsshub 1.0.0-master.f97cdb2 → 1.0.0-master.fa3428f
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/README.md +1 -1
- package/lib/config.js +3 -1
- package/lib/radar-rules.js +0 -92
- package/lib/router.js +68 -71
- package/lib/routes/tencent/wechat/miniprogram/framework.js +4 -2
- package/lib/utils/common-config.js +4 -0
- package/lib/utils/parse-date.js +8 -7
- package/lib/utils/rand-user-agent.js +29 -0
- package/lib/utils/request-wrapper.js +2 -5
- package/lib/utils/wechat-mp.js +106 -10
- package/lib/v2/agirls/index.js +6 -0
- package/lib/v2/bilibili/video.js +1 -0
- package/lib/v2/bookfere/category.js +36 -0
- package/lib/v2/bookfere/maintainer.js +3 -0
- package/lib/v2/bookfere/radar.js +11 -0
- package/lib/v2/bookfere/router.js +3 -0
- package/lib/v2/cankaoxiaoxi/index.js +81 -0
- package/lib/v2/cankaoxiaoxi/maintainer.js +3 -0
- package/lib/v2/cankaoxiaoxi/radar.js +61 -0
- package/lib/v2/cankaoxiaoxi/router.js +3 -0
- package/lib/{routes → v2}/cctv/category.js +1 -1
- package/lib/{routes → v2}/cctv/jx.js +6 -1
- package/lib/{routes → v2}/cctv/lm.js +1 -1
- package/lib/v2/cctv/maintainer.js +7 -0
- package/lib/v2/cctv/radar.js +41 -0
- package/lib/v2/cctv/router.js +7 -0
- package/lib/{routes → v2}/cctv/special.js +6 -4
- package/lib/{routes → v2}/cctv/utils/mzzlbg.js +8 -6
- package/lib/{routes → v2}/cctv/utils/news.js +25 -22
- package/lib/{routes → v2}/cctv/utils/xinwen1j1.js +20 -17
- package/lib/v2/cctv/xwlb.js +50 -0
- package/lib/v2/chinacef/experts.js +38 -0
- package/lib/v2/chinacef/hot.js +38 -0
- package/lib/v2/chinacef/index.js +39 -0
- package/lib/v2/chinacef/maintainer.js +5 -0
- package/lib/v2/chinacef/radar.js +25 -0
- package/lib/v2/chinacef/router.js +5 -0
- package/lib/v2/{wechat → chinacef}/templates/description.art +0 -0
- package/lib/v2/chinacef/utils.js +55 -0
- package/lib/v2/chinanews/index.js +65 -0
- package/lib/v2/chinanews/maintainer.js +3 -0
- package/lib/v2/chinanews/radar.js +13 -0
- package/lib/v2/chinanews/router.js +3 -0
- package/lib/v2/cnbeta/index.js +2 -1
- package/lib/v2/cnbeta/utils.js +1 -0
- package/lib/v2/dapenti/maintainer.js +4 -0
- package/lib/v2/dapenti/radar.js +27 -0
- package/lib/v2/dapenti/router.js +4 -0
- package/lib/{routes → v2}/dapenti/subject.js +1 -1
- package/lib/{routes → v2}/dapenti/tugua.js +1 -1
- package/lib/v2/dapenti/utils.js +75 -0
- package/lib/{routes → v2}/dongqiudi/daily.js +10 -13
- package/lib/v2/dongqiudi/maintainer.js +8 -0
- package/lib/{routes → v2}/dongqiudi/player_news.js +0 -0
- package/lib/v2/dongqiudi/radar.js +45 -0
- package/lib/{routes → v2}/dongqiudi/result.js +2 -1
- package/lib/v2/dongqiudi/router.js +8 -0
- package/lib/{routes → v2}/dongqiudi/special.js +0 -0
- package/lib/{routes → v2}/dongqiudi/team_news.js +0 -0
- package/lib/{routes → v2}/dongqiudi/top_news.js +12 -15
- package/lib/{routes → v2}/dongqiudi/utils.js +47 -28
- package/lib/v2/dut/defaults.js +53 -0
- package/lib/v2/dut/index.js +78 -0
- package/lib/v2/dut/maintainer.js +14 -0
- package/lib/v2/dut/radar.js +109 -0
- package/lib/v2/dut/router.js +4 -0
- package/lib/v2/dut/shortcuts.js +77 -0
- package/lib/{routes → v2}/dx2025/index.js +0 -0
- package/lib/v2/dx2025/maintainer.js +3 -0
- package/lib/v2/dx2025/radar.js +19 -0
- package/lib/v2/dx2025/router.js +3 -0
- package/lib/v2/e-hentai/radar.js +21 -3
- package/lib/v2/eagle/blog.js +47 -0
- package/lib/{routes → v2}/eagle/changelog.js +3 -1
- package/lib/v2/eagle/maintainer.js +4 -0
- package/lib/v2/eagle/radar.js +101 -0
- package/lib/v2/eagle/router.js +4 -0
- package/lib/{routes → v2}/ehentai/ehapi.js +50 -21
- package/lib/{routes → v2}/ehentai/favorites.js +4 -2
- package/lib/v2/ehentai/maintainer.js +5 -0
- package/lib/v2/ehentai/router.js +5 -0
- package/lib/{routes → v2}/ehentai/search.js +5 -3
- package/lib/{routes → v2}/ehentai/tag.js +4 -2
- package/lib/v2/firefox/index.js +7 -2
- package/lib/v2/fortunechina/index.js +1 -1
- package/lib/v2/github/comments.js +7 -0
- package/lib/v2/gitpod/blog.js +8 -0
- package/lib/v2/gov/maintainer.js +1 -0
- package/lib/v2/gov/nrta/news.js +63 -0
- package/lib/v2/gov/radar.js +11 -0
- package/lib/v2/gov/router.js +1 -0
- package/lib/v2/guancha/index.js +1 -1
- package/lib/v2/guangdiu/cheaps.js +28 -0
- package/lib/v2/guangdiu/index.js +44 -0
- package/lib/v2/guangdiu/maintainer.js +5 -0
- package/lib/v2/guangdiu/radar.js +25 -0
- package/lib/v2/guangdiu/rank.js +38 -0
- package/lib/v2/guangdiu/router.js +5 -0
- package/lib/{routes/guokr/calendar.js → v2/guokr/channel.js} +2 -2
- package/lib/v2/guokr/maintainer.js +4 -0
- package/lib/v2/guokr/radar.js +19 -0
- package/lib/v2/guokr/router.js +4 -0
- package/lib/{routes → v2}/guokr/scientific.js +3 -3
- package/lib/v2/hkej/index.js +9 -15
- package/lib/v2/hkepc/index.js +8 -0
- package/lib/v2/hket/index.js +10 -2
- package/lib/v2/huangz/index.js +29 -0
- package/lib/v2/huangz/maintainer.js +3 -0
- package/lib/v2/huangz/radar.js +13 -0
- package/lib/v2/huangz/router.js +3 -0
- package/lib/v2/huanqiu/index.js +65 -0
- package/lib/v2/huanqiu/maintainer.js +3 -0
- package/lib/v2/huanqiu/radar.js +13 -0
- package/lib/v2/huanqiu/router.js +3 -0
- package/lib/v2/miris/blog.js +19 -0
- package/lib/v2/miris/maintainer.js +3 -0
- package/lib/v2/miris/radar.js +11 -0
- package/lib/v2/miris/router.js +3 -0
- package/lib/v2/news/whxw.js +2 -2
- package/lib/v2/npm/package.js +1 -1
- package/lib/v2/npm/router.js +1 -1
- package/lib/v2/qbittorrent/maintainer.js +3 -0
- package/lib/v2/qbittorrent/news.js +59 -0
- package/lib/v2/qbittorrent/radar.js +13 -0
- package/lib/v2/qbittorrent/router.js +3 -0
- package/lib/v2/rsshub/sponsors.js +1 -0
- package/lib/{routes → v2}/sciencenet/blog.js +17 -12
- package/lib/v2/sciencenet/maintainer.js +4 -0
- package/lib/v2/sciencenet/radar.js +19 -0
- package/lib/v2/sciencenet/router.js +4 -0
- package/lib/v2/sciencenet/user.js +65 -0
- package/lib/v2/sdu/cmse.js +59 -0
- package/lib/v2/sdu/cs.js +57 -0
- package/lib/v2/sdu/data.js +110 -0
- package/lib/v2/sdu/epe.js +55 -0
- package/lib/v2/sdu/extractor/index.js +15 -0
- package/lib/v2/sdu/extractor/sdrj.js +21 -0
- package/lib/v2/sdu/extractor/view.js +21 -0
- package/lib/v2/sdu/extractor/wh/jwc.js +24 -0
- package/lib/v2/sdu/extractor/wh/news.js +21 -0
- package/lib/v2/sdu/maintainer.js +9 -0
- package/lib/v2/sdu/mech.js +60 -0
- package/lib/v2/sdu/radar.js +159 -0
- package/lib/v2/sdu/router.js +9 -0
- package/lib/v2/sdu/sc.js +61 -0
- package/lib/v2/sdu/wh/jwc.js +42 -0
- package/lib/v2/sdu/wh/news.js +38 -0
- package/lib/v2/stratechery/index.js +20 -0
- package/lib/v2/stratechery/maintainer.js +3 -0
- package/lib/v2/stratechery/radar.js +11 -0
- package/lib/v2/stratechery/router.js +3 -0
- package/lib/{routes → v2}/taptap/changelog.js +2 -1
- package/lib/v2/taptap/maintainer.js +5 -0
- package/lib/v2/taptap/radar.js +25 -0
- package/lib/v2/taptap/review.js +69 -0
- package/lib/v2/taptap/router.js +5 -0
- package/lib/v2/taptap/templates/videoPost.art +2 -0
- package/lib/v2/taptap/topic.js +79 -0
- package/lib/v2/taptap/utils.js +48 -0
- package/lib/v2/thecover/channel.js +66 -0
- package/lib/v2/thecover/maintainer.js +3 -0
- package/lib/v2/thecover/radar.js +13 -0
- package/lib/v2/thecover/router.js +3 -0
- package/lib/{routes → v2}/twreporter/category.js +7 -12
- package/lib/{routes → v2}/twreporter/fetch_article.js +5 -4
- package/lib/v2/twreporter/maintainer.js +5 -0
- package/lib/{routes → v2}/twreporter/newest.js +8 -13
- package/lib/v2/twreporter/photography.js +46 -0
- package/lib/v2/twreporter/radar.js +25 -0
- package/lib/v2/twreporter/router.js +5 -0
- package/lib/{routes/tencent → v2}/wechat/announce.js +3 -2
- package/lib/v2/wechat/ce.js +69 -0
- package/lib/v2/wechat/data258.js +137 -0
- package/lib/v2/wechat/ershcimi.js +35 -0
- package/lib/{routes/tencent → v2}/wechat/feeds.js +0 -0
- package/lib/v2/wechat/maintainer.js +11 -0
- package/lib/{routes/tencent → v2}/wechat/mp.js +0 -0
- package/lib/{routes/tencent → v2}/wechat/msgalbum.js +0 -0
- package/lib/v2/wechat/radar.js +76 -1
- package/lib/v2/wechat/router.js +11 -0
- package/lib/{routes/tencent → v2}/wechat/tgchannel.js +0 -0
- package/lib/{routes/tencent → v2}/wechat/uread.js +0 -0
- package/lib/{routes/tencent → v2}/wechat/wemp.js +0 -0
- package/lib/{routes/tencent → v2}/wechat/wxnmh.js +0 -0
- package/lib/{routes → v2}/xueqiu/favorite.js +2 -1
- package/lib/v2/xueqiu/fund.js +50 -0
- package/lib/{routes → v2}/xueqiu/hots.js +2 -1
- package/lib/v2/xueqiu/maintainer.js +10 -0
- package/lib/v2/xueqiu/radar.js +60 -0
- package/lib/v2/xueqiu/router.js +10 -0
- package/lib/{routes → v2}/xueqiu/snb.js +2 -1
- package/lib/{routes → v2}/xueqiu/stock_comments.js +4 -20
- package/lib/{routes → v2}/xueqiu/stock_info.js +2 -1
- package/lib/v2/xueqiu/templates/comments_description.art +10 -0
- package/lib/{routes → v2}/xueqiu/user.js +2 -1
- package/lib/{routes → v2}/xueqiu/user_stock.js +3 -2
- package/lib/v2/yunspe/maintainer.js +3 -0
- package/lib/v2/yunspe/newsflash.js +42 -0
- package/lib/v2/yunspe/radar.js +13 -0
- package/lib/v2/yunspe/router.js +3 -0
- package/lib/{routes → v2}/yystv/category.js +8 -8
- package/lib/{routes → v2}/yystv/docs.js +2 -2
- package/lib/v2/yystv/maintainer.js +4 -0
- package/lib/v2/yystv/radar.js +49 -0
- package/lib/v2/yystv/router.js +4 -0
- package/lib/{routes/universities → v2}/zju/career/index.js +14 -13
- package/lib/{routes/universities → v2}/zju/cst/custom.js +2 -1
- package/lib/{routes/universities → v2}/zju/cst/index.js +20 -24
- package/lib/v2/zju/grs/index.js +43 -0
- package/lib/v2/zju/list.js +66 -0
- package/lib/v2/zju/maintainer.js +8 -0
- package/lib/v2/zju/physics/index.js +52 -0
- package/lib/v2/zju/radar.js +139 -0
- package/lib/v2/zju/router.js +8 -0
- package/lib/views/atom.art +13 -1
- package/lib/views/welcome.art +4 -1
- package/package.json +13 -12
- package/lib/routes/cctv/xwlb.js +0 -48
- package/lib/routes/dapenti/utils.js +0 -73
- package/lib/routes/taptap/review.js +0 -39
- package/lib/routes/taptap/topic.js +0 -85
- package/lib/routes/tencent/wechat/_README +0 -1
- package/lib/routes/tencent/wechat/ce.js +0 -40
- package/lib/routes/tencent/wechat/ershcimi.js +0 -43
- package/lib/routes/twreporter/photography.js +0 -57
- package/lib/routes/universities/dut/index.js +0 -60
- package/lib/routes/universities/dut/subsite.js +0 -50
- package/lib/routes/universities/sdu/cmse.js +0 -55
- package/lib/routes/universities/sdu/cs.js +0 -55
- package/lib/routes/universities/sdu/epe.js +0 -54
- package/lib/routes/universities/sdu/mech.js +0 -58
- package/lib/routes/universities/sdu/sc.js +0 -56
- package/lib/routes/universities/zju/grs/index.js +0 -44
- package/lib/routes/universities/zju/list.js +0 -78
- package/lib/routes/universities/zju/physics/index.js +0 -55
- package/lib/routes/xueqiu/fund.js +0 -71
- package/lib/v2/wechat/templates/image.art +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
|
|
6
|
+
const typelist = ['通知公告', '院所新闻', '教学信息', '学术动态', '学院简报'];
|
|
7
|
+
const urlList = ['xwdt/tzgg.htm', 'xwdt/ysxw.htm', 'xwdt/jxxx.htm', 'xwdt/xsdt.htm', 'xwdt/xyjb.htm'];
|
|
8
|
+
const host = 'https://www.mech.sdu.edu.cn/';
|
|
9
|
+
|
|
10
|
+
module.exports = async (ctx) => {
|
|
11
|
+
const type = ctx.params.type ? parseInt(ctx.params.type) : 0;
|
|
12
|
+
const link = new URL(urlList[type], host).href;
|
|
13
|
+
const response = await got(link);
|
|
14
|
+
|
|
15
|
+
const $ = cheerio.load(response.data);
|
|
16
|
+
|
|
17
|
+
let item = $('#page_list li a')
|
|
18
|
+
.slice(0, 1)
|
|
19
|
+
.map((_, e) => {
|
|
20
|
+
e = $(e);
|
|
21
|
+
return {
|
|
22
|
+
title: e.attr('title'),
|
|
23
|
+
link: e.attr('href'),
|
|
24
|
+
};
|
|
25
|
+
})
|
|
26
|
+
.get();
|
|
27
|
+
|
|
28
|
+
item = await Promise.all(
|
|
29
|
+
item
|
|
30
|
+
.filter((e) => e.link.startsWith('../info') || e.link.startsWith('https://www.rd.sdu.edu.cn/'))
|
|
31
|
+
.map((item) => {
|
|
32
|
+
const isFromMech = item.link.startsWith('../info');
|
|
33
|
+
if (isFromMech) {
|
|
34
|
+
item.link = new URL(item.link.slice('3'), host).href;
|
|
35
|
+
}
|
|
36
|
+
return ctx.cache.tryGet(item.link, async () => {
|
|
37
|
+
const response = await got(item.link);
|
|
38
|
+
const $ = cheerio.load(response.data);
|
|
39
|
+
|
|
40
|
+
const info = $('#show_info').text().split(/\s{4}/);
|
|
41
|
+
const date = info[0].split(':')[1];
|
|
42
|
+
|
|
43
|
+
item.title = $('#show_title').text().trim();
|
|
44
|
+
item.author = info[1].replace('作者:', '') || '山东大学机械工程学院';
|
|
45
|
+
$('#show_title, #show_info').remove();
|
|
46
|
+
item.description = $('form[name=_newscontent_fromname] div').html();
|
|
47
|
+
item.pubDate = timezone(parseDate(date), +8);
|
|
48
|
+
|
|
49
|
+
return item;
|
|
50
|
+
});
|
|
51
|
+
})
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
ctx.state.data = {
|
|
55
|
+
title: `山东大学机械工程学院${typelist[type]}`,
|
|
56
|
+
description: $('title').text(),
|
|
57
|
+
link,
|
|
58
|
+
item,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
const { wh } = require('./data');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
'sdu.edu.cn': {
|
|
5
|
+
_name: '山东大学',
|
|
6
|
+
'xinwen.wh': Object.entries(wh.news.columns).map(([, value]) => ({
|
|
7
|
+
title: wh.news.titlePrefix + value.name,
|
|
8
|
+
docs: wh.news.docs,
|
|
9
|
+
source: wh.news.source,
|
|
10
|
+
target: '/sdu/wh' + wh.news.getTarget(value.url),
|
|
11
|
+
})),
|
|
12
|
+
'jwc.wh': Object.entries(wh.jwc.columns).map(([, value]) => ({
|
|
13
|
+
title: wh.jwc.titlePrefix + value.name,
|
|
14
|
+
docs: wh.jwc.docs,
|
|
15
|
+
source: wh.jwc.source,
|
|
16
|
+
target: '/sdu/wh' + wh.jwc.getTarget(value.url),
|
|
17
|
+
})),
|
|
18
|
+
'www.cmse': [
|
|
19
|
+
{
|
|
20
|
+
title: '材料科学与工程学院通知',
|
|
21
|
+
docs: 'https://docs.rsshub.app/university.html#shan-dong-da-xue',
|
|
22
|
+
source: ['/*path', '/'],
|
|
23
|
+
target: (params) => {
|
|
24
|
+
let type;
|
|
25
|
+
switch (params.path) {
|
|
26
|
+
case 'zxzx/tzgg.htm':
|
|
27
|
+
type = '0';
|
|
28
|
+
break;
|
|
29
|
+
case 'zxzx/xyxw.htm':
|
|
30
|
+
type = '1';
|
|
31
|
+
break;
|
|
32
|
+
case 'zxzx/bksjy.htm':
|
|
33
|
+
type = '2';
|
|
34
|
+
break;
|
|
35
|
+
case 'zxzx/yjsjy.htm':
|
|
36
|
+
type = '3';
|
|
37
|
+
break;
|
|
38
|
+
case 'zxzx/xsdt.htm':
|
|
39
|
+
type = '4';
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
type = '0';
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
return `/sdu/cmse/${type}`;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
'www.cs': [
|
|
50
|
+
{
|
|
51
|
+
title: '计算机科学与技术学院通知',
|
|
52
|
+
docs: 'https://docs.rsshub.app/university.html#shan-dong-da-xue',
|
|
53
|
+
source: ['/*path', '/'],
|
|
54
|
+
target: (params) => {
|
|
55
|
+
let type;
|
|
56
|
+
switch (params.path) {
|
|
57
|
+
case 'xygg.htm':
|
|
58
|
+
type = '0';
|
|
59
|
+
break;
|
|
60
|
+
case 'xsbg.htm':
|
|
61
|
+
type = '1';
|
|
62
|
+
break;
|
|
63
|
+
case 'kjjx.htm':
|
|
64
|
+
type = '2';
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
type = '0';
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
return `/sdu/cs/${type}`;
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
'www.epe': [
|
|
75
|
+
{
|
|
76
|
+
title: '能源与动力工程学院通知',
|
|
77
|
+
docs: 'https://docs.rsshub.app/university.html#shan-dong-da-xue',
|
|
78
|
+
source: ['/*path', '/'],
|
|
79
|
+
target: (params) => {
|
|
80
|
+
let type;
|
|
81
|
+
switch (params.path) {
|
|
82
|
+
case 'zxzx/xydt.htm':
|
|
83
|
+
type = '0';
|
|
84
|
+
break;
|
|
85
|
+
case 'zxzx/tzgg.htm':
|
|
86
|
+
type = '1';
|
|
87
|
+
break;
|
|
88
|
+
case 'zxzx/xslt.htm':
|
|
89
|
+
type = '2';
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
type = '0';
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
return `/sdu/epe/${type}`;
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
'www.mech': [
|
|
100
|
+
{
|
|
101
|
+
title: '机械工程学院通知',
|
|
102
|
+
docs: 'https://docs.rsshub.app/university.html#shan-dong-da-xue',
|
|
103
|
+
source: ['/*path', '/'],
|
|
104
|
+
target: (params) => {
|
|
105
|
+
let type;
|
|
106
|
+
switch (params.path) {
|
|
107
|
+
case 'xwdt/tzgg.htm':
|
|
108
|
+
type = '0';
|
|
109
|
+
break;
|
|
110
|
+
case 'xwdt/ysxw.htm':
|
|
111
|
+
type = '1';
|
|
112
|
+
break;
|
|
113
|
+
case 'xwdt/jxxx.htm':
|
|
114
|
+
type = '2';
|
|
115
|
+
break;
|
|
116
|
+
case 'xwdt/xsdt.htm':
|
|
117
|
+
type = '3';
|
|
118
|
+
break;
|
|
119
|
+
case 'xwdt/xyjb.htm':
|
|
120
|
+
type = '4';
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
type = '0';
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return `/sdu/mech/${type}`;
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
'www.sc': [
|
|
131
|
+
{
|
|
132
|
+
title: '软件学院通知',
|
|
133
|
+
docs: 'https://docs.rsshub.app/university.html#shan-dong-da-xue',
|
|
134
|
+
source: ['/*path', '/'],
|
|
135
|
+
target: (params) => {
|
|
136
|
+
let type;
|
|
137
|
+
switch (params.path) {
|
|
138
|
+
case 'tzgg.htm':
|
|
139
|
+
type = '0';
|
|
140
|
+
break;
|
|
141
|
+
case 'kxyj/xsyg.htm':
|
|
142
|
+
type = '1';
|
|
143
|
+
break;
|
|
144
|
+
case 'rcpy/bkjy.htm':
|
|
145
|
+
type = '2';
|
|
146
|
+
break;
|
|
147
|
+
case 'rcpy/yjsjy.htm':
|
|
148
|
+
type = '3';
|
|
149
|
+
break;
|
|
150
|
+
default:
|
|
151
|
+
type = '0';
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
return `/sdu/sc/${type}`;
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
module.exports = function (router) {
|
|
2
|
+
router.get('/cmse/:type?', require('./cmse'));
|
|
3
|
+
router.get('/cs/:type?', require('./cs'));
|
|
4
|
+
router.get('/epe/:type?', require('./epe'));
|
|
5
|
+
router.get('/mech/:type?', require('./mech'));
|
|
6
|
+
router.get('/sc/:type?', require('./sc'));
|
|
7
|
+
router.get('/wh/news/:column?', require('./wh/news'));
|
|
8
|
+
router.get('/wh/jwc/:column?', require('./wh/jwc'));
|
|
9
|
+
};
|
package/lib/v2/sdu/sc.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
const host = 'https://www.sc.sdu.edu.cn/';
|
|
6
|
+
const typelist = ['通知公告', '学术动态', '本科教育', '研究生教育'];
|
|
7
|
+
const urlList = ['tzgg.htm', 'kxyj/xsyg.htm', 'rcpy/bkjy.htm', 'rcpy/yjsjy.htm'];
|
|
8
|
+
|
|
9
|
+
module.exports = async (ctx) => {
|
|
10
|
+
const type = ctx.params.type ? parseInt(ctx.params.type) : 0;
|
|
11
|
+
const link = new URL(urlList[type], host).href;
|
|
12
|
+
const response = await got(link);
|
|
13
|
+
|
|
14
|
+
const $ = cheerio.load(response.data);
|
|
15
|
+
|
|
16
|
+
let item = $('.newlist01 li')
|
|
17
|
+
.map((_, e) => {
|
|
18
|
+
e = $(e);
|
|
19
|
+
const a = e.find('a');
|
|
20
|
+
let link = a.attr('href');
|
|
21
|
+
link = new URL(link, host).href;
|
|
22
|
+
return {
|
|
23
|
+
title: a.text().trim(),
|
|
24
|
+
link,
|
|
25
|
+
pubDate: parseDate(e.find('.date').text().trim()),
|
|
26
|
+
};
|
|
27
|
+
})
|
|
28
|
+
.get();
|
|
29
|
+
|
|
30
|
+
item = await Promise.all(
|
|
31
|
+
item.map((item) =>
|
|
32
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
33
|
+
try {
|
|
34
|
+
const response = await got(item.link);
|
|
35
|
+
const $ = cheerio.load(response.data);
|
|
36
|
+
|
|
37
|
+
item.title = $('h3').text();
|
|
38
|
+
item.author =
|
|
39
|
+
$('.pr')
|
|
40
|
+
.text()
|
|
41
|
+
.trim()
|
|
42
|
+
.match(/作者:(.*)/)[1] || '山东大学软件学院';
|
|
43
|
+
$('h3, .pr').remove();
|
|
44
|
+
item.description = $('.content').html();
|
|
45
|
+
|
|
46
|
+
return item;
|
|
47
|
+
} catch (e) {
|
|
48
|
+
// intranet oa.sdu.edu.cn
|
|
49
|
+
return item;
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
ctx.state.data = {
|
|
56
|
+
title: `山东大学软件学院${typelist[type]}`,
|
|
57
|
+
description: $('title').text(),
|
|
58
|
+
link,
|
|
59
|
+
item,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const data = require('../data').wh.jwc;
|
|
4
|
+
const extractor = require('../extractor');
|
|
5
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
6
|
+
const timezone = require('@/utils/timezone');
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const column = ctx.params.column ?? 'gztz';
|
|
10
|
+
const baseUrl = data.url;
|
|
11
|
+
const response = await got(baseUrl + data.columns[column].url);
|
|
12
|
+
const $ = cheerio.load(response.data);
|
|
13
|
+
const items = $('.articleul li');
|
|
14
|
+
const out = await Promise.all(
|
|
15
|
+
items.map(async (index, item) => {
|
|
16
|
+
item = $(item);
|
|
17
|
+
const anchor = item.find('a');
|
|
18
|
+
const dateElement = item.find('div:last-of-type');
|
|
19
|
+
const dateText = dateElement.text();
|
|
20
|
+
dateElement.remove();
|
|
21
|
+
const href = anchor.attr('href');
|
|
22
|
+
const link = href.startsWith('http') ? href : baseUrl + href;
|
|
23
|
+
const title = item.text();
|
|
24
|
+
const { description, author: exactAuthor, exactDate } = await ctx.cache.tryGet(link, async () => await extractor(link, ctx));
|
|
25
|
+
const author = exactAuthor ?? '教务处';
|
|
26
|
+
const pubDate = exactDate ?? timezone(parseDate(dateText.slice(1, dateText.length - 1), 'YYYY-MM-DD'), +8);
|
|
27
|
+
return {
|
|
28
|
+
title,
|
|
29
|
+
link,
|
|
30
|
+
description,
|
|
31
|
+
pubDate,
|
|
32
|
+
author,
|
|
33
|
+
};
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
ctx.state.data = {
|
|
38
|
+
title: `${data.name} ${data.columns[column].name}`,
|
|
39
|
+
link: baseUrl + data.columns[column].url,
|
|
40
|
+
item: out,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const data = require('../data').wh.news;
|
|
4
|
+
const extractor = require('../extractor');
|
|
5
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const column = ctx.params.column ?? 'xyyw';
|
|
9
|
+
const baseUrl = data.url;
|
|
10
|
+
const response = await got(baseUrl + data.columns[column].url);
|
|
11
|
+
const $ = cheerio.load(response.data);
|
|
12
|
+
const items = $('.n_newslist li');
|
|
13
|
+
const out = await Promise.all(
|
|
14
|
+
items.map(async (index, item) => {
|
|
15
|
+
item = $(item);
|
|
16
|
+
const anchor = item.find('a');
|
|
17
|
+
const title = anchor.attr('title');
|
|
18
|
+
const href = anchor.attr('href');
|
|
19
|
+
const link = href.startsWith('http') ? href : baseUrl + href;
|
|
20
|
+
const { description, author, exactDate } = await ctx.cache.tryGet(link, async () => await extractor(link, ctx));
|
|
21
|
+
const span = item.find('span');
|
|
22
|
+
const pubDate = exactDate ?? parseDate(span.text(), 'YYYY/MM/DD');
|
|
23
|
+
return {
|
|
24
|
+
title,
|
|
25
|
+
link,
|
|
26
|
+
description,
|
|
27
|
+
pubDate,
|
|
28
|
+
author,
|
|
29
|
+
};
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
ctx.state.data = {
|
|
34
|
+
title: `${data.name} ${data.columns[column].name}`,
|
|
35
|
+
link: baseUrl + data.columns[column].url,
|
|
36
|
+
item: out,
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const buildData = require('@/utils/common-config');
|
|
2
|
+
|
|
3
|
+
module.exports = async (ctx) => {
|
|
4
|
+
const link = 'https://stratechery.com/';
|
|
5
|
+
|
|
6
|
+
ctx.state.data = await buildData({
|
|
7
|
+
link,
|
|
8
|
+
url: link,
|
|
9
|
+
title: 'Stratechery by Ben Thompson',
|
|
10
|
+
author: 'Ben Thompson',
|
|
11
|
+
description: 'Stratechery provides analysis of the strategy and business side of technology and media, and the impact of technology on society. ',
|
|
12
|
+
item: {
|
|
13
|
+
item: 'article',
|
|
14
|
+
title: `$('article > header > h1 > a').text()`,
|
|
15
|
+
link: `$('article > header > h1 > a').attr('href')`,
|
|
16
|
+
pubDate: `parseDate($('article .entry-date').attr('datetime'))`,
|
|
17
|
+
description: `$('article > .entry-content').html().replace(/%/g, '%')`,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
4
|
|
|
4
5
|
module.exports = async (ctx) => {
|
|
5
6
|
const id = ctx.params.id;
|
|
@@ -31,7 +32,7 @@ module.exports = async (ctx) => {
|
|
|
31
32
|
item: list.map((item) => ({
|
|
32
33
|
title: item.version_label,
|
|
33
34
|
description: item.whatsnew.text,
|
|
34
|
-
pubDate:
|
|
35
|
+
pubDate: parseDate(item.update_date),
|
|
35
36
|
link: url,
|
|
36
37
|
guid: item.version_label,
|
|
37
38
|
})),
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'taptap.com': {
|
|
3
|
+
_name: 'TapTap',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '游戏论坛',
|
|
7
|
+
docs: 'https://docs.rsshub.app/game.html#taptap',
|
|
8
|
+
source: ['/app/:id/topic', '/app/:id'],
|
|
9
|
+
target: '/taptap/topic/:id',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '游戏更新',
|
|
13
|
+
docs: 'https://docs.rsshub.app/game.html#taptap',
|
|
14
|
+
source: ['/app/:id'],
|
|
15
|
+
target: '/taptap/changelog/:id',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '游戏评价',
|
|
19
|
+
docs: 'https://docs.rsshub.app/game.html#taptap',
|
|
20
|
+
source: ['/app/:id/review', '/app/:id'],
|
|
21
|
+
target: '/taptap/review/:id',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { rootUrl, X_UA } = require('./utils');
|
|
4
|
+
|
|
5
|
+
const sortMap = {
|
|
6
|
+
default: {
|
|
7
|
+
zh_CN: '预设',
|
|
8
|
+
zh_TW: '預設',
|
|
9
|
+
},
|
|
10
|
+
new: {
|
|
11
|
+
zh_CN: '最新',
|
|
12
|
+
zh_TW: '最新',
|
|
13
|
+
},
|
|
14
|
+
hot: {
|
|
15
|
+
zh_CN: '热门',
|
|
16
|
+
zh_TW: '熱門',
|
|
17
|
+
},
|
|
18
|
+
spent: {
|
|
19
|
+
zh_CN: '游戏时长',
|
|
20
|
+
zh_TW: '遊戲時長',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
module.exports = async (ctx) => {
|
|
25
|
+
const id = ctx.params.id;
|
|
26
|
+
const order = ctx.params.order ?? 'default';
|
|
27
|
+
const lang = ctx.params.lang ?? 'zh_CN';
|
|
28
|
+
|
|
29
|
+
let url = `${rootUrl}/webapiv2/review/v2/by-app?app_id=${id}&limit=10`;
|
|
30
|
+
let sortParam;
|
|
31
|
+
if (order === 'new' || order === 'hot' || order === 'spent') {
|
|
32
|
+
sortParam = `sort=${order}`;
|
|
33
|
+
url += `&${sortParam}`;
|
|
34
|
+
}
|
|
35
|
+
url += `&${X_UA(lang)}`;
|
|
36
|
+
|
|
37
|
+
const reviews_list_response = await got(url);
|
|
38
|
+
const reviews_list = reviews_list_response.data;
|
|
39
|
+
|
|
40
|
+
const app_img = reviews_list.data.list[0].moment.app.icon.url;
|
|
41
|
+
const app_name = reviews_list.data.list[0].moment.app.title;
|
|
42
|
+
|
|
43
|
+
const items = reviews_list.data.list.map((review) => {
|
|
44
|
+
const author = review.moment.author.user.name;
|
|
45
|
+
const score = review.moment.extended_entities.reviews[0].score;
|
|
46
|
+
return {
|
|
47
|
+
title: `${author} - ${score}星`,
|
|
48
|
+
author,
|
|
49
|
+
description: review.moment.extended_entities.reviews[0].contents.text,
|
|
50
|
+
link: `${rootUrl}/review/${review.moment.extended_entities.reviews[0].id}`,
|
|
51
|
+
pubDate: parseDate(review.moment.extended_entities.reviews[0].created_time * 1000),
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
ctx.state.data = {
|
|
56
|
+
title: `TapTap 评价 ${app_name} - ${sortMap[order][lang]}排序`,
|
|
57
|
+
link: `${rootUrl}/app/${id}/review${sortParam ? `?${sortParam}` : ''}`,
|
|
58
|
+
image: app_img,
|
|
59
|
+
item: items,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
ctx.state.json = {
|
|
63
|
+
title: `TapTap 评价 ${app_name} - ${sortMap[order][lang]}排序`,
|
|
64
|
+
link: `${rootUrl}/app/${id}/review${sortParam ? `?${sortParam}` : ''}`,
|
|
65
|
+
image: app_img,
|
|
66
|
+
item: items,
|
|
67
|
+
reviews_list,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { rootUrl, X_UA, appId2GroupId, textPost, videoPost } = require('./utils');
|
|
4
|
+
|
|
5
|
+
const typeMap = {
|
|
6
|
+
feed: {
|
|
7
|
+
zh_CN: '最新',
|
|
8
|
+
zh_TW: '最新',
|
|
9
|
+
},
|
|
10
|
+
official: {
|
|
11
|
+
zh_CN: '官方',
|
|
12
|
+
zh_TW: '官方',
|
|
13
|
+
},
|
|
14
|
+
elite: {
|
|
15
|
+
zh_CN: '精华',
|
|
16
|
+
zh_TW: '精華',
|
|
17
|
+
},
|
|
18
|
+
video: {
|
|
19
|
+
zh_CN: '影片',
|
|
20
|
+
zh_TW: '影片',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
module.exports = async (ctx) => {
|
|
25
|
+
const lang = ctx.params.lang ?? 'zh_CN';
|
|
26
|
+
const appId = ctx.params.id;
|
|
27
|
+
const groupId = await appId2GroupId(appId, lang);
|
|
28
|
+
const type = ctx.params.type ?? 'feed';
|
|
29
|
+
const sort = ctx.params.sort ?? 'created';
|
|
30
|
+
|
|
31
|
+
const url = `${rootUrl}/webapiv2/feed/v6/by-group?group_id=${groupId}&type=${type}&sort=${sort}&${X_UA(lang)}`;
|
|
32
|
+
|
|
33
|
+
const topics_list_response = await got(url);
|
|
34
|
+
const topics_list = topics_list_response.data;
|
|
35
|
+
|
|
36
|
+
const app_img = topics_list.data.list[0].moment.app.icon.url;
|
|
37
|
+
const app_name = topics_list.data.list[0].moment.app.title;
|
|
38
|
+
|
|
39
|
+
const out = topics_list.data.list.map(async (list) => {
|
|
40
|
+
const author = list.moment.author.user.name;
|
|
41
|
+
const topicId = list.moment.extended_entities?.topics?.[0].id;
|
|
42
|
+
// raw_text sometimes is "" so || is better than ??
|
|
43
|
+
const title = list.moment.contents.raw_text || list.moment.extended_entities?.topics?.[0].title || list.moment.extended_entities?.videos?.[0].title;
|
|
44
|
+
const createdTime = list.moment.created_time * 1000;
|
|
45
|
+
const link = list.moment.sharing?.url || list.moment.extended_entities?.topics?.[0].sharing.url || list.moment.extended_entities?.videos?.[0].sharing.url;
|
|
46
|
+
let description = '';
|
|
47
|
+
try {
|
|
48
|
+
description = await textPost(appId, topicId, lang);
|
|
49
|
+
} catch (e) {
|
|
50
|
+
// fallback if 400 bad request
|
|
51
|
+
description = list.moment.extended_entities?.topics?.[0].summary || list.moment.contents.raw_text || videoPost(list.moment.extended_entities?.videos?.[0]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
title,
|
|
56
|
+
description,
|
|
57
|
+
author,
|
|
58
|
+
link,
|
|
59
|
+
pubDate: parseDate(createdTime),
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
ctx.state.data = {
|
|
64
|
+
title: `${app_name} - ${typeMap[type][lang]} - TapTap 论坛`,
|
|
65
|
+
link: `${rootUrl}/app/${appId}/topic?type=${type}&sort=${sort}`,
|
|
66
|
+
image: app_img,
|
|
67
|
+
item: out.filter((item) => item !== ''),
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
ctx.state.json = {
|
|
71
|
+
title: `${app_name} - ${typeMap[type][lang]} - TapTap 论坛`,
|
|
72
|
+
link: `${rootUrl}/app/${appId}/topic?type=${type}&sort=${sort}`,
|
|
73
|
+
image: app_img,
|
|
74
|
+
item: out.filter((item) => item !== ''),
|
|
75
|
+
appId,
|
|
76
|
+
groupId,
|
|
77
|
+
topics_list,
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
|
|
6
|
+
const rootUrl = 'https://www.taptap.com';
|
|
7
|
+
// Please do not change %26 to &
|
|
8
|
+
const X_UA = (lang = 'zh_CN') => `X-UA=V=1%26PN=WebApp%26VN=0.1.0%26LANG=${lang}%26PLT=PC`;
|
|
9
|
+
|
|
10
|
+
const appId2GroupId = async (appId, lang = 'zh_CN') => {
|
|
11
|
+
const res = await got(`${rootUrl}/webapiv2/group/v1/detail?app_id=${appId}&${X_UA(lang)}`, {
|
|
12
|
+
headers: {
|
|
13
|
+
Referer: `${rootUrl}/app/${appId}`,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
return res.data.data.group.id;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const textPost = async (appId, topicId, lang = 'zh_CN') => {
|
|
20
|
+
const res = await got(`${rootUrl}/webapiv2/topic/v1/detail?id=${topicId}&${X_UA(lang)}`, {
|
|
21
|
+
headers: {
|
|
22
|
+
Referer: `${rootUrl}/app/${appId}`,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const $ = cheerio.load(res.data.data.first_post.contents.text, null, false);
|
|
26
|
+
$('img').each((_, e) => {
|
|
27
|
+
e = $(e);
|
|
28
|
+
e.attr('src', e.attr('data-origin-url'));
|
|
29
|
+
e.attr('referrerpolicy', 'no-referrer');
|
|
30
|
+
e.removeAttr('data-origin-url');
|
|
31
|
+
});
|
|
32
|
+
return $.html();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const videoPost = (video) =>
|
|
36
|
+
art(path.join(__dirname, 'templates/videoPost.art'), {
|
|
37
|
+
intro: video?.intro?.text,
|
|
38
|
+
videoUrl: video?.url,
|
|
39
|
+
posterUrl: video?.raw_cover.url,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
module.exports = {
|
|
43
|
+
rootUrl,
|
|
44
|
+
X_UA,
|
|
45
|
+
appId2GroupId,
|
|
46
|
+
textPost,
|
|
47
|
+
videoPost,
|
|
48
|
+
};
|