rsshub 1.0.0-master.fe69819 → 1.0.0-master.fee75c6
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/radar-rules.js +0 -162
- package/lib/router.js +82 -83
- package/lib/routes/dsndsht23/index.js +2 -1
- package/lib/routes/ehentai/ehapi.js +16 -6
- package/lib/routes/ehentai/favorites.js +14 -7
- package/lib/routes/ehentai/search.js +14 -5
- package/lib/routes/ehentai/tag.js +14 -5
- package/lib/routes/mofish/index.js +21 -9
- package/lib/routes/mofish/templates/description.art +4 -0
- package/lib/routes/or/index.js +1 -1
- package/lib/routes/prestige-av/series.js +3 -6
- package/lib/routes/tencent/wechat/tgchannel.js +84 -29
- package/lib/routes/weibo/timeline.js +18 -1
- package/lib/routes/weibo/user.js +19 -3
- package/lib/routes/weibo/utils.js +113 -5
- package/lib/routes/zhihu/hot.js +3 -2
- package/lib/v2/36kr/maintainer.js +7 -0
- package/lib/{routes → v2}/36kr/motif.js +2 -1
- package/lib/v2/36kr/news.js +56 -0
- package/lib/{routes → v2}/36kr/newsflashes.js +2 -1
- package/lib/v2/36kr/radar.js +37 -0
- package/lib/v2/36kr/router.js +7 -0
- package/lib/{routes → v2}/36kr/search/article.js +3 -2
- package/lib/{routes → v2}/36kr/user.js +2 -1
- package/lib/v2/52hrtt/index.js +57 -0
- package/lib/v2/52hrtt/maintainer.js +4 -0
- package/lib/v2/52hrtt/radar.js +19 -0
- package/lib/v2/52hrtt/router.js +4 -0
- package/lib/v2/52hrtt/symposium.js +57 -0
- package/lib/v2/8kcos/article.js +24 -0
- package/lib/v2/8kcos/cat.js +22 -0
- package/lib/{routes → v2}/8kcos/const.js +0 -0
- package/lib/v2/8kcos/latest.js +23 -0
- package/lib/v2/8kcos/maintainer.js +5 -0
- package/lib/v2/8kcos/radar.js +25 -0
- package/lib/v2/8kcos/router.js +5 -0
- package/lib/v2/8kcos/tag.js +23 -0
- package/lib/{routes → v2}/95mm/category.js +5 -3
- package/lib/v2/95mm/maintainer.js +5 -0
- package/lib/v2/95mm/radar.js +25 -0
- package/lib/v2/95mm/router.js +5 -0
- package/lib/v2/95mm/tab.js +9 -0
- package/lib/v2/95mm/tag.js +9 -0
- package/lib/v2/95mm/templates/description.art +3 -0
- package/lib/v2/95mm/utils.js +59 -0
- package/lib/v2/abskoop/index.js +52 -0
- package/lib/v2/abskoop/maintainer.js +3 -0
- package/lib/v2/abskoop/radar.js +13 -0
- package/lib/v2/abskoop/router.js +3 -0
- package/lib/v2/abskoop/templates/description.art +3 -0
- package/lib/v2/apple/exchange_repair.js +40 -0
- package/lib/v2/apple/maintainer.js +3 -0
- package/lib/v2/apple/radar.js +13 -0
- package/lib/v2/apple/router.js +3 -0
- package/lib/{routes/apple → v2}/appstore/gofans.js +3 -3
- package/lib/{routes/apple → v2}/appstore/in-app-purchase.js +0 -0
- package/lib/v2/appstore/maintainer.js +7 -0
- package/lib/{routes/apple → v2}/appstore/price.js +0 -0
- package/lib/v2/appstore/radar.js +41 -0
- package/lib/v2/appstore/router.js +7 -0
- package/lib/{routes/apple → v2}/appstore/update.js +0 -0
- package/lib/{routes/apple → v2}/appstore/xianmian.js +3 -2
- package/lib/{routes/universities → v2}/bjfu/grs.js +0 -0
- package/lib/v2/bjfu/it/index.js +49 -0
- package/lib/v2/bjfu/it/utils.js +64 -0
- package/lib/{routes/universities → v2}/bjfu/jwc/index.js +0 -0
- package/lib/{routes/universities → v2}/bjfu/jwc/utils.js +10 -9
- package/lib/{routes/universities → v2}/bjfu/kjc.js +0 -0
- package/lib/v2/bjfu/maintainer.js +7 -0
- package/lib/{routes/universities → v2}/bjfu/news/index.js +0 -0
- package/lib/{routes/universities → v2}/bjfu/news/utils.js +10 -9
- package/lib/v2/bjfu/radar.js +45 -0
- package/lib/v2/bjfu/router.js +7 -0
- package/lib/v2/dahecube/index.js +66 -0
- package/lib/v2/dahecube/maintainer.js +3 -0
- package/lib/v2/dahecube/radar.js +23 -0
- package/lib/v2/dahecube/router.js +3 -0
- package/lib/v2/dahecube/utils.js +47 -0
- package/lib/v2/dhu/jiaowu/news.js +37 -0
- package/lib/v2/dhu/maintainer.js +4 -0
- package/lib/v2/dhu/radar.js +17 -0
- package/lib/v2/dhu/router.js +4 -0
- package/lib/v2/dhu/xxgk/news.js +32 -0
- package/lib/v2/douban/people/wish.js +2 -1
- package/lib/{routes → v2}/dtcj/datahero.js +3 -2
- package/lib/v2/dtcj/datainsight.js +53 -0
- package/lib/v2/dtcj/maintainer.js +4 -0
- package/lib/v2/dtcj/radar.js +25 -0
- package/lib/v2/dtcj/router.js +4 -0
- package/lib/v2/eastday/24.js +90 -0
- package/lib/v2/eastday/maintainer.js +2 -0
- package/lib/v2/eastday/radar.js +16 -0
- package/lib/v2/eastday/router.js +2 -0
- package/lib/{routes → v2}/eastday/sh.js +6 -11
- package/lib/v2/eastmoney/radar.js +13 -0
- package/lib/v2/eastmoney/router.js +3 -0
- package/lib/v2/eastmoney/ttjj/user.js +65 -0
- package/lib/v2/ems/apple.js +42 -0
- package/lib/v2/ems/maintainer.js +4 -0
- package/lib/{routes → v2}/ems/news.js +0 -0
- package/lib/v2/ems/radar.js +19 -0
- package/lib/v2/ems/router.js +4 -0
- package/lib/v2/ems/templates/apple.art +6 -0
- package/lib/{routes → v2}/flyert/creditcard.js +0 -0
- package/lib/v2/flyert/maintainer.js +4 -0
- package/lib/{routes → v2}/flyert/preferential.js +0 -0
- package/lib/v2/flyert/radar.js +19 -0
- package/lib/v2/flyert/router.js +4 -0
- package/lib/{routes → v2}/flyert/utils.js +2 -1
- package/lib/v2/hdu/cs/index.js +57 -0
- package/lib/v2/hdu/maintainer.js +3 -0
- package/lib/v2/hdu/radar.js +13 -0
- package/lib/v2/hdu/router.js +4 -0
- package/lib/v2/hellobtc/information.js +51 -0
- package/lib/v2/hellobtc/kepu.js +64 -0
- package/lib/v2/hellobtc/maintainer.js +6 -0
- package/lib/v2/hellobtc/news.js +29 -0
- package/lib/v2/hellobtc/radar.js +85 -0
- package/lib/v2/hellobtc/router.js +6 -0
- package/lib/v2/hellobtc/topic.js +43 -0
- package/lib/v2/ielts/index.js +58 -0
- package/lib/v2/ielts/maintainer.js +3 -0
- package/lib/v2/ielts/radar.js +13 -0
- package/lib/v2/ielts/router.js +3 -0
- package/lib/{routes → v2}/javbus/genre.js +0 -0
- package/lib/{routes → v2}/javbus/home.js +0 -0
- package/lib/v2/javbus/label.js +7 -0
- package/lib/v2/javbus/maintainer.js +16 -0
- package/lib/v2/javbus/radar.js +99 -0
- package/lib/v2/javbus/router.js +16 -0
- package/lib/{routes → v2}/javbus/series.js +0 -0
- package/lib/{routes → v2}/javbus/star.js +0 -0
- package/lib/v2/javbus/studio.js +7 -0
- package/lib/{routes → v2}/javbus/uncensored/genre.js +0 -0
- package/lib/{routes → v2}/javbus/uncensored/home.js +0 -0
- package/lib/{routes → v2}/javbus/uncensored/series.js +0 -0
- package/lib/{routes → v2}/javbus/uncensored/star.js +0 -0
- package/lib/{routes → v2}/javbus/util.js +5 -9
- package/lib/{routes → v2}/javbus/western/genre.js +0 -0
- package/lib/{routes → v2}/javbus/western/home.js +0 -0
- package/lib/{routes → v2}/javbus/western/series.js +0 -0
- package/lib/{routes → v2}/javbus/western/star.js +0 -0
- package/lib/v2/javlibrary/utils.js +1 -1
- package/lib/v2/kbs/maintainer.js +4 -0
- package/lib/v2/kbs/news.js +67 -0
- package/lib/v2/kbs/radar.js +19 -0
- package/lib/v2/kbs/router.js +4 -0
- package/lib/{routes → v2}/kbs/today.js +1 -1
- package/lib/v2/lofter/maintainer.js +4 -0
- package/lib/v2/lofter/radar.js +17 -0
- package/lib/v2/lofter/router.js +4 -0
- package/lib/{routes → v2}/lofter/tag.js +4 -4
- package/lib/v2/lofter/user.js +52 -0
- package/lib/v2/lvv2/maintainer.js +4 -0
- package/lib/v2/lvv2/news.js +75 -0
- package/lib/v2/lvv2/radar.js +79 -0
- package/lib/v2/lvv2/router.js +4 -0
- package/lib/v2/lvv2/templates/outlink.art +1 -0
- package/lib/v2/lvv2/top.js +77 -0
- package/lib/v2/nbd/article.js +50 -0
- package/lib/{routes → v2}/nbd/index.js +8 -5
- package/lib/v2/nbd/maintainer.js +4 -0
- package/lib/v2/nbd/radar.js +19 -0
- package/lib/v2/nbd/router.js +4 -0
- package/lib/v2/njnu/ceai/ceai.js +44 -0
- package/lib/v2/njnu/ceai/utils.js +55 -0
- package/lib/v2/njnu/jwc/jwc.js +43 -0
- package/lib/v2/njnu/jwc/utils.js +59 -0
- package/lib/v2/njnu/maintainer.js +4 -0
- package/lib/v2/njnu/radar.js +21 -0
- package/lib/v2/njnu/router.js +4 -0
- package/lib/v2/nltimes/maintainer.js +3 -0
- package/lib/v2/nltimes/news.js +89 -0
- package/lib/v2/nltimes/radar.js +19 -0
- package/lib/v2/nltimes/router.js +3 -0
- package/lib/{routes → v2}/nowcoder/discuss.js +17 -22
- package/lib/v2/nowcoder/experience.js +48 -0
- package/lib/{routes → v2}/nowcoder/jobcenter.js +0 -0
- package/lib/v2/nowcoder/maintainer.js +7 -0
- package/lib/v2/nowcoder/radar.js +40 -0
- package/lib/{routes → v2}/nowcoder/recommend.js +1 -1
- package/lib/v2/nowcoder/router.js +7 -0
- package/lib/{routes → v2}/nowcoder/schedule.js +4 -3
- package/lib/v2/odaily/post.js +10 -8
- package/lib/v2/oilchem/index.js +67 -0
- package/lib/v2/oilchem/maintainer.js +3 -0
- package/lib/v2/oilchem/radar.js +11 -0
- package/lib/v2/oilchem/router.js +3 -0
- package/lib/v2/oilchem/routes.js +671 -0
- package/lib/v2/picuki/maintainer.js +3 -0
- package/lib/v2/picuki/profile.js +167 -0
- package/lib/v2/picuki/radar.js +13 -0
- package/lib/v2/picuki/router.js +3 -0
- package/lib/v2/picuki/templates/post.art +7 -0
- package/lib/v2/qq88/index.js +60 -0
- package/lib/v2/qq88/maintainer.js +3 -0
- package/lib/v2/qq88/radar.js +13 -0
- package/lib/v2/qq88/router.js +3 -0
- package/lib/v2/readhub/index.js +106 -0
- package/lib/v2/readhub/maintainer.js +3 -0
- package/lib/v2/readhub/radar.js +13 -0
- package/lib/v2/readhub/router.js +6 -0
- package/lib/v2/shmeea/maintainer.js +1 -0
- package/lib/v2/shmeea/radar.js +6 -0
- package/lib/v2/shmeea/router.js +2 -1
- package/lib/v2/shmeea/self-study.js +61 -0
- package/lib/{routes/universities/sysu/sdcs.js → v2/sysu/cse.js} +3 -3
- package/lib/v2/sysu/maintainer.js +3 -0
- package/lib/v2/sysu/radar.js +13 -0
- package/lib/v2/sysu/router.js +3 -0
- package/lib/v2/telegram/channel.js +446 -112
- package/lib/v2/telegram/maintainer.js +1 -1
- package/lib/v2/telegram/router.js +1 -1
- package/lib/v2/telegram/templates/video.art +3 -1
- package/lib/v2/tencent/maintainer.js +3 -0
- package/lib/v2/tencent/qq/sdk/changelog.js +56 -0
- package/lib/v2/tencent/radar.js +56 -0
- package/lib/v2/tencent/router.js +3 -0
- package/lib/v2/tokeninsight/blog.js +52 -0
- package/lib/v2/tokeninsight/bulletin.js +44 -0
- package/lib/v2/tokeninsight/maintainer.js +5 -0
- package/lib/v2/tokeninsight/radar.js +25 -0
- package/lib/v2/tokeninsight/report.js +52 -0
- package/lib/v2/tokeninsight/router.js +5 -0
- package/lib/v2/txrjy/fornumtopic.js +72 -0
- package/lib/v2/txrjy/maintainer.js +3 -0
- package/lib/v2/txrjy/radar.js +17 -0
- package/lib/v2/txrjy/router.js +3 -0
- package/lib/v2/txrjy/templates/fornumtopic.art +6 -0
- package/lib/v2/wfu/jwc.js +54 -0
- package/lib/v2/wfu/maintainer.js +4 -0
- package/lib/v2/wfu/news.js +96 -0
- package/lib/v2/wfu/radar.js +21 -0
- package/lib/v2/wfu/router.js +4 -0
- package/lib/v2/who/maintainer.js +5 -0
- package/lib/v2/who/news-room.js +76 -0
- package/lib/{routes → v2}/who/news.js +1 -1
- package/lib/v2/who/radar.js +25 -0
- package/lib/v2/who/router.js +5 -0
- package/lib/{routes → v2}/who/speeches.js +0 -0
- package/lib/v2/wikinews/index.js +43 -0
- package/lib/v2/wikinews/maintainer.js +3 -0
- package/lib/v2/wikinews/radar.js +13 -0
- package/lib/v2/wikinews/router.js +4 -0
- package/lib/{routes → v2}/wsj/index.js +6 -4
- package/lib/v2/wsj/maintainer.js +3 -0
- package/lib/v2/wsj/radar.js +21 -0
- package/lib/v2/wsj/router.js +3 -0
- package/lib/v2/xiaoyuzhou/maintainer.js +1 -1
- package/lib/v2/xiaoyuzhou/podcast.js +1 -1
- package/lib/v2/xmanhua/index.js +74 -0
- package/lib/v2/xmanhua/radar.js +13 -0
- package/lib/v2/xmanhua/router.js +3 -0
- package/lib/{routes → v2}/zhibo8/forum.js +8 -16
- package/lib/v2/zhibo8/maintainer.js +5 -0
- package/lib/v2/zhibo8/more.js +82 -0
- package/lib/{routes → v2}/zhibo8/post.js +1 -1
- package/lib/v2/zhibo8/radar.js +27 -0
- package/lib/v2/zhibo8/router.js +5 -0
- package/package.json +10 -9
- package/lib/routes/36kr/news.js +0 -94
- package/lib/routes/8kcos/article.js +0 -17
- package/lib/routes/8kcos/cat.js +0 -28
- package/lib/routes/8kcos/latest.js +0 -27
- package/lib/routes/95mm/tab.js +0 -9
- package/lib/routes/95mm/tag.js +0 -7
- package/lib/routes/95mm/utils.js +0 -51
- package/lib/routes/apple/exchange_repair.js +0 -47
- package/lib/routes/eastmoney/user.js +0 -30
- package/lib/routes/lofter/posts.js +0 -54
- package/lib/routes/nbd/article.js +0 -60
- package/lib/routes/picuki/profile.js +0 -90
- package/lib/routes/readhub/category.js +0 -102
- package/lib/routes/who/news-room.js +0 -56
- package/lib/routes/zhibo8/more.js +0 -45
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = function (router) {
|
|
2
|
-
router.get('/channel/:username/:
|
|
2
|
+
router.get('/channel/:username/:routeParams?', require('./channel'));
|
|
3
3
|
router.get('/stickerpack/:name', require('./stickerpack'));
|
|
4
4
|
router.get('/blog', require('./blog'));
|
|
5
5
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
{{ if source }}
|
|
2
2
|
<video src="{{ source }}" controls="controls" poster="{{ poster }}" style="width: 100%"></video>
|
|
3
|
+
{{ else if poster }}
|
|
4
|
+
<blockquote><b>Video is too big</b><br><img src="{{ poster }}"></blockquote>
|
|
3
5
|
{{ else }}
|
|
4
|
-
<b>
|
|
6
|
+
<blockquote><b>Video is too big</b></blockquote>
|
|
5
7
|
{{ /if }}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const platform = ctx.params.platform;
|
|
6
|
+
|
|
7
|
+
let title = '';
|
|
8
|
+
let link = '';
|
|
9
|
+
if (platform === 'iOS') {
|
|
10
|
+
title = 'iOS SDK 历史变更';
|
|
11
|
+
link = 'https://wiki.connect.qq.com/ios_sdk历史变更';
|
|
12
|
+
} else if (platform === 'Android') {
|
|
13
|
+
title = 'Android SDK 历史变更';
|
|
14
|
+
link = 'https://wiki.connect.qq.com/android_sdk历史变更';
|
|
15
|
+
} else {
|
|
16
|
+
throw Error('not support platform');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const response = await got.get(link);
|
|
20
|
+
|
|
21
|
+
const $ = cheerio.load(response.data);
|
|
22
|
+
|
|
23
|
+
// 获取主要文本,并且过滤空行
|
|
24
|
+
const contents = $('.wp-editor')
|
|
25
|
+
.children('p')
|
|
26
|
+
.filter((_, element) => $(element).text() !== '');
|
|
27
|
+
|
|
28
|
+
const pList = [];
|
|
29
|
+
const titleIndex = [];
|
|
30
|
+
|
|
31
|
+
// 遍历文本 p 标签,并且获取标题索引
|
|
32
|
+
contents.each((index, element) => {
|
|
33
|
+
if ($(element).find('strong').length) {
|
|
34
|
+
titleIndex.push(index);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
pList.push($(element).text().replace('\n', ''));
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// 用标题索引切割数组
|
|
41
|
+
const changelogs = titleIndex.map((_, index) => {
|
|
42
|
+
const section = pList.slice(titleIndex[index], titleIndex[index + 1]);
|
|
43
|
+
const changelog = {
|
|
44
|
+
title: section[0],
|
|
45
|
+
description: section.slice(1).join('\n'),
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return changelog;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
ctx.state.data = {
|
|
52
|
+
title,
|
|
53
|
+
link,
|
|
54
|
+
item: changelogs,
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'qq.com': {
|
|
3
|
+
_name: '腾讯',
|
|
4
|
+
'mp.weixin': [
|
|
5
|
+
{
|
|
6
|
+
title: '微信公众号栏目',
|
|
7
|
+
docs: 'https://docs.rsshub.app/new-media.html#gong-zhong-hao-lan-mu-fei-tui-song-li-shi-xiao-xi',
|
|
8
|
+
source: '/mp/homepage',
|
|
9
|
+
target: (params, url) => `/wechat/mp/homepage/${new URL(url).searchParams.get('__biz')}/${new URL(url).searchParams.get('hid')}/${new URL(url).searchParams.get('cid') ? new URL(url).searchParams.get('cid') : ''}`,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '微信公众号话题',
|
|
13
|
+
docs: 'https://docs.rsshub.app/new-media.html#wei-xin-gong-zhong-hao-wen-zhang-hua-ti-tag',
|
|
14
|
+
source: '/mp/appmsgalbum',
|
|
15
|
+
target: (params, url) => `/wechat/mp/msgalbum/${new URL(url).searchParams.get('__biz')}/${new URL(url).searchParams.get('album_id')}`,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
egame: [
|
|
19
|
+
{
|
|
20
|
+
title: '企鹅电竞直播间',
|
|
21
|
+
docs: 'https://docs.rsshub.app/live.html#qi-e-dian-jing-zhi-bo-jian-kai-bo',
|
|
22
|
+
source: '/:id',
|
|
23
|
+
target: (params) => {
|
|
24
|
+
if (params.id.match(/^\d+$/)) {
|
|
25
|
+
return '/egameqq/room/:id';
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
v: [
|
|
31
|
+
{
|
|
32
|
+
title: '视频 - 播放列表',
|
|
33
|
+
docs: 'https://docs.rsshub.app/multimedia.html#teng-xun-shi-pin',
|
|
34
|
+
source: '/x/cover/:id',
|
|
35
|
+
target: (params) => {
|
|
36
|
+
const id = params.id.match('(.*).html')[1];
|
|
37
|
+
return id ? `/tencentvideo/playlist/${id}` : '';
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
title: '视频 - 播放列表',
|
|
42
|
+
docs: 'https://docs.rsshub.app/multimedia.html#teng-xun-shi-pin',
|
|
43
|
+
source: '/x/cover/:id/:detail',
|
|
44
|
+
target: '/tencentvideo/playlist/:id',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
'wiki.connect': [
|
|
48
|
+
{
|
|
49
|
+
title: 'QQ 互联 SDK 更新日志',
|
|
50
|
+
docs: 'https://docs.rsshub.app/program-update.html#qq-hu-lian-sdk',
|
|
51
|
+
source: '/',
|
|
52
|
+
target: (_params, url) => `/tencent/qq/sdk/changelog/${new URL(url).pathname === '/ios_sdk历史变更' ? 'iOS' : 'Android'}`,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const baseURL = 'https://www.tokeninsight.com/';
|
|
5
|
+
const title = 'TokenInsight';
|
|
6
|
+
const link = 'https://www.tokeninsight.com/';
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const lang = ctx.params.lang ?? 'zh';
|
|
10
|
+
|
|
11
|
+
const getBlogs = async () => {
|
|
12
|
+
const url = `${baseURL}api/user/search/getAllList`;
|
|
13
|
+
const response = (
|
|
14
|
+
await got.post(url, {
|
|
15
|
+
form: {
|
|
16
|
+
isRecommend: 2,
|
|
17
|
+
language: lang === 'zh' ? 'cn' : lang,
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
).data;
|
|
21
|
+
return response.data.blogsList;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getBlogInfomation = async (blog) => {
|
|
25
|
+
const { publishDate, title, id } = blog;
|
|
26
|
+
const blogUrl = `${baseURL}${lang}/blogs/${id}`;
|
|
27
|
+
const description = await ctx.cache.tryGet(blogUrl, async () => {
|
|
28
|
+
const res = await got(blogUrl);
|
|
29
|
+
const $ = cheerio.load(res.data);
|
|
30
|
+
const description = $('.detail_html_box').html();
|
|
31
|
+
return description;
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
// 文章标题
|
|
35
|
+
title,
|
|
36
|
+
// 文章正文
|
|
37
|
+
description,
|
|
38
|
+
// 文章发布时间
|
|
39
|
+
pubDate: parseDate(publishDate),
|
|
40
|
+
// 文章链接
|
|
41
|
+
link: blogUrl,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 30;
|
|
45
|
+
const blogs = (await getBlogs()).slice(0, limit);
|
|
46
|
+
const list = await Promise.all(blogs.map(getBlogInfomation));
|
|
47
|
+
ctx.state.data = {
|
|
48
|
+
title: `${lang === 'zh' ? '博客' : 'Blogs'} | ${title}`,
|
|
49
|
+
link: `${link}${lang}/blogs`,
|
|
50
|
+
item: list,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const baseURL = 'https://www.tokeninsight.com/';
|
|
5
|
+
const title = 'TokenInsight';
|
|
6
|
+
const link = 'https://www.tokeninsight.com/';
|
|
7
|
+
const get_articles = async () => {
|
|
8
|
+
const url = `${baseURL}api/bulletin/selectBulletinList`;
|
|
9
|
+
const response = (await got.get(url)).data;
|
|
10
|
+
const { data } = response;
|
|
11
|
+
return data;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = async (ctx) => {
|
|
15
|
+
const lang = ctx.params.lang ?? 'zh';
|
|
16
|
+
|
|
17
|
+
const get_article_info = async (article) => {
|
|
18
|
+
const { updateDate, titleEn, id, title } = article;
|
|
19
|
+
const articleUrl = `${baseURL}${lang}/latest/${id}`;
|
|
20
|
+
const description = await ctx.cache.tryGet(articleUrl, async () => {
|
|
21
|
+
const res = await got(articleUrl);
|
|
22
|
+
const $ = cheerio.load(res.data);
|
|
23
|
+
return $('.detail_html_box').html();
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
// 文章标题
|
|
27
|
+
title: lang === 'zh' ? title : titleEn,
|
|
28
|
+
// 文章正文
|
|
29
|
+
description,
|
|
30
|
+
// 文章发布时间
|
|
31
|
+
pubDate: parseDate(updateDate),
|
|
32
|
+
// 文章链接
|
|
33
|
+
link: articleUrl,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const articles = await get_articles();
|
|
38
|
+
const list = await Promise.all(articles.map(get_article_info));
|
|
39
|
+
ctx.state.data = {
|
|
40
|
+
title: `${lang === 'zh' ? '快讯' : 'Latest'} | ${title}`,
|
|
41
|
+
link: `${link}${lang}/latest`,
|
|
42
|
+
item: list,
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'tokeninsight.com': {
|
|
3
|
+
_name: 'TokenInsight',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '博客',
|
|
7
|
+
docs: 'https://docs.rsshub.app/new-media.html#tokeninsight',
|
|
8
|
+
source: ['/:lang/blogs'],
|
|
9
|
+
target: '/tokeninsight/blog/:lang',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '快讯',
|
|
13
|
+
docs: 'https://docs.rsshub.app/new-media.html#tokeninsight',
|
|
14
|
+
source: ['/:lang/latest'],
|
|
15
|
+
target: '/tokeninsight/bulletin/:lang',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '报告',
|
|
19
|
+
docs: 'https://docs.rsshub.app/new-media.html#tokeninsight',
|
|
20
|
+
source: ['/:lang/report'],
|
|
21
|
+
target: '/tokeninsight/report/:lang',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const baseURL = 'https://www.tokeninsight.com/';
|
|
5
|
+
const title = 'TokenInsight';
|
|
6
|
+
const link = 'https://www.tokeninsight.com/';
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const lang = ctx.params.lang ?? 'zh';
|
|
10
|
+
|
|
11
|
+
const getReports = async () => {
|
|
12
|
+
const url = `${baseURL}api/user/search/getAllList`;
|
|
13
|
+
const response = (
|
|
14
|
+
await got.post(url, {
|
|
15
|
+
form: {
|
|
16
|
+
isRecommend: 2,
|
|
17
|
+
language: lang === 'zh' ? 'cn' : lang,
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
).data;
|
|
21
|
+
return response.data.reportList;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getReportInfomation = async (report) => {
|
|
25
|
+
const { publishDate, title, id } = report;
|
|
26
|
+
const reportUrl = `${baseURL}${lang}/report/${id}`;
|
|
27
|
+
const description = await ctx.cache.tryGet(reportUrl, async () => {
|
|
28
|
+
const res = await got(reportUrl);
|
|
29
|
+
const $ = cheerio.load(res.data);
|
|
30
|
+
const description = $('.detail_html_box').html();
|
|
31
|
+
return description;
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
// 文章标题
|
|
35
|
+
title,
|
|
36
|
+
// 文章正文
|
|
37
|
+
description,
|
|
38
|
+
// 文章发布时间
|
|
39
|
+
pubDate: parseDate(publishDate),
|
|
40
|
+
// 文章链接
|
|
41
|
+
link: reportUrl,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const limit = ctx.query.limit ? parseInt(ctx.query.limit) : 30;
|
|
45
|
+
const reports = (await getReports()).slice(0, limit);
|
|
46
|
+
const list = await Promise.all(reports.map(getReportInfomation));
|
|
47
|
+
ctx.state.data = {
|
|
48
|
+
title: `${lang === 'zh' ? '报告' : 'Research'} | ${title}`,
|
|
49
|
+
link: `${link}${lang}/report`,
|
|
50
|
+
item: list,
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const iconv = require('iconv-lite');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
const timezone = require('@/utils/timezone');
|
|
6
|
+
const { art } = require('@/utils/render');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
9
|
+
const rootUrl = 'https://www.txrjy.com';
|
|
10
|
+
|
|
11
|
+
module.exports = async (ctx) => {
|
|
12
|
+
const channel = ctx.params.channel ?? '1';
|
|
13
|
+
const url = `${rootUrl}/c114-listnewtopic.php?typeid=${channel}`;
|
|
14
|
+
|
|
15
|
+
const response = await got(url, {
|
|
16
|
+
responseType: 'buffer',
|
|
17
|
+
});
|
|
18
|
+
const $ = cheerio.load(iconv.decode(response.data, 'gbk'));
|
|
19
|
+
const title = $('div.z > a').last().text();
|
|
20
|
+
const list = $('tbody > tr')
|
|
21
|
+
.slice(0, 25)
|
|
22
|
+
.map((_, item) => ({
|
|
23
|
+
title: $(item).find('td.title2').text(),
|
|
24
|
+
link: new URL($(item).find('td.title2 > a').attr('href'), rootUrl).href,
|
|
25
|
+
author: $(item).find('td.author').text(),
|
|
26
|
+
pubDate: timezone(parseDate($(item).find('td.dateline').text(), 'YYYY-M-D HH:mm'), +8),
|
|
27
|
+
category: $(item).find('td.forum').text(),
|
|
28
|
+
}))
|
|
29
|
+
.filter((_, item) => item.title)
|
|
30
|
+
.get();
|
|
31
|
+
|
|
32
|
+
const items = await Promise.all(
|
|
33
|
+
list.map((item) =>
|
|
34
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
35
|
+
const detailResponse = await got(item.link, {
|
|
36
|
+
responseType: 'buffer',
|
|
37
|
+
});
|
|
38
|
+
const content = cheerio.load(iconv.decode(detailResponse.data, 'gbk'));
|
|
39
|
+
|
|
40
|
+
item.description = content('div.c_table')
|
|
41
|
+
.map((_, item) =>
|
|
42
|
+
art(path.join(__dirname, 'templates/fornumtopic.art'), {
|
|
43
|
+
content: content(item)
|
|
44
|
+
.find('td.t_f')
|
|
45
|
+
.find('div.a_pr')
|
|
46
|
+
.remove()
|
|
47
|
+
.end()
|
|
48
|
+
.html()
|
|
49
|
+
?.replace(/(<img.*?) src=".*?"(.*?>)/g, '$1$2')
|
|
50
|
+
.replace(/(<img.*?)zoomfile(.*?>)/g, '$1src$2'),
|
|
51
|
+
pattl: content(item)
|
|
52
|
+
.find('div.pattl')
|
|
53
|
+
.html()
|
|
54
|
+
?.replace(/(<img.*?) src=".*?"(.*?>)/g, '$1$2')
|
|
55
|
+
.replace(/(<img.*?)zoomfile(.*?>)/g, '$1src$2'),
|
|
56
|
+
author: content(item).find('a.xw1').text().trim(),
|
|
57
|
+
})
|
|
58
|
+
)
|
|
59
|
+
.get()
|
|
60
|
+
.join('\n');
|
|
61
|
+
|
|
62
|
+
return item;
|
|
63
|
+
})
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
ctx.state.data = {
|
|
68
|
+
title: `通信人家园 - 论坛 ${title}`,
|
|
69
|
+
link: url,
|
|
70
|
+
item: items,
|
|
71
|
+
};
|
|
72
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'txrjy.com': {
|
|
3
|
+
_name: '通信人家园',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '论坛 频道',
|
|
7
|
+
docs: 'https://docs.rsshub.app/bbs.html#tong-xin-ren-jia-yuan',
|
|
8
|
+
source: ['/c114-listnewtopic.php'],
|
|
9
|
+
target: (params, url) => {
|
|
10
|
+
const channel = new URL(url).searchParams.get('typeid');
|
|
11
|
+
|
|
12
|
+
return `/txrjy/fornumtopic/${channel ? channel : ''}`;
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
|
|
4
|
+
// 参考 whu/news 武汉大学页面写成
|
|
5
|
+
|
|
6
|
+
const baseUrl = 'https://jwc.wfu.edu.cn/3742/list.htm';
|
|
7
|
+
const sizeTitle = '潍坊学院教务处新闻';
|
|
8
|
+
|
|
9
|
+
module.exports = async (ctx) => {
|
|
10
|
+
const response = await got({
|
|
11
|
+
method: 'get',
|
|
12
|
+
url: baseUrl,
|
|
13
|
+
headers: {
|
|
14
|
+
Referer: 'https://jwc.wfu.edu.cn/',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
const $ = cheerio.load(response.data);
|
|
18
|
+
|
|
19
|
+
// 获取当前页面的 list
|
|
20
|
+
const list = $('ul.wp_article_list>li');
|
|
21
|
+
|
|
22
|
+
const result = await Promise.all(
|
|
23
|
+
// 遍历每一篇文章
|
|
24
|
+
list
|
|
25
|
+
.map((item) => {
|
|
26
|
+
const $ = cheerio.load(list[item]); // 将列表项加载成 html
|
|
27
|
+
const $article_title = $('div.pr_fields>span.Article_Title>a');
|
|
28
|
+
const $item_url = 'https://jwc.wfu.edu.cn/' + $article_title.attr('href'); // 获取 每一项的url
|
|
29
|
+
const $title = $article_title.text(); // 获取每个的标题
|
|
30
|
+
const $description = $('div.pr_fields>span.Article_Title').html();
|
|
31
|
+
|
|
32
|
+
// 列表上提取到的信息
|
|
33
|
+
// 教务处通知为文件,直接提供下载链接
|
|
34
|
+
// 标题 链接
|
|
35
|
+
const single = {
|
|
36
|
+
title: $title,
|
|
37
|
+
link: $item_url,
|
|
38
|
+
guid: $item_url,
|
|
39
|
+
description: $description,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// 合并解析后的结果集作为该篇文章最终的输出结果
|
|
43
|
+
return single;
|
|
44
|
+
})
|
|
45
|
+
.get()
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
ctx.state.data = {
|
|
49
|
+
title: sizeTitle,
|
|
50
|
+
link: baseUrl,
|
|
51
|
+
description: '潍坊学院教务处通知(通知为文件需下载)',
|
|
52
|
+
item: result,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
// 参考 whu/news 武汉大学页面写成
|
|
7
|
+
|
|
8
|
+
const baseUrl = 'https://www.wfu.edu.cn';
|
|
9
|
+
const sizeTitle = '--潍坊学院新闻';
|
|
10
|
+
|
|
11
|
+
const catrgoryMap = {
|
|
12
|
+
wyyw: ['/50/list.htm', '潍院要闻'],
|
|
13
|
+
zhxw: ['/52/list.htm', '综合新闻'],
|
|
14
|
+
xszh: ['/xszh/list.htm', '学术纵横'],
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// 专门定义一个function用于加载文章内容
|
|
18
|
+
async function load(link) {
|
|
19
|
+
let description = '';
|
|
20
|
+
|
|
21
|
+
let response;
|
|
22
|
+
// 如果不是 大学的站点, 直接返回简单的标题即可
|
|
23
|
+
// 判断 是否外站链接,如果是 则直接返回页面 不做单独的解析
|
|
24
|
+
const https_reg = new RegExp('https://www.wfu.edu.cn(.*)');
|
|
25
|
+
if (!https_reg.test(link)) {
|
|
26
|
+
return { description };
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
// 异步请求文章
|
|
30
|
+
response = await got.get(link);
|
|
31
|
+
} catch (err) {
|
|
32
|
+
// 如果网络问题 直接出错
|
|
33
|
+
if (err.name && (err.name === 'HTTPError' || err.name === 'RequestError')) {
|
|
34
|
+
description = 'Page 404 Please Check!';
|
|
35
|
+
}
|
|
36
|
+
return { description };
|
|
37
|
+
}
|
|
38
|
+
// 加载文章内容
|
|
39
|
+
const $ = cheerio.load(response.data);
|
|
40
|
+
|
|
41
|
+
// 提取文章内容
|
|
42
|
+
description = $('div.wp_articlecontent').html();
|
|
43
|
+
// 返回解析的结果
|
|
44
|
+
return { description };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
module.exports = async (ctx) => {
|
|
48
|
+
// 默认 潍院要闻 然后获取列表页面
|
|
49
|
+
const type = ctx.params.type ?? 'wyyw';
|
|
50
|
+
const listPageUrl = baseUrl + catrgoryMap[type][0];
|
|
51
|
+
const response = await got({
|
|
52
|
+
method: 'get',
|
|
53
|
+
url: listPageUrl,
|
|
54
|
+
headers: {
|
|
55
|
+
Referer: baseUrl,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const $ = cheerio.load(response.data);
|
|
59
|
+
|
|
60
|
+
// 获取当前页面的 list
|
|
61
|
+
const list = $('div[frag=窗口1]>ul>li');
|
|
62
|
+
|
|
63
|
+
const result = await Promise.all(
|
|
64
|
+
// 遍历每一篇文章
|
|
65
|
+
list
|
|
66
|
+
.map(async (item) => {
|
|
67
|
+
const $ = cheerio.load(list[item]); // 将列表项加载成 html
|
|
68
|
+
const $item_url = 'https://www.wfu.edu.cn' + $('a').attr('href'); // 获取 每一项的url
|
|
69
|
+
const $title = $('a>div.txt>h1').text(); // 获取每个的标题
|
|
70
|
+
const $pubdate = timezone(parseDate($('a>div.txt>span.date').text().split(':')[1]), +8); // 获取发布时间
|
|
71
|
+
|
|
72
|
+
// 列表上提取到的信息
|
|
73
|
+
// 标题 链接
|
|
74
|
+
const single = {
|
|
75
|
+
title: $title,
|
|
76
|
+
pubDate: $pubdate,
|
|
77
|
+
link: $item_url,
|
|
78
|
+
guid: $item_url,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// 对于列表的每一项, 单独获取 时间与详细内容
|
|
82
|
+
// eslint-disable-next-line no-return-await
|
|
83
|
+
const other = await ctx.cache.tryGet($item_url, async () => await load($item_url));
|
|
84
|
+
// 合并解析后的结果集作为该篇文章最终的输出结果
|
|
85
|
+
return { ...single, ...other };
|
|
86
|
+
})
|
|
87
|
+
.get()
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
ctx.state.data = {
|
|
91
|
+
title: catrgoryMap[type][1] + sizeTitle,
|
|
92
|
+
link: baseUrl,
|
|
93
|
+
description: catrgoryMap[type][1] + sizeTitle,
|
|
94
|
+
item: result,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'wfu.edu.cn': {
|
|
3
|
+
_name: '潍坊学院',
|
|
4
|
+
jwc: [
|
|
5
|
+
{
|
|
6
|
+
title: '教务处通知',
|
|
7
|
+
docs: 'https://docs.rsshub.app/university.html#wei-fang-xue-yuan',
|
|
8
|
+
source: '/',
|
|
9
|
+
target: '/wfu/jwc',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
news: [
|
|
13
|
+
{
|
|
14
|
+
title: '新闻',
|
|
15
|
+
docs: 'https://docs.rsshub.app/university.html#wei-fang-xue-yuan',
|
|
16
|
+
source: '/',
|
|
17
|
+
target: '/wfu/news',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|