rsshub 1.0.0-master.fc5a2f6 → 1.0.0-master.fc648b5
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/config.js +4 -0
- package/lib/middleware/anti-hotlink.js +90 -22
- package/lib/middleware/parameter.js +65 -32
- package/lib/middleware/templates/iframe.art +14 -0
- package/lib/radar-rules.js +0 -92
- package/lib/router.js +22 -22
- package/lib/routes/agefans/update.js +1 -1
- package/lib/routes/novel/biqugeinfo.js +2 -2
- package/lib/routes/universities/uestc/sice.js +12 -33
- package/lib/routes/weibo/user.js +10 -19
- package/lib/v2/19lou/index.js +74 -0
- package/lib/v2/19lou/maintainer.js +3 -0
- package/lib/v2/19lou/radar.js +29 -0
- package/lib/v2/19lou/router.js +3 -0
- package/lib/v2/36kr/router.js +1 -1
- package/lib/v2/36kr/user.js +47 -22
- package/lib/v2/acfun/article.js +100 -0
- package/lib/{routes → v2}/acfun/bangumi.js +7 -7
- package/lib/v2/acfun/maintainer.js +5 -0
- package/lib/v2/acfun/radar.js +25 -0
- package/lib/v2/acfun/router.js +5 -0
- package/lib/v2/acfun/video.js +45 -0
- package/lib/v2/agora0/index.js +54 -0
- package/lib/v2/agora0/maintainer.js +3 -0
- package/lib/v2/agora0/radar.js +13 -0
- package/lib/v2/agora0/router.js +3 -0
- package/lib/v2/apnews/maintainer.js +3 -0
- package/lib/v2/apnews/radar.js +13 -0
- package/lib/v2/apnews/router.js +3 -0
- package/lib/v2/apnews/templates/description.art +14 -0
- package/lib/v2/apnews/topics.js +44 -0
- package/lib/v2/appleinsider/index.js +59 -0
- package/lib/v2/appleinsider/maintainer.js +3 -0
- package/lib/v2/appleinsider/radar.js +13 -0
- package/lib/v2/appleinsider/router.js +3 -0
- package/lib/v2/cbnweek/index.js +46 -0
- package/lib/v2/cbnweek/maintainer.js +3 -0
- package/lib/v2/cbnweek/radar.js +13 -0
- package/lib/v2/cbnweek/router.js +3 -0
- package/lib/v2/ccac/news.js +12 -3
- package/lib/v2/cde/index.js +2 -2
- package/lib/v2/cde/maintainer.js +1 -0
- package/lib/v2/cde/radar.js +22 -4
- package/lib/v2/cde/router.js +1 -0
- package/lib/v2/cde/templates/xxgk/breakthroughCure.art +18 -0
- package/lib/v2/cde/templates/xxgk/cliniCal.art +16 -0
- package/lib/v2/cde/templates/xxgk/priorityApproval.art +18 -0
- package/lib/v2/cde/utils.js +2 -2
- package/lib/v2/cde/xxgk.js +73 -0
- package/lib/v2/chinadegrees/maintainer.js +3 -0
- package/lib/v2/chinadegrees/province.js +66 -0
- package/lib/v2/chinadegrees/radar.js +13 -0
- package/lib/v2/chinadegrees/router.js +3 -0
- package/lib/v2/chinadegrees/templates/description.art +4 -0
- package/lib/v2/cnjxol/index.js +94 -0
- package/lib/v2/cnjxol/maintainer.js +4 -0
- package/lib/v2/cnjxol/radar.js +19 -0
- package/lib/v2/cnjxol/router.js +3 -0
- package/lib/v2/cnjxol/templates/description.art +2 -0
- package/lib/v2/cscse/maintainer.js +3 -0
- package/lib/v2/cscse/radar.js +13 -0
- package/lib/v2/cscse/router.js +3 -0
- package/lib/v2/cscse/tzgg.js +54 -0
- package/lib/v2/dgjyw/index.js +67 -0
- package/lib/v2/dgjyw/maintainer.js +3 -0
- package/lib/v2/dgjyw/radar.js +13 -0
- package/lib/v2/dgjyw/router.js +3 -0
- package/lib/v2/domp4/detail.js +67 -0
- package/lib/v2/domp4/latest.js +31 -0
- package/lib/v2/domp4/maintainer.js +4 -0
- package/lib/v2/domp4/radar.js +25 -0
- package/lib/v2/domp4/router.js +4 -0
- package/lib/v2/domp4/utils.js +72 -0
- package/lib/v2/douyin/hashtag.js +5 -43
- package/lib/v2/douyin/live.js +68 -0
- package/lib/v2/douyin/maintainer.js +2 -0
- package/lib/v2/douyin/radar.js +8 -0
- package/lib/v2/douyin/router.js +1 -0
- package/lib/v2/douyin/user.js +5 -43
- package/lib/v2/douyin/utils.js +50 -0
- package/lib/v2/economist/full.js +6 -4
- package/lib/v2/elsevier/issue.js +62 -0
- package/lib/v2/elsevier/journal.js +72 -0
- package/lib/v2/elsevier/maintainer.js +2 -2
- package/lib/v2/elsevier/radar.js +5 -5
- package/lib/v2/elsevier/router.js +4 -2
- package/lib/v2/elsevier/templates/description.art +5 -5
- package/lib/v2/gov/beijing/jw/tzgg.js +58 -0
- package/lib/v2/gov/customs/list.js +21 -17
- package/lib/v2/gov/customs/utils.js +9 -5
- package/lib/v2/gov/maintainer.js +3 -0
- package/lib/v2/gov/nmpa/generic.js +76 -0
- package/lib/v2/gov/pbc/goutongjiaoliu.js +20 -15
- package/lib/v2/gov/pbc/tradeAnnouncement.js +18 -14
- package/lib/v2/gov/radar.js +57 -27
- package/lib/v2/gov/router.js +3 -0
- package/lib/v2/gov/xuzhou/hrss.js +54 -0
- package/lib/v2/hackertalk/index.js +23 -0
- package/lib/v2/hackertalk/maintainer.js +3 -0
- package/lib/v2/hackertalk/radar.js +13 -0
- package/lib/v2/hackertalk/router.js +3 -0
- package/lib/v2/hashnode/blog.js +62 -0
- package/lib/v2/hashnode/maintainer.js +3 -0
- package/lib/v2/hashnode/radar.js +13 -0
- package/lib/v2/hashnode/router.js +3 -0
- package/lib/v2/hashnode/templates/description.art +2 -0
- package/lib/v2/hdu/cs/{index.js → notice.js} +1 -4
- package/lib/v2/hdu/cs/pg.js +54 -0
- package/lib/v2/hdu/maintainer.js +1 -0
- package/lib/v2/hdu/radar.js +6 -0
- package/lib/v2/hdu/router.js +2 -1
- package/lib/v2/heu/gx/list.js +2 -2
- package/lib/v2/heu/job/list.js +2 -2
- package/lib/v2/heu/uae/list.js +2 -2
- package/lib/v2/heu/yjsy/list.js +2 -2
- package/lib/v2/hk01/channel.js +40 -0
- package/lib/{routes → v2}/hk01/hot.js +2 -1
- package/lib/v2/hk01/issue.js +41 -0
- package/lib/v2/hk01/maintainer.js +7 -0
- package/lib/v2/hk01/radar.js +37 -0
- package/lib/v2/hk01/router.js +7 -0
- package/lib/{routes → v2}/hk01/tag.js +2 -1
- package/lib/{routes → v2}/hk01/zone.js +3 -2
- package/lib/v2/hotukdeals/index.js +1 -1
- package/lib/v2/ieee/journal.js +78 -0
- package/lib/v2/ieee/maintainer.js +2 -2
- package/lib/v2/ieee/radar.js +4 -4
- package/lib/v2/ieee/{latestdate.js → recent.js} +34 -42
- package/lib/v2/ieee/router.js +4 -2
- package/lib/v2/ieee/templates/description.art +5 -5
- package/lib/v2/ielts/index.js +7 -2
- package/lib/v2/keep/maintainer.js +3 -0
- package/lib/v2/keep/radar.js +13 -0
- package/lib/v2/keep/router.js +3 -0
- package/lib/v2/keep/templates/user.art +16 -0
- package/lib/{routes → v2}/keep/user.js +14 -4
- package/lib/v2/mdpi/journal.js +65 -0
- package/lib/v2/mdpi/maintainer.js +3 -0
- package/lib/v2/mdpi/radar.js +13 -0
- package/lib/v2/mdpi/router.js +3 -0
- package/lib/v2/mdpi/templates/description.art +12 -0
- package/lib/v2/mindmeister/example.js +44 -0
- package/lib/v2/mindmeister/maintainer.js +3 -0
- package/lib/v2/mindmeister/radar.js +13 -0
- package/lib/v2/mindmeister/router.js +3 -0
- package/lib/v2/mindmeister/templates/image.art +1 -0
- package/lib/v2/mirror/index.js +34 -0
- package/lib/v2/mirror/maintainer.js +3 -0
- package/lib/v2/mirror/radar.js +17 -0
- package/lib/v2/mirror/router.js +3 -0
- package/lib/v2/nbd/radar.js +2 -2
- package/lib/v2/ncwu/maintainer.js +3 -0
- package/lib/v2/ncwu/notice.js +27 -0
- package/lib/v2/ncwu/radar.js +13 -0
- package/lib/v2/ncwu/router.js +3 -0
- package/lib/v2/netease/exclusive.js +148 -0
- package/lib/v2/netease/maintainer.js +1 -0
- package/lib/v2/netease/radar.js +8 -0
- package/lib/v2/netease/router.js +1 -0
- package/lib/v2/netease/templates/exclusive.art +11 -0
- package/lib/v2/nju/rczp.js +34 -24
- package/lib/v2/njust/utils.js +4 -0
- package/lib/v2/nuaa/utils/pypasswaf.js +4 -5
- package/lib/v2/nyaa/maintainer.js +4 -0
- package/lib/v2/nyaa/radar.js +32 -0
- package/lib/v2/nyaa/router.js +4 -0
- package/lib/{routes → v2}/nyaa/search.js +4 -2
- package/lib/v2/nytimes/daily_briefing_chinese.js +47 -41
- package/lib/v2/nytimes/index.js +3 -3
- package/lib/v2/nytimes/maintainer.js +1 -1
- package/lib/v2/nytimes/templates/image.art +3 -0
- package/lib/v2/nytimes/utils.js +7 -1
- package/lib/v2/oceanengine/arithmeticIndex.js +145 -0
- package/lib/v2/oceanengine/maintainer.js +3 -0
- package/lib/v2/oceanengine/radar.js +13 -0
- package/lib/v2/oceanengine/router.js +3 -0
- package/lib/v2/oceanengine/templates/content.art +14 -0
- package/lib/v2/openwrt/maintainer.js +3 -0
- package/lib/v2/openwrt/radar.js +13 -0
- package/lib/v2/openwrt/releases.js +25 -0
- package/lib/v2/openwrt/router.js +3 -0
- package/lib/v2/pincong/utils.js +7 -1
- package/lib/v2/pku/maintainer.js +3 -0
- package/lib/v2/pku/radar.js +20 -0
- package/lib/v2/pku/router.js +3 -0
- package/lib/v2/pku/ss/admission.js +53 -0
- package/lib/v2/pku/ss/notice.js +53 -0
- package/lib/v2/pku/ss/pg_admin.js +53 -0
- package/lib/v2/prestige-av/maintainer.js +3 -0
- package/lib/v2/prestige-av/radar.js +18 -0
- package/lib/v2/prestige-av/router.js +3 -0
- package/lib/{routes → v2}/prestige-av/series.js +8 -5
- package/lib/v2/qq/kg/cache.js +28 -0
- package/lib/v2/qq/kg/reply.js +21 -0
- package/lib/v2/qq/kg/user.js +50 -0
- package/lib/v2/qq/maintainer.js +2 -0
- package/lib/v2/qq/radar.js +14 -0
- package/lib/v2/qq/router.js +2 -0
- package/lib/v2/samsung/maintainer.js +3 -0
- package/lib/v2/samsung/radar.js +13 -0
- package/lib/v2/samsung/research/blog.js +49 -0
- package/lib/v2/samsung/router.js +3 -0
- package/lib/v2/{jasa/latest.js → scitation/journal.js} +24 -27
- package/lib/v2/scitation/maintainer.js +4 -0
- package/lib/v2/scitation/radar.js +19 -0
- package/lib/v2/scitation/router.js +4 -0
- package/lib/v2/scitation/section.js +90 -0
- package/lib/v2/scitation/templates/description.art +11 -0
- package/lib/v2/shuiguopai/index.js +76 -0
- package/lib/v2/shuiguopai/maintainer.js +3 -0
- package/lib/v2/shuiguopai/radar.js +13 -0
- package/lib/v2/shuiguopai/router.js +3 -0
- package/lib/v2/shuiguopai/templates/description.art +6 -0
- package/lib/v2/springer/journal.js +72 -0
- package/lib/v2/springer/maintainer.js +3 -0
- package/lib/v2/springer/radar.js +13 -0
- package/lib/v2/springer/router.js +3 -0
- package/lib/v2/springer/templates/description.art +12 -0
- package/lib/v2/supchina/index.js +67 -0
- package/lib/v2/supchina/maintainer.js +4 -0
- package/lib/v2/supchina/podcasts.js +66 -0
- package/lib/v2/supchina/radar.js +19 -0
- package/lib/v2/supchina/router.js +4 -0
- package/lib/v2/techflow520/index.js +34 -0
- package/lib/v2/techflow520/maintainer.js +4 -0
- package/lib/v2/techflow520/newsflash.js +32 -0
- package/lib/v2/techflow520/radar.js +19 -0
- package/lib/v2/techflow520/router.js +4 -0
- package/lib/v2/tencent/cloud/column.js +51 -0
- package/lib/v2/tencent/maintainer.js +1 -0
- package/lib/v2/tencent/radar.js +11 -0
- package/lib/v2/tencent/router.js +1 -0
- package/lib/v2/test/index.js +16 -1
- package/lib/v2/tiktok/user.js +28 -38
- package/lib/v2/trending/allTrending.js +169 -0
- package/lib/v2/trending/maintainer.js +3 -0
- package/lib/v2/trending/radar.js +35 -0
- package/lib/v2/trending/router.js +3 -0
- package/lib/v2/trending/templates/content.art +24 -0
- package/lib/v2/u3c3/index.js +59 -0
- package/lib/v2/u3c3/maintainer.js +3 -0
- package/lib/v2/u3c3/radar.js +29 -0
- package/lib/v2/u3c3/router.js +3 -0
- package/lib/v2/uraaka-joshi/uraaka-joshi-user.js +7 -1
- package/lib/v2/uraaka-joshi/uraaka-joshi.js +8 -1
- package/lib/v2/vlive/index.js +71 -0
- package/lib/v2/vlive/maintainer.js +3 -0
- package/lib/v2/vlive/radar.js +13 -0
- package/lib/v2/vlive/router.js +3 -0
- package/lib/v2/vlive/templates/post.art +8 -0
- package/lib/v2/vlive/templates/video.art +3 -0
- package/lib/v2/xiaohongshu/util.js +6 -6
- package/lib/v2/xjtu/2yuan/news.js +61 -0
- package/lib/v2/xjtu/dean.js +83 -0
- package/lib/{routes/universities → v2}/xjtu/ee.js +5 -5
- package/lib/{routes/universities → v2}/xjtu/gs/tzgg.js +6 -6
- package/lib/v2/xjtu/international.js +51 -0
- package/lib/v2/xjtu/job.js +81 -0
- package/lib/v2/xjtu/maintainer.js +9 -0
- package/lib/v2/xjtu/radar.js +53 -0
- package/lib/v2/xjtu/router.js +9 -0
- package/lib/v2/xjtu/std.js +58 -0
- package/lib/v2/xjtu/templates/attachments.art +3 -0
- package/lib/v2/xjtu/templates/std.art +4 -0
- package/lib/v2/xueqiu/column.js +42 -0
- package/lib/v2/xueqiu/maintainer.js +1 -0
- package/lib/v2/xueqiu/radar.js +6 -0
- package/lib/v2/xueqiu/router.js +1 -0
- package/lib/v2/zhangyoubao/index.js +42 -0
- package/lib/v2/zhangyoubao/maintainer.js +3 -0
- package/lib/v2/zhangyoubao/radar.js +13 -0
- package/lib/v2/zhangyoubao/router.js +3 -0
- package/lib/v2/zhangyoubao/templates/article.art +1 -0
- package/package.json +20 -19
- package/lib/routes/acfun/video.js +0 -44
- package/lib/routes/apnews/topics.js +0 -43
- package/lib/routes/dgjyw/index.js +0 -66
- package/lib/routes/hk01/channel.js +0 -22
- package/lib/routes/hk01/issue.js +0 -22
- package/lib/routes/mirror/entries.js +0 -80
- package/lib/routes/universities/ncwu/notice.js +0 -42
- package/lib/routes/universities/xjtu/dean.js +0 -86
- package/lib/routes/universities/xjtu/international.js +0 -53
- package/lib/routes/universities/xjtu/job.js +0 -50
- package/lib/v2/elsevier/latest.js +0 -87
- package/lib/v2/elsevier/volume.js +0 -75
- package/lib/v2/ieee/latestvol.js +0 -87
- package/lib/v2/jasa/maintainer.js +0 -4
- package/lib/v2/jasa/radar.js +0 -19
- package/lib/v2/jasa/router.js +0 -4
- package/lib/v2/jasa/section.js +0 -95
- package/lib/v2/jasa/templates/description.art +0 -11
package/lib/routes/hk01/issue.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
|
|
3
|
-
module.exports = async (ctx) => {
|
|
4
|
-
const id = ctx.params.id;
|
|
5
|
-
|
|
6
|
-
const response = await got(`https://web-data.api.hk01.com/v2/page/issue/${id}`);
|
|
7
|
-
const data = response.data;
|
|
8
|
-
const list = data.issue.blocks[0].articles;
|
|
9
|
-
|
|
10
|
-
ctx.state.data = {
|
|
11
|
-
title: `香港01 - ${data.issue.title}`,
|
|
12
|
-
description: data.meta.metaDesc,
|
|
13
|
-
link: data.issue.publishUrl,
|
|
14
|
-
item: list.map((item) => ({
|
|
15
|
-
title: item.data.title,
|
|
16
|
-
author: item.data.authors && item.data.authors.map((e) => e.publishName).join(', '),
|
|
17
|
-
description: `<p>${item.data.description}…</p><img style="width: 100%" src="${item.data.mainImage.cdnUrl}" />`,
|
|
18
|
-
pubDate: new Date(item.data.lastModifyTime * 1000),
|
|
19
|
-
link: item.data.canonicalUrl,
|
|
20
|
-
})),
|
|
21
|
-
};
|
|
22
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const id = ctx.params.id;
|
|
6
|
-
let link;
|
|
7
|
-
let subDomain = 0;
|
|
8
|
-
if (id.endsWith('.eth') || id.length === 42 || id.length === 40) {
|
|
9
|
-
link = 'https://mirror.xyz/' + id;
|
|
10
|
-
} else {
|
|
11
|
-
link = 'https://' + id + '.mirror.xyz';
|
|
12
|
-
subDomain = 1;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const response = await got({
|
|
16
|
-
method: 'get',
|
|
17
|
-
url: link,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const data = response.body;
|
|
21
|
-
const $ = cheerio.load(data);
|
|
22
|
-
|
|
23
|
-
const author = $('div#__next > div.GlobalNavigation > div.GlobalNavigationContainer > div > div > div > div > div > a').text();
|
|
24
|
-
|
|
25
|
-
// 标题
|
|
26
|
-
const article = $('h1')
|
|
27
|
-
.map(function () {
|
|
28
|
-
return $(this).text();
|
|
29
|
-
})
|
|
30
|
-
.get();
|
|
31
|
-
|
|
32
|
-
// 地址
|
|
33
|
-
const addr = $('h1')
|
|
34
|
-
.parent()
|
|
35
|
-
.parent()
|
|
36
|
-
.parent()
|
|
37
|
-
.map(function () {
|
|
38
|
-
return $(this).attr('href');
|
|
39
|
-
})
|
|
40
|
-
.get();
|
|
41
|
-
|
|
42
|
-
// 发布日期
|
|
43
|
-
const date = $('div#__next > div > div > div > div > div > div > div > div > div')
|
|
44
|
-
.map(function () {
|
|
45
|
-
return $(this).text();
|
|
46
|
-
})
|
|
47
|
-
.get();
|
|
48
|
-
|
|
49
|
-
// 摘要
|
|
50
|
-
const des = $('h1')
|
|
51
|
-
.parent()
|
|
52
|
-
.parent()
|
|
53
|
-
.parent()
|
|
54
|
-
.parent()
|
|
55
|
-
.next()
|
|
56
|
-
.next()
|
|
57
|
-
.map(function () {
|
|
58
|
-
return $(this).text();
|
|
59
|
-
})
|
|
60
|
-
.get();
|
|
61
|
-
|
|
62
|
-
const items = [];
|
|
63
|
-
article.forEach((item, index) => {
|
|
64
|
-
items.push({
|
|
65
|
-
title: item,
|
|
66
|
-
author,
|
|
67
|
-
description: des[index],
|
|
68
|
-
pubDate: date[index],
|
|
69
|
-
link: subDomain ? link + addr[index] : 'https://mirror.xyz' + addr[index],
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const title = author + ' - Mirror';
|
|
74
|
-
ctx.state.data = {
|
|
75
|
-
title,
|
|
76
|
-
link,
|
|
77
|
-
allowEmpty: true,
|
|
78
|
-
item: items,
|
|
79
|
-
};
|
|
80
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
const date = require('@/utils/date');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const baseUrl = 'https://www5.ncwu.edu.cn/channels/5.html';
|
|
4
|
-
|
|
5
|
-
module.exports = async (ctx) => {
|
|
6
|
-
const htmlCache = await ctx.cache.tryGet(
|
|
7
|
-
baseUrl,
|
|
8
|
-
async () => {
|
|
9
|
-
// 由于学校系统升级,更换为使用 puppeteer 渲染页面获取
|
|
10
|
-
const browser = await require('@/utils/puppeteer')();
|
|
11
|
-
const page = await browser.newPage();
|
|
12
|
-
await page.goto(baseUrl);
|
|
13
|
-
const html = await page.evaluate(
|
|
14
|
-
() =>
|
|
15
|
-
// eslint-disable-next-line no-undef
|
|
16
|
-
document.querySelector('div.news-list').innerHTML
|
|
17
|
-
);
|
|
18
|
-
browser.close();
|
|
19
|
-
|
|
20
|
-
return html;
|
|
21
|
-
},
|
|
22
|
-
60 * 60 * 12
|
|
23
|
-
); // 防止访问频率过高
|
|
24
|
-
|
|
25
|
-
const $ = cheerio.load(htmlCache);
|
|
26
|
-
const list = $('div.news-item');
|
|
27
|
-
|
|
28
|
-
ctx.state.data = {
|
|
29
|
-
title: '华水学校通知',
|
|
30
|
-
link: baseUrl,
|
|
31
|
-
item:
|
|
32
|
-
list &&
|
|
33
|
-
list
|
|
34
|
-
.map((index, item) => ({
|
|
35
|
-
title: `「` + $(item).find('a.dw').text() + `」` + $(item).find('a.dw').next().text(),
|
|
36
|
-
description: $(item).find('div.detail').text(),
|
|
37
|
-
pubDate: date($(item).find('div.month').text() + '-' + $(item).find('div.day').text()),
|
|
38
|
-
link: $(item).find('a.dw').next().attr('href'),
|
|
39
|
-
}))
|
|
40
|
-
.get(),
|
|
41
|
-
};
|
|
42
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const subpath = ctx.params.subpath;
|
|
6
|
-
|
|
7
|
-
const url = `http://dean.xjtu.edu.cn/${subpath.replace(/\.htm/g, '')}.htm`;
|
|
8
|
-
const base = url.split('/').slice(0, -1).join('/');
|
|
9
|
-
|
|
10
|
-
const list_response = await got.get(url);
|
|
11
|
-
const $ = cheerio.load(list_response.data);
|
|
12
|
-
|
|
13
|
-
const subname = $('em.ma-nav a')
|
|
14
|
-
.slice(1)
|
|
15
|
-
.map(function () {
|
|
16
|
-
return $(this).text();
|
|
17
|
-
})
|
|
18
|
-
.get()
|
|
19
|
-
.join(' - ');
|
|
20
|
-
|
|
21
|
-
const list = $('.list_main_content > .list-li').get();
|
|
22
|
-
|
|
23
|
-
const parseContent = (htmlString) => {
|
|
24
|
-
const $ = cheerio.load(htmlString);
|
|
25
|
-
|
|
26
|
-
const info = $('.detail_main_content > h1')
|
|
27
|
-
.contents()
|
|
28
|
-
.filter(function () {
|
|
29
|
-
return this.nodeType === 3;
|
|
30
|
-
})
|
|
31
|
-
.map(function () {
|
|
32
|
-
return $(this).text().trim();
|
|
33
|
-
})
|
|
34
|
-
.get();
|
|
35
|
-
|
|
36
|
-
const content = $('[id^="vsb_content"]');
|
|
37
|
-
$('form > div > ul a').each(function () {
|
|
38
|
-
$(this).appendTo(content);
|
|
39
|
-
$('<br>').appendTo(content);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
author: info[0] || '教务处',
|
|
44
|
-
description: content.html(),
|
|
45
|
-
pubDate: new Date(info[1]),
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const out = await Promise.all(
|
|
50
|
-
list.map(async (item) => {
|
|
51
|
-
const $ = cheerio.load(item);
|
|
52
|
-
|
|
53
|
-
const title = $('a');
|
|
54
|
-
const link = new URL(title.attr('href'), base).href;
|
|
55
|
-
|
|
56
|
-
const cache = await ctx.cache.get(link);
|
|
57
|
-
if (cache) {
|
|
58
|
-
return Promise.resolve(JSON.parse(cache));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const rssitem = {
|
|
62
|
-
title: title.text().trim(),
|
|
63
|
-
link,
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
const response = await got.get(link);
|
|
68
|
-
const result = parseContent(response.data);
|
|
69
|
-
|
|
70
|
-
rssitem.description = result.description;
|
|
71
|
-
rssitem.author = result.author;
|
|
72
|
-
rssitem.pubDate = result.pubDate;
|
|
73
|
-
} catch (err) {
|
|
74
|
-
return Promise.resolve('');
|
|
75
|
-
}
|
|
76
|
-
ctx.cache.set(link, JSON.stringify(rssitem));
|
|
77
|
-
return Promise.resolve(rssitem);
|
|
78
|
-
})
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
ctx.state.data = {
|
|
82
|
-
title: `西安交大教务处 - ${subname}`,
|
|
83
|
-
link: url,
|
|
84
|
-
item: out.filter((item) => item !== ''),
|
|
85
|
-
};
|
|
86
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const subpath = ctx.params.subpath;
|
|
6
|
-
const base = 'http://international.xjtu.edu.cn';
|
|
7
|
-
|
|
8
|
-
const url = `${base}/${subpath.split('.')[0]}.htm`;
|
|
9
|
-
const resp = await got({
|
|
10
|
-
method: 'get',
|
|
11
|
-
url,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const $ = cheerio.load(resp.data);
|
|
15
|
-
const name = $('div.pageTitle').text();
|
|
16
|
-
const list = $('.news-list-a > .c').get();
|
|
17
|
-
|
|
18
|
-
const item = await Promise.all(
|
|
19
|
-
list.map(async (item) => {
|
|
20
|
-
const $ = cheerio.load(item);
|
|
21
|
-
const title = $('p.list-tit');
|
|
22
|
-
const pubDate = $('p.list-time');
|
|
23
|
-
const link = new URL($('a').attr('href'), base).href;
|
|
24
|
-
|
|
25
|
-
const cache = await ctx.cache.get(link);
|
|
26
|
-
if (cache) {
|
|
27
|
-
return Promise.resolve(JSON.parse(cache));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const resp = await got.get(link);
|
|
31
|
-
|
|
32
|
-
const $Des = cheerio.load(resp.data);
|
|
33
|
-
const description = $Des('div.ctnCont').html();
|
|
34
|
-
|
|
35
|
-
const rssItem = {
|
|
36
|
-
title: title.text(),
|
|
37
|
-
link,
|
|
38
|
-
pubDate: new Date(pubDate.text()),
|
|
39
|
-
description,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
ctx.cache.set(rssItem, JSON.stringify(rssItem));
|
|
43
|
-
return Promise.resolve(rssItem);
|
|
44
|
-
})
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
ctx.state.data = {
|
|
48
|
-
title: `西安交通大学国际处 - ${name}`,
|
|
49
|
-
link: url,
|
|
50
|
-
description: `西安交通大学国际处 - ${name}`,
|
|
51
|
-
item,
|
|
52
|
-
};
|
|
53
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
module.exports = async (ctx) => {
|
|
7
|
-
const subpath = ctx.params.subpath || 'zxtg';
|
|
8
|
-
const arr = {
|
|
9
|
-
zxtg: '中心通告',
|
|
10
|
-
xdsgwy: '选调生|公务员',
|
|
11
|
-
gjzzsx: '国际组织实习',
|
|
12
|
-
xwzx: '新闻资讯',
|
|
13
|
-
hdyjz: '活动与讲座',
|
|
14
|
-
};
|
|
15
|
-
const rootUrl = `https://job.xjtu.edu.cn/news.do;?ext=${arr[subpath]}`;
|
|
16
|
-
const baseUrl = 'https://job.xjtu.edu.cn';
|
|
17
|
-
|
|
18
|
-
const list_response = await got.get(rootUrl);
|
|
19
|
-
const $ = cheerio.load(list_response.data);
|
|
20
|
-
|
|
21
|
-
const list = $('div.jsnr ul li')
|
|
22
|
-
.slice(0, 10)
|
|
23
|
-
.map((_, item) => {
|
|
24
|
-
item = $(item);
|
|
25
|
-
const a = item.find('a');
|
|
26
|
-
return {
|
|
27
|
-
title: a.find('span').text(),
|
|
28
|
-
link: new URL(a.attr('href'), baseUrl),
|
|
29
|
-
};
|
|
30
|
-
})
|
|
31
|
-
.get();
|
|
32
|
-
|
|
33
|
-
ctx.state.data = {
|
|
34
|
-
title: `西安交通大学就业网-${arr[subpath]}`,
|
|
35
|
-
link: baseUrl,
|
|
36
|
-
item: await Promise.all(
|
|
37
|
-
list.map((item) =>
|
|
38
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
39
|
-
const res = await got.get(item.link);
|
|
40
|
-
const content = cheerio.load(res.data);
|
|
41
|
-
item.description = content('div.jsnr').html();
|
|
42
|
-
const dateStr = content('div.jsnrly span').eq(1).text();
|
|
43
|
-
const date = parseDate(dateStr, 'YYYY MM DD HH mm', 'zh-cn');
|
|
44
|
-
item.pubDate = timezone(date, +8);
|
|
45
|
-
return item;
|
|
46
|
-
})
|
|
47
|
-
)
|
|
48
|
-
),
|
|
49
|
-
};
|
|
50
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const config = require('@/config').value;
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { art } = require('@/utils/render');
|
|
6
|
-
|
|
7
|
-
module.exports = async (ctx) => {
|
|
8
|
-
const host = 'https://www.sciencedirect.com';
|
|
9
|
-
const journal = ctx.params.journal;
|
|
10
|
-
const hostUrl = host.concat('/journal/', journal);
|
|
11
|
-
const resp = await got(host);
|
|
12
|
-
const cookie = resp.headers['set-cookie'].join(' ');
|
|
13
|
-
const headers = {
|
|
14
|
-
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
|
|
15
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
16
|
-
'Accept-Language': 'zh-CN,zh;q=0.9',
|
|
17
|
-
Referer: 'https://id.elsevier.com/',
|
|
18
|
-
Host: host.replace('https://', ''),
|
|
19
|
-
'User-Agent': config.ua,
|
|
20
|
-
cookie,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const preResponse = await got({
|
|
24
|
-
method: 'get',
|
|
25
|
-
url: hostUrl,
|
|
26
|
-
headers,
|
|
27
|
-
});
|
|
28
|
-
const $1 = cheerio.load(preResponse.data);
|
|
29
|
-
const jrnlName = $1('.anchor.js-title-link').text();
|
|
30
|
-
const ltstUrl = host.concat($1('.anchor.js-volume').attr('href'));
|
|
31
|
-
let volume = '';
|
|
32
|
-
if (ltstUrl.match('suppl') !== null) {
|
|
33
|
-
volume = 'Volume ' + ltstUrl.match('vol/(.*)/suppl')[1];
|
|
34
|
-
} else if (ltstUrl.match('issue') !== null) {
|
|
35
|
-
volume = 'Volume ' + ltstUrl.match('vol/(.*)/issue')[1] + ' Issue ' + ltstUrl.match('/issue/(.*)')[1];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const response = await got({
|
|
39
|
-
method: 'get',
|
|
40
|
-
url: ltstUrl,
|
|
41
|
-
headers,
|
|
42
|
-
});
|
|
43
|
-
const $ = cheerio.load(response.data);
|
|
44
|
-
const list = $('.js-article')
|
|
45
|
-
.map((_, item) => {
|
|
46
|
-
const title = $(item).find('.js-article-title').text();
|
|
47
|
-
const authors = $(item).find('.js-article__item__authors').text();
|
|
48
|
-
const link = $(item).find('.article-content-title').attr('href');
|
|
49
|
-
const id = $(item).find('.article-content-title').attr('id');
|
|
50
|
-
return {
|
|
51
|
-
title,
|
|
52
|
-
link,
|
|
53
|
-
id,
|
|
54
|
-
authors,
|
|
55
|
-
volume,
|
|
56
|
-
};
|
|
57
|
-
})
|
|
58
|
-
.get();
|
|
59
|
-
|
|
60
|
-
const renderDesc = (item) =>
|
|
61
|
-
art(path.join(__dirname, 'templates/description.art'), {
|
|
62
|
-
item,
|
|
63
|
-
});
|
|
64
|
-
await Promise.all(
|
|
65
|
-
list.map((item) =>
|
|
66
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
67
|
-
const itemResponse = await got({
|
|
68
|
-
method: 'get',
|
|
69
|
-
url: host.concat('/science/article/pii/', item.id),
|
|
70
|
-
headers,
|
|
71
|
-
});
|
|
72
|
-
const content = cheerio.load(itemResponse.data);
|
|
73
|
-
content('.section-title').remove();
|
|
74
|
-
const doi = content('.doi').attr('href').replace('https://doi.org/', '');
|
|
75
|
-
item.doi = doi;
|
|
76
|
-
item.abstract = content('.abstract.author').html();
|
|
77
|
-
item.description = renderDesc(item);
|
|
78
|
-
return item;
|
|
79
|
-
})
|
|
80
|
-
)
|
|
81
|
-
);
|
|
82
|
-
ctx.state.data = {
|
|
83
|
-
title: jrnlName.concat(' - Latest'),
|
|
84
|
-
link: hostUrl,
|
|
85
|
-
item: list,
|
|
86
|
-
};
|
|
87
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const config = require('@/config').value;
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { art } = require('@/utils/render');
|
|
6
|
-
|
|
7
|
-
module.exports = async (ctx) => {
|
|
8
|
-
const host = 'https://www.sciencedirect.com';
|
|
9
|
-
const journal = ctx.params.journal;
|
|
10
|
-
const volume = 'Volume ' + ctx.params.id.replace('-', ' Issue ');
|
|
11
|
-
const volUrl = 'https://www.sciencedirect.com/journal/' + journal + '/vol/' + ctx.params.id.replace('-', '/issue/');
|
|
12
|
-
const resp = await got(host);
|
|
13
|
-
const cookie = resp.headers['set-cookie'].join(' ');
|
|
14
|
-
const headers = {
|
|
15
|
-
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
|
|
16
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
17
|
-
'Accept-Language': 'zh-CN,zh;q=0.9',
|
|
18
|
-
Referer: 'https://id.elsevier.com/',
|
|
19
|
-
Host: host.replace('https://', ''),
|
|
20
|
-
'User-Agent': config.ua,
|
|
21
|
-
cookie,
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const response = await got({
|
|
25
|
-
method: 'get',
|
|
26
|
-
url: volUrl,
|
|
27
|
-
headers,
|
|
28
|
-
});
|
|
29
|
-
const $ = cheerio.load(response.data);
|
|
30
|
-
const jrnlName = $('.anchor.js-title-link').text();
|
|
31
|
-
const list = $('.js-article')
|
|
32
|
-
.map((_, item) => {
|
|
33
|
-
const title = $(item).find('.js-article-title').text();
|
|
34
|
-
const authors = $(item).find('.js-article__item__authors').text();
|
|
35
|
-
const link = $(item).find('.article-content-title').attr('href');
|
|
36
|
-
const id = $(item).find('.article-content-title').attr('id');
|
|
37
|
-
return {
|
|
38
|
-
title,
|
|
39
|
-
link,
|
|
40
|
-
id,
|
|
41
|
-
authors,
|
|
42
|
-
volume,
|
|
43
|
-
};
|
|
44
|
-
})
|
|
45
|
-
.get();
|
|
46
|
-
|
|
47
|
-
const renderDesc = (item) =>
|
|
48
|
-
art(path.join(__dirname, 'templates/description.art'), {
|
|
49
|
-
item,
|
|
50
|
-
});
|
|
51
|
-
await Promise.all(
|
|
52
|
-
list.map((item) =>
|
|
53
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
54
|
-
const itemResponse = await got({
|
|
55
|
-
method: 'get',
|
|
56
|
-
url: 'https://www.sciencedirect.com/science/article/pii/' + item.id,
|
|
57
|
-
headers,
|
|
58
|
-
});
|
|
59
|
-
const content = cheerio.load(itemResponse.data);
|
|
60
|
-
content('.section-title').remove();
|
|
61
|
-
const doi = content('.doi').attr('href').replace('https://doi.org/', '');
|
|
62
|
-
item.doi = doi;
|
|
63
|
-
item.abstract = content('.abstract.author').html();
|
|
64
|
-
item.description = renderDesc(item);
|
|
65
|
-
return item;
|
|
66
|
-
})
|
|
67
|
-
)
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
ctx.state.data = {
|
|
71
|
-
title: jrnlName.concat(' - ', volume),
|
|
72
|
-
link: volUrl,
|
|
73
|
-
item: list,
|
|
74
|
-
};
|
|
75
|
-
};
|
package/lib/v2/ieee/latestvol.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const config = require('@/config').value;
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const { art } = require('@/utils/render');
|
|
5
|
-
|
|
6
|
-
module.exports = async (ctx) => {
|
|
7
|
-
const host = 'https://ieeexplore.ieee.org';
|
|
8
|
-
const punumber = ctx.params.journal;
|
|
9
|
-
const sortType = ctx.params.sortType ?? 'vol-only-seq';
|
|
10
|
-
const hostUrl = host.concat('/xpl/mostRecentIssue.jsp?punumber=', punumber);
|
|
11
|
-
const headers = {
|
|
12
|
-
Accept: 'application/json, text/plain, */*',
|
|
13
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
14
|
-
'Accept-Language': 'zh-CN,zh;q=0.9',
|
|
15
|
-
Host: host.replace('https://', ''),
|
|
16
|
-
'User-Agent': config.ua,
|
|
17
|
-
Referer: hostUrl,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const resp = await got({
|
|
21
|
-
method: 'get',
|
|
22
|
-
url: host.concat('/rest/publication/home/metadata?pubid=', punumber),
|
|
23
|
-
headers,
|
|
24
|
-
}).json();
|
|
25
|
-
const volume = resp.currentIssue.volume;
|
|
26
|
-
const isnumber = resp.currentIssue.issueNumber;
|
|
27
|
-
const jrnlName = resp.displayTitle;
|
|
28
|
-
|
|
29
|
-
const response = await got({
|
|
30
|
-
method: 'post',
|
|
31
|
-
url: host.concat('/rest/search/pub/', punumber, '/issue/', isnumber, '/toc'),
|
|
32
|
-
headers,
|
|
33
|
-
json: {
|
|
34
|
-
punumber,
|
|
35
|
-
isnumber,
|
|
36
|
-
sortType,
|
|
37
|
-
rowsPerPage: '100',
|
|
38
|
-
},
|
|
39
|
-
}).json();
|
|
40
|
-
const list = response.records.map((item) => {
|
|
41
|
-
const title = item.articleTitle;
|
|
42
|
-
const link = item.htmlLink;
|
|
43
|
-
const doi = item.doi;
|
|
44
|
-
let authors = 'Do not have author';
|
|
45
|
-
if (item.hasOwnProperty('authors')) {
|
|
46
|
-
authors = item.authors.map((itemAuth) => itemAuth.preferredName).join('; ');
|
|
47
|
-
}
|
|
48
|
-
let abstract = '';
|
|
49
|
-
item.hasOwnProperty('abstract') ? (abstract = item.abstract) : (abstract = '');
|
|
50
|
-
return {
|
|
51
|
-
title,
|
|
52
|
-
link,
|
|
53
|
-
authors,
|
|
54
|
-
doi,
|
|
55
|
-
volume,
|
|
56
|
-
abstract,
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const renderDesc = (item) =>
|
|
61
|
-
art(path.join(__dirname, 'templates/description.art'), {
|
|
62
|
-
item,
|
|
63
|
-
});
|
|
64
|
-
await Promise.all(
|
|
65
|
-
list.map((item) =>
|
|
66
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
67
|
-
if (item.abstract !== '') {
|
|
68
|
-
const itemResponse = await got({
|
|
69
|
-
method: 'get',
|
|
70
|
-
url: host.concat(item.link),
|
|
71
|
-
});
|
|
72
|
-
const content = itemResponse.body.match(/metadata=(.*);/)[1];
|
|
73
|
-
const { abstract } = JSON.parse(content);
|
|
74
|
-
item.abstract = abstract;
|
|
75
|
-
item.description = renderDesc(item);
|
|
76
|
-
}
|
|
77
|
-
return item;
|
|
78
|
-
})
|
|
79
|
-
)
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
ctx.state.data = {
|
|
83
|
-
title: jrnlName.concat(' - Latest'),
|
|
84
|
-
link: hostUrl,
|
|
85
|
-
item: list,
|
|
86
|
-
};
|
|
87
|
-
};
|
package/lib/v2/jasa/radar.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
'scitation.org': {
|
|
3
|
-
_name: 'JASA',
|
|
4
|
-
asa: [
|
|
5
|
-
{
|
|
6
|
-
title: 'latest',
|
|
7
|
-
docs: 'https://docs.rsshub.app/journal.html#jasa',
|
|
8
|
-
source: '/*',
|
|
9
|
-
target: '/jasa/latest',
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
title: 'section',
|
|
13
|
-
docs: 'https://docs.rsshub.app/journal.html#jasa',
|
|
14
|
-
source: '/*',
|
|
15
|
-
target: (params, url) => `/jasa/section/${new URL(url).searchParams.get('tocSection')}`,
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
};
|
package/lib/v2/jasa/router.js
DELETED