rsshub 1.0.0-master.e3fa702 → 1.0.0-master.e3ffd5d
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/cache/index.js +3 -0
- package/lib/radar-rules.js +0 -50
- package/lib/router.js +24 -24
- package/lib/routes/nintendo/utils.js +1 -1
- package/lib/routes/sankakucomplex/post.js +1 -4
- package/lib/v2/aicaijing/index.js +73 -0
- package/lib/v2/aicaijing/maintainer.js +6 -0
- package/lib/v2/aicaijing/radar.js +31 -0
- package/lib/v2/aicaijing/router.js +3 -0
- package/lib/v2/aicaijing/templates/description.art +4 -0
- package/lib/v2/appledaily/index.js +7 -11
- package/lib/v2/baidu/maintainer.js +7 -0
- package/lib/v2/baidu/radar.js +52 -0
- package/lib/v2/baidu/router.js +7 -0
- package/lib/v2/baidu/templates/forum.art +1 -0
- package/lib/v2/baidu/templates/post.art +4 -0
- package/lib/v2/baidu/tieba/forum.js +65 -0
- package/lib/{routes → v2/baidu}/tieba/post.js +30 -16
- package/lib/v2/baidu/tieba/user.js +33 -0
- package/lib/v2/bangumi/maintainer.js +1 -0
- package/lib/v2/bangumi/online.js +26 -0
- package/lib/v2/bangumi/radar.js +13 -2
- package/lib/v2/bangumi/router.js +1 -0
- package/lib/v2/bangumi/templates/image.art +1 -0
- package/lib/v2/bilibili/collection.js +34 -0
- package/lib/v2/bilibili/maintainer.js +2 -0
- package/lib/v2/bilibili/radar.js +9 -0
- package/lib/v2/bilibili/router.js +1 -0
- package/lib/v2/china/maintainer.js +4 -0
- package/lib/v2/china/news/highlights/news.js +40 -0
- package/lib/v2/china/news/military/news.js +31 -0
- package/lib/v2/china/radar.js +21 -0
- package/lib/v2/china/router.js +4 -0
- package/lib/v2/csdn/blog.js +39 -0
- package/lib/v2/csdn/maintainer.js +3 -0
- package/lib/v2/csdn/radar.js +13 -0
- package/lib/v2/csdn/router.js +3 -0
- package/lib/v2/csu/cse.js +1 -1
- package/lib/v2/diershoubing/maintainer.js +3 -0
- package/lib/v2/diershoubing/news.js +50 -0
- package/lib/v2/diershoubing/radar.js +13 -0
- package/lib/v2/diershoubing/router.js +3 -0
- package/lib/v2/diershoubing/templates/news.art +9 -0
- package/lib/v2/douyin/live.js +4 -4
- package/lib/v2/douyu/group.js +45 -0
- package/lib/v2/douyu/maintainer.js +5 -0
- package/lib/v2/douyu/post.js +58 -0
- package/lib/v2/douyu/radar.js +27 -0
- package/lib/{routes → v2}/douyu/room.js +0 -0
- package/lib/v2/douyu/router.js +5 -0
- package/lib/v2/douyu/templates/description.art +14 -0
- package/lib/v2/ehentai/ehapi.js +44 -11
- package/lib/v2/ehentai/maintainer.js +3 -3
- package/lib/v2/github/comments.js +4 -5
- package/lib/v2/gocn/jobs.js +23 -0
- package/lib/v2/gocn/maintainer.js +2 -1
- package/lib/v2/gocn/radar.js +6 -0
- package/lib/v2/gocn/router.js +1 -0
- package/lib/v2/gocn/topics.js +7 -12
- package/lib/v2/gocn/util.js +17 -0
- package/lib/v2/gov/cnnic/index.js +54 -0
- package/lib/v2/gov/maintainer.js +2 -0
- package/lib/v2/gov/mofcom/article.js +68 -0
- package/lib/v2/gov/nrta/news.js +0 -1
- package/lib/v2/gov/radar.js +22 -0
- package/lib/v2/gov/router.js +2 -0
- package/lib/v2/hupu/bbs.js +23 -23
- package/lib/v2/huxiu/maintainer.js +1 -0
- package/lib/v2/huxiu/moment.js +40 -0
- package/lib/v2/huxiu/radar.js +6 -0
- package/lib/v2/huxiu/router.js +1 -0
- package/lib/v2/huxiu/templates/moment.art +16 -0
- package/lib/v2/iresearch/maintainer.js +1 -0
- package/lib/v2/iresearch/radar.js +7 -1
- package/lib/v2/iresearch/router.js +1 -0
- package/lib/v2/iresearch/templates/weekly.art +11 -0
- package/lib/v2/iresearch/weekly.js +39 -0
- package/lib/v2/islander/maintainer.js +4 -0
- package/lib/v2/islander/radar.js +19 -0
- package/lib/v2/islander/router.js +4 -0
- package/lib/v2/islander/search.js +33 -0
- package/lib/v2/islander/top30event.js +28 -0
- package/lib/v2/iwara/maintainer.js +1 -0
- package/lib/v2/iwara/radar.js +6 -0
- package/lib/v2/iwara/router.js +1 -0
- package/lib/v2/iwara/subscriptions.js +49 -0
- package/lib/v2/iwara/templates/subscriptions.art +1 -0
- package/lib/v2/jiemian/list.js +60 -0
- package/lib/v2/jiemian/maintainer.js +4 -0
- package/lib/v2/jiemian/radar.js +19 -0
- package/lib/v2/jiemian/router.js +4 -0
- package/lib/v2/leetcode/dailyquestion-solution-cn.js +183 -0
- package/lib/v2/leetcode/dailyquestion-solution-en.js +213 -0
- package/lib/v2/leetcode/maintainer.js +1 -0
- package/lib/v2/leetcode/radar.js +12 -0
- package/lib/v2/leetcode/router.js +2 -0
- package/lib/v2/lovelive-anime/maintainer.js +3 -0
- package/lib/v2/lovelive-anime/news.js +56 -0
- package/lib/v2/lovelive-anime/radar.js +13 -0
- package/lib/v2/lovelive-anime/router.js +3 -0
- package/lib/v2/lovelive-anime/templates/description.art +1 -0
- package/lib/v2/macfilos/blog.js +61 -0
- package/lib/v2/macfilos/maintainer.js +3 -0
- package/lib/v2/macfilos/radar.js +13 -0
- package/lib/v2/macfilos/router.js +3 -0
- package/lib/v2/meteor/boards.js +11 -0
- package/lib/v2/meteor/index.js +45 -0
- package/lib/v2/meteor/maintainer.js +4 -0
- package/lib/v2/meteor/radar.js +19 -0
- package/lib/v2/meteor/router.js +4 -0
- package/lib/v2/meteor/templates/desc.art +7 -0
- package/lib/v2/meteor/utils.js +90 -0
- package/lib/v2/nga/post.js +61 -9
- package/lib/v2/nikkei-cn/index.js +4 -1
- package/lib/v2/nua/gra.js +56 -0
- package/lib/v2/nua/maintainer.js +3 -0
- package/lib/v2/nua/radar.js +13 -0
- package/lib/v2/nua/router.js +3 -0
- package/lib/{routes/universities → v2}/nuist/bulletin.js +8 -8
- package/lib/v2/nuist/cas.js +71 -0
- package/lib/v2/nuist/jwc.js +43 -0
- package/lib/v2/nuist/library/lib.js +43 -0
- package/lib/v2/nuist/maintainer.js +10 -0
- package/lib/v2/nuist/radar.js +69 -0
- package/lib/v2/nuist/router.js +10 -0
- package/lib/v2/nuist/scs.js +49 -0
- package/lib/v2/nuist/sese.js +45 -0
- package/lib/v2/nuist/xgc.js +49 -0
- package/lib/v2/nuist/yjs.js +60 -0
- package/lib/v2/oreno3d/get_sec_page_data.js +75 -0
- package/lib/v2/oreno3d/main.js +157 -0
- package/lib/v2/oreno3d/maintainer.js +7 -0
- package/lib/v2/oreno3d/radar.js +52 -0
- package/lib/v2/oreno3d/router.js +7 -0
- package/lib/v2/oreno3d/templates/description.art +13 -0
- package/lib/v2/oschina/maintainer.js +6 -0
- package/lib/{routes → v2}/oschina/news.js +35 -39
- package/lib/v2/oschina/radar.js +33 -0
- package/lib/v2/oschina/router.js +6 -0
- package/lib/v2/oschina/topic.js +53 -0
- package/lib/v2/oschina/user.js +50 -0
- package/lib/v2/pianyuan/search.js +1 -1
- package/lib/v2/pianyuan/utils.js +1 -1
- package/lib/v2/plurk/anonymous.js +23 -0
- package/lib/v2/plurk/hotlinks.js +20 -0
- package/lib/v2/plurk/maintainer.js +9 -0
- package/lib/v2/plurk/news.js +23 -0
- package/lib/v2/plurk/radar.js +56 -0
- package/lib/v2/plurk/router.js +9 -0
- package/lib/v2/plurk/search.js +27 -0
- package/lib/v2/plurk/top.js +29 -0
- package/lib/v2/plurk/topic.js +33 -0
- package/lib/v2/plurk/user.js +31 -0
- package/lib/v2/plurk/utils.js +56 -0
- package/lib/v2/polkadot/home.js +34 -0
- package/lib/v2/polkadot/maintainer.js +3 -0
- package/lib/v2/polkadot/radar.js +13 -0
- package/lib/v2/polkadot/router.js +3 -0
- package/lib/v2/remnote/changelog.js +33 -0
- package/lib/v2/remnote/maintainer.js +3 -0
- package/lib/v2/remnote/radar.js +13 -0
- package/lib/v2/remnote/router.js +3 -0
- package/lib/v2/rustcc/jobs.js +39 -0
- package/lib/v2/rustcc/maintainer.js +3 -0
- package/lib/v2/rustcc/radar.js +13 -0
- package/lib/v2/rustcc/router.js +3 -0
- package/lib/v2/segmentfault/blogs.js +38 -0
- package/lib/v2/segmentfault/maintainer.js +1 -0
- package/lib/v2/segmentfault/radar.js +8 -2
- package/lib/v2/segmentfault/router.js +1 -0
- package/lib/v2/sensortower/blog.js +69 -0
- package/lib/v2/sensortower/maintainer.js +3 -0
- package/lib/v2/sensortower/radar.js +13 -0
- package/lib/v2/sensortower/router.js +3 -0
- package/lib/v2/sensortower/templates/description.art +9 -0
- package/lib/v2/studygolang/jobs.js +37 -0
- package/lib/v2/studygolang/maintainer.js +3 -0
- package/lib/v2/studygolang/radar.js +13 -0
- package/lib/v2/studygolang/router.js +3 -0
- package/lib/v2/taptap/changelog.js +11 -10
- package/lib/v2/taptap/maintainer.js +3 -1
- package/lib/v2/taptap/radar.js +17 -0
- package/lib/v2/taptap/review.js +83 -21
- package/lib/v2/taptap/router.js +4 -1
- package/lib/v2/taptap/templates/imagePost.art +3 -0
- package/lib/v2/taptap/templates/videoPost.art +2 -1
- package/lib/v2/taptap/topic.js +36 -30
- package/lib/v2/taptap/utils.js +19 -13
- package/lib/v2/test/index.js +15 -0
- package/lib/v2/thenewslens/index.js +79 -0
- package/lib/v2/thenewslens/maintainer.js +10 -0
- package/lib/v2/thenewslens/radar.js +55 -0
- package/lib/v2/thenewslens/router.js +3 -0
- package/lib/v2/thenewslens/templates/description.art +6 -0
- package/lib/v2/trending/allTrending.js +46 -19
- package/lib/v2/trending/templates/content.art +1 -0
- package/lib/v2/trow/portal.js +13 -3
- package/lib/v2/twitter/maintainer.js +1 -1
- package/lib/v2/twitter/router.js +1 -1
- package/lib/v2/twitter/web-api/twitter-api.js +1 -0
- package/lib/v2/ustc/job.js +2 -2
- package/lib/v2/vom/featured.js +50 -0
- package/lib/v2/vom/maintainer.js +3 -0
- package/lib/v2/vom/radar.js +13 -0
- package/lib/v2/vom/router.js +3 -0
- package/lib/v2/warthunder/maintainer.js +3 -0
- package/lib/v2/warthunder/news.js +49 -0
- package/lib/v2/warthunder/radar.js +13 -0
- package/lib/v2/warthunder/router.js +3 -0
- package/lib/v2/warthunder/templates/description.art +1 -0
- package/lib/v2/wizfile/index.js +41 -0
- package/lib/v2/wizfile/maintainer.js +3 -0
- package/lib/v2/wizfile/radar.js +13 -0
- package/lib/v2/wizfile/router.js +3 -0
- package/lib/v2/xjtu/dyyy/index.js +44 -0
- package/lib/v2/xjtu/maintainer.js +1 -0
- package/lib/v2/xjtu/radar.js +8 -0
- package/lib/v2/xjtu/router.js +1 -0
- package/lib/v2/xmnn/epaper.js +85 -0
- package/lib/v2/xmnn/maintainer.js +3 -0
- package/lib/v2/xmnn/radar.js +13 -0
- package/lib/v2/xmnn/router.js +3 -0
- package/lib/v2/xyzrank/index.js +111 -0
- package/lib/v2/xyzrank/maintainer.js +6 -0
- package/lib/v2/xyzrank/radar.js +31 -0
- package/lib/v2/xyzrank/router.js +3 -0
- package/lib/v2/xyzrank/templates/description.art +12 -0
- package/lib/v2/youtube/channel.js +1 -0
- package/lib/v2/youtube/user.js +1 -0
- package/lib/v2/zaobao/maintainer.js +1 -1
- package/lib/v2/zaobao/util.js +6 -6
- package/lib/v2/zuvio/boards.js +14 -0
- package/lib/v2/zuvio/radar.js +13 -0
- package/lib/v2/zuvio/router.js +4 -0
- package/lib/v2/zuvio/student5.js +58 -0
- package/lib/v2/zuvio/templates/img.art +2 -0
- package/lib/v2/zuvio/templates/link.art +7 -0
- package/lib/v2/zuvio/templates/ref_article.art +8 -0
- package/lib/v2/zuvio/templates/rss.art +1 -0
- package/lib/v2/zuvio/templates/youtube.art +2 -0
- package/lib/v2/zuvio/utils.js +61 -0
- package/package.json +20 -13
- package/lib/routes/erbingapp/news.js +0 -51
- package/lib/routes/jiemian/list.js +0 -48
- package/lib/routes/jiemian/utils.js +0 -26
- package/lib/routes/mofcom/article.js +0 -54
- package/lib/routes/oschina/topic.js +0 -54
- package/lib/routes/oschina/u.js +0 -57
- package/lib/routes/oschina/user.js +0 -57
- package/lib/routes/tieba/forum.js +0 -88
- package/lib/routes/tieba/user.js +0 -36
- package/lib/routes/universities/nuist/cas.js +0 -60
- package/lib/routes/universities/nuist/jwc.js +0 -66
- package/lib/routes/universities/nuist/library/lib.js +0 -32
- package/lib/routes/universities/nuist/scs.js +0 -60
- package/lib/routes/universities/nuist/sese.js +0 -60
- package/lib/routes/universities/nuist/xgc.js +0 -48
- package/lib/routes/universities/nuist/yjs.js +0 -63
- package/lib/v2/appledaily/templates/content.art +0 -7
- package/lib/v2/hupu/templates/description.art +0 -6
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { art } = require('@/utils/render');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const url = 'https://bangumi.online/api/serve/home';
|
|
7
|
+
|
|
8
|
+
const response = await got.post(url);
|
|
9
|
+
|
|
10
|
+
const list = response.data.data.list;
|
|
11
|
+
|
|
12
|
+
const items = list.map((item) => ({
|
|
13
|
+
title: `${item.title_zh} - 第 ${item.volume} 集`,
|
|
14
|
+
description: art(path.join(__dirname, 'templates/image.art'), {
|
|
15
|
+
src: `https:${item.cover}`,
|
|
16
|
+
alt: `${item.title_zh} - 第 ${item.volume} 集`,
|
|
17
|
+
}),
|
|
18
|
+
link: `https://bangumi.online/watch/${item.vid}`,
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
ctx.state.data = {
|
|
22
|
+
title: 'アニメ新番組',
|
|
23
|
+
link: 'https://bangumi.online',
|
|
24
|
+
item: items,
|
|
25
|
+
};
|
|
26
|
+
};
|
package/lib/v2/bangumi/radar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
'
|
|
3
|
-
_name: '
|
|
2
|
+
'bangumi.moe': {
|
|
3
|
+
_name: '萌番組',
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
6
|
title: '最新',
|
|
@@ -16,4 +16,15 @@ module.exports = {
|
|
|
16
16
|
},
|
|
17
17
|
],
|
|
18
18
|
},
|
|
19
|
+
'bangumi.online': {
|
|
20
|
+
_name: 'アニメ新番組',
|
|
21
|
+
'.': [
|
|
22
|
+
{
|
|
23
|
+
title: '當季新番',
|
|
24
|
+
docs: 'https://docs.rsshub.app/anime.html#アニメ-xin-fan-zu-dang-ji-xin-fan',
|
|
25
|
+
source: ['/'],
|
|
26
|
+
target: '/bangumi/online',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
19
30
|
};
|
package/lib/v2/bangumi/router.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<img src="{{ src }}" alt="{{ alt }}">
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cache = require('./cache');
|
|
3
|
+
const utils = require('./utils');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const uid = ctx.params.uid;
|
|
8
|
+
const sid = ctx.params.sid;
|
|
9
|
+
const disableEmbed = ctx.params.disableEmbed;
|
|
10
|
+
const [name, face] = await cache.getUsernameAndFaceFromUID(ctx, uid);
|
|
11
|
+
const response = await got({
|
|
12
|
+
method: 'get',
|
|
13
|
+
url: `https://api.bilibili.com/x/polymer/space/seasons_archives_list?mid=${uid}&season_id=${sid}&sort_reverse=false&page_num=1&page_size=30`,
|
|
14
|
+
headers: {
|
|
15
|
+
Referer: `https://space.bilibili.com/${uid}/channel/collectiondetail?sid=${sid}`,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
const data = response.data;
|
|
19
|
+
|
|
20
|
+
ctx.state.data = {
|
|
21
|
+
title: `${name}的${data.data.meta.name}`,
|
|
22
|
+
link: `https://space.bilibili.com/${uid}/channel/collectiondetail?sid=${sid}`,
|
|
23
|
+
description: `${name} 的 bilibili 合集`,
|
|
24
|
+
logo: face,
|
|
25
|
+
icon: face,
|
|
26
|
+
item: data.data.archives.map((item) => ({
|
|
27
|
+
title: item.title,
|
|
28
|
+
description: `${!disableEmbed ? `<br><br>${utils.iframe(item.aid)}` : ''}<br><img src="${item.pic}">`,
|
|
29
|
+
pubDate: parseDate(item.pubdate * 1000),
|
|
30
|
+
link: item.pubdate > utils.bvidTime && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.aid}`,
|
|
31
|
+
author: name,
|
|
32
|
+
})),
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -4,6 +4,7 @@ module.exports = {
|
|
|
4
4
|
'/blackboard': ['Qixingchen'],
|
|
5
5
|
'/bangumi/:seasonid': ['DIYgod'],
|
|
6
6
|
'/bangumi/media/:mediaid': ['DIYgod'],
|
|
7
|
+
'/collection/:uid/:sid/:disableEmbed?': ['shininome'],
|
|
7
8
|
'/fav/:uid/:fid/:disableEmbed?': ['Qixingchen'],
|
|
8
9
|
'/followings/article/:uid': ['woshiluo'],
|
|
9
10
|
'/followings/dynamic/:uid/:disableEmbed?': ['TigerCubDen'],
|
|
@@ -32,6 +33,7 @@ module.exports = {
|
|
|
32
33
|
'/user/followers/:uid': ['Qixingchen'],
|
|
33
34
|
'/user/followings/:uid': ['Qixingchen'],
|
|
34
35
|
'/user/video/:uid/:disableEmbed?': ['DIYgod'],
|
|
36
|
+
'/user/video-all/:uid/:disableEmbed?': ['CcccFz'],
|
|
35
37
|
'/video/danmaku/:bvid/:pid?': ['Qixingchen'],
|
|
36
38
|
'/video/page/:bvid/:disableEmbed?': ['sxzz'],
|
|
37
39
|
'/video/reply/:bvid': ['Qixingchen'],
|
package/lib/v2/bilibili/radar.js
CHANGED
|
@@ -90,6 +90,15 @@ module.exports = {
|
|
|
90
90
|
source: '/:uid',
|
|
91
91
|
target: '/bilibili/user/bangumi/:uid',
|
|
92
92
|
},
|
|
93
|
+
{
|
|
94
|
+
title: '当前合集',
|
|
95
|
+
docs: 'https://docs.rsshub.app/social-media.html#bilibili',
|
|
96
|
+
source: '/:uid/channel/collectiondetail',
|
|
97
|
+
target: (params, url) => {
|
|
98
|
+
const sid = new URL(url).searchParams.get('sid');
|
|
99
|
+
return `/bilibili/collection/:uid/${sid}`;
|
|
100
|
+
},
|
|
101
|
+
},
|
|
93
102
|
],
|
|
94
103
|
manga: [
|
|
95
104
|
{
|
|
@@ -4,6 +4,7 @@ module.exports = (router) => {
|
|
|
4
4
|
router.get('/blackboard', require('./blackboard'));
|
|
5
5
|
router.get('/bangumi/:seasonid', require('./bangumi')); // 弃用
|
|
6
6
|
router.get('/bangumi/media/:mediaid', require('./bangumi'));
|
|
7
|
+
router.get('/collection/:uid/:sid/:disableEmbed?', require('./collection'));
|
|
7
8
|
router.get('/fav/:uid/:fid/:disableEmbed?', require('./fav'));
|
|
8
9
|
router.get('/followings/article/:uid', require('./followings_article'));
|
|
9
10
|
router.get('/followings/dynamic/:uid/:disableEmbed?', require('./followings_dynamic'));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const cheerio = require('cheerio');
|
|
2
|
+
const got = require('@/utils/got');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
const CATEGORY_MAP = {
|
|
6
|
+
domestic: 'domestic',
|
|
7
|
+
international: 'international',
|
|
8
|
+
social: 'social',
|
|
9
|
+
news100: 'news100',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
module.exports = async (ctx) => {
|
|
13
|
+
const baseUrl = 'https://news.china.com';
|
|
14
|
+
const category = CATEGORY_MAP[ctx.params.category] ?? CATEGORY_MAP.domestic;
|
|
15
|
+
const websiteUrl = `${baseUrl}/${category}`;
|
|
16
|
+
const response = await got(websiteUrl);
|
|
17
|
+
const data = response.data;
|
|
18
|
+
const $ = cheerio.load(data);
|
|
19
|
+
const categoryTitle = $('.wp_title').text();
|
|
20
|
+
const news = $('.item_list li');
|
|
21
|
+
ctx.state.data = {
|
|
22
|
+
title: `中华网-${categoryTitle}新闻`,
|
|
23
|
+
link: websiteUrl,
|
|
24
|
+
item:
|
|
25
|
+
news &&
|
|
26
|
+
news
|
|
27
|
+
.map((_, item) => {
|
|
28
|
+
item = $(item);
|
|
29
|
+
return {
|
|
30
|
+
title: item.find('.item_title a').text(),
|
|
31
|
+
author: item.find('.item_source').text(),
|
|
32
|
+
category: `${categoryTitle}新闻`,
|
|
33
|
+
pubDate: parseDate(item.find('.item_time').text()),
|
|
34
|
+
description: item.find('.item_title a').text(),
|
|
35
|
+
link: item.find('li a').attr('href'),
|
|
36
|
+
};
|
|
37
|
+
})
|
|
38
|
+
.get(),
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const cheerio = require('cheerio');
|
|
2
|
+
const got = require('@/utils/got');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const websiteUrl = 'https://military.china.com/news/';
|
|
7
|
+
const response = await got(websiteUrl);
|
|
8
|
+
const data = response.data;
|
|
9
|
+
const $ = cheerio.load(data);
|
|
10
|
+
const commonList = $('.listItem');
|
|
11
|
+
|
|
12
|
+
ctx.state.data = {
|
|
13
|
+
title: '中华网-军事新闻',
|
|
14
|
+
link: 'https://military.china.com/news/',
|
|
15
|
+
item:
|
|
16
|
+
commonList &&
|
|
17
|
+
commonList
|
|
18
|
+
.map((_, item) => {
|
|
19
|
+
item = $(item);
|
|
20
|
+
return {
|
|
21
|
+
title: item.find('.tit a').text(),
|
|
22
|
+
author: '中华网军事',
|
|
23
|
+
category: '中华网军事',
|
|
24
|
+
pubDate: parseDate(item.find('.time').text()),
|
|
25
|
+
description: item.find('.tag').text(),
|
|
26
|
+
link: item.find('.tit a').attr('href'),
|
|
27
|
+
};
|
|
28
|
+
})
|
|
29
|
+
.get(),
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'china.com': {
|
|
3
|
+
_name: '中华网',
|
|
4
|
+
military: [
|
|
5
|
+
{
|
|
6
|
+
title: '军事新闻',
|
|
7
|
+
docs: 'https://docs.rsshub.app/new-media.html#zhong-hua-wang',
|
|
8
|
+
source: '/news',
|
|
9
|
+
target: '/china/news/military',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
news: [
|
|
13
|
+
{
|
|
14
|
+
title: '时事新闻',
|
|
15
|
+
docs: 'https://docs.rsshub.app/new-media.html#zhong-hua-wang',
|
|
16
|
+
source: '/:category',
|
|
17
|
+
target: '/china/news/:category?',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const rssParser = require('@/utils/rss-parser');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const user = ctx.params.user;
|
|
7
|
+
|
|
8
|
+
const rootUrl = 'https://blog.csdn.net';
|
|
9
|
+
const blogUrl = `${rootUrl}/${user}`;
|
|
10
|
+
const rssUrl = blogUrl + '/rss/list';
|
|
11
|
+
|
|
12
|
+
const feed = await rssParser.parseURL(rssUrl);
|
|
13
|
+
|
|
14
|
+
const items = await Promise.all(
|
|
15
|
+
feed.items.map((item) =>
|
|
16
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
17
|
+
const response = await got({
|
|
18
|
+
method: 'get',
|
|
19
|
+
url: item.link,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const $ = cheerio.load(response.data);
|
|
23
|
+
|
|
24
|
+
const description = $('#content_views').html();
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
...item,
|
|
28
|
+
description,
|
|
29
|
+
};
|
|
30
|
+
})
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
ctx.state.data = {
|
|
35
|
+
...feed,
|
|
36
|
+
title: `${feed.title} - CSDN博客`,
|
|
37
|
+
item: items,
|
|
38
|
+
};
|
|
39
|
+
};
|
package/lib/v2/csu/cse.js
CHANGED
|
@@ -22,7 +22,7 @@ module.exports = async (ctx) => {
|
|
|
22
22
|
const out = await Promise.all(
|
|
23
23
|
list.map((item) => {
|
|
24
24
|
const $ = cheerio.load(item);
|
|
25
|
-
const address = new URL($('a').attr('href'), url);
|
|
25
|
+
const address = new URL($('a').attr('href'), url).href;
|
|
26
26
|
const title = $('a').text();
|
|
27
27
|
const pubDate = $('span').text();
|
|
28
28
|
return ctx.cache.tryGet(address, async () => {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { art } = require('@/utils/render');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const renderDesc = (data) => art(path.join(__dirname, 'templates/news.art'), data);
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const { data } = await got(`https://api.diershoubing.com:5001/feed/tag/?pn=0&rn=${ctx.query.limit ? Number(ctx.query.limit) : 20}&tag_type=0&src=ios`);
|
|
9
|
+
|
|
10
|
+
const items = data.feeds.map((item) => {
|
|
11
|
+
let acontent;
|
|
12
|
+
let type;
|
|
13
|
+
if (item.video_img && item.video_type === 'bilibili') {
|
|
14
|
+
acontent = { img: item.video_img, bvid: item.video_url.replace('https://www.bilibili.com/video/', '').replace('/', '') };
|
|
15
|
+
type = 'bilibili';
|
|
16
|
+
} else if (item.acontent.startsWith('{')) {
|
|
17
|
+
const contentData = JSON.parse(item.acontent);
|
|
18
|
+
if (contentData.imgs) {
|
|
19
|
+
acontent = contentData.imgs.split(',');
|
|
20
|
+
type = 'imgs';
|
|
21
|
+
} else {
|
|
22
|
+
acontent = { img: contentData.video.split('|')[0], bvid: contentData.video.split('|')[1].replace('https://www.bilibili.com/video/', '') };
|
|
23
|
+
type = 'bilibili';
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
acontent = item.acontent.split(',');
|
|
27
|
+
type = 'imgs';
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
title: item.title,
|
|
32
|
+
link: item.share.url,
|
|
33
|
+
description: renderDesc({
|
|
34
|
+
description: item.content.replace(/\r\n/g, '<br>'),
|
|
35
|
+
type,
|
|
36
|
+
acontent,
|
|
37
|
+
}),
|
|
38
|
+
category: item.feed_type,
|
|
39
|
+
author: item.create_nick_name,
|
|
40
|
+
pubDate: parseDate(item.create_time),
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
ctx.state.data = {
|
|
45
|
+
title: `二柄APP`,
|
|
46
|
+
link: `https://www.diershoubing.com`,
|
|
47
|
+
description: `二柄APP新闻`,
|
|
48
|
+
item: items,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{{@ description }}
|
|
2
|
+
{{ if type === 'imgs' }}
|
|
3
|
+
{{ each acontent img }}
|
|
4
|
+
<img src={{ img }}>
|
|
5
|
+
{{ /each }}
|
|
6
|
+
{{ else if type === 'bilibili' }}
|
|
7
|
+
<img src={{ acontent.img }}>
|
|
8
|
+
<iframe src="https://player.bilibili.com/player.html?bvid={{ acontent.bvid }}&high_quality=1" width="650" height="477" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
|
|
9
|
+
{{ /if }}
|
package/lib/v2/douyin/live.js
CHANGED
|
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
|
|
|
21
21
|
await page.goto(pageUrl, {
|
|
22
22
|
waitUntil: 'domcontentloaded',
|
|
23
23
|
});
|
|
24
|
-
const data = await page.evaluate(() =>
|
|
24
|
+
const data = JSON.parse(decodeURIComponent(await page.evaluate(() => document.querySelector('#RENDER_DATA').innerText)));
|
|
25
25
|
browser.close();
|
|
26
26
|
|
|
27
27
|
return data;
|
|
@@ -30,11 +30,11 @@ module.exports = async (ctx) => {
|
|
|
30
30
|
false
|
|
31
31
|
);
|
|
32
32
|
|
|
33
|
-
if (renderData.
|
|
34
|
-
throw `Status code ${renderData.
|
|
33
|
+
if (renderData[Object.keys(renderData).find((k) => renderData[k].status_code)].status_code !== '0') {
|
|
34
|
+
throw `Status code ${renderData[Object.keys(renderData).find((k) => renderData[k].status_code)].status_code}`;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const roomInfo = renderData.initialState.roomStore.roomInfo;
|
|
37
|
+
const roomInfo = renderData.app.initialState.roomStore.roomInfo;
|
|
38
38
|
const nickname = roomInfo.anchor.nickname;
|
|
39
39
|
const userAvatar = roomInfo.anchor.avatar_thumb.url_list[0];
|
|
40
40
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const timezone = require('@/utils/timezone');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const id = ctx.params.id;
|
|
9
|
+
const sort = ctx.params.sort ?? '2';
|
|
10
|
+
|
|
11
|
+
const rootUrl = 'https://yuba.douyu.com';
|
|
12
|
+
const detailUrl = `${rootUrl}/wbapi/web/group/head?group_id=${id}`;
|
|
13
|
+
const apiUrl = `${rootUrl}/wbapi/web/group/postlist?group_id=${id}&page=1&sort=${sort}`;
|
|
14
|
+
const currentUrl = `${rootUrl}/group/${sort === '1' ? 'newall' : 'newself'}/${id}`;
|
|
15
|
+
|
|
16
|
+
const response = await got({
|
|
17
|
+
method: 'get',
|
|
18
|
+
url: apiUrl,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const detailResponse = await got({
|
|
22
|
+
method: 'get',
|
|
23
|
+
url: detailUrl,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const items = response.data.data.map((item) => ({
|
|
27
|
+
title: item.title,
|
|
28
|
+
link: `${rootUrl}/p/${item.post_id}`,
|
|
29
|
+
pubDate: timezone(parseDate(item.created_at_std), +8),
|
|
30
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
31
|
+
content: item.describe,
|
|
32
|
+
images: item.imglist.map((i) => ({
|
|
33
|
+
size: i.size,
|
|
34
|
+
url: i.url,
|
|
35
|
+
})),
|
|
36
|
+
}),
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
ctx.state.data = {
|
|
40
|
+
title: `斗鱼鱼吧 - ${detailResponse.data.data.group_name}`,
|
|
41
|
+
link: currentUrl,
|
|
42
|
+
item: items,
|
|
43
|
+
description: detailResponse.data.data.describe,
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const { art } = require('@/utils/render');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const id = ctx.params.id;
|
|
8
|
+
|
|
9
|
+
const rootUrl = 'https://yuba.douyu.com';
|
|
10
|
+
const currentUrl = `${rootUrl}/p/${id}`;
|
|
11
|
+
const detailUrl = `${rootUrl}/wbapi/web/post/detail/${id}`;
|
|
12
|
+
|
|
13
|
+
const detailResponse = await got({
|
|
14
|
+
method: 'get',
|
|
15
|
+
url: detailUrl,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const data = detailResponse.data.data;
|
|
19
|
+
let apiUrl = `${rootUrl}/wbapi/web/post/comments/${id}?group_id=${data.group_id}&sink=1&page=1`;
|
|
20
|
+
|
|
21
|
+
let response = await got({
|
|
22
|
+
method: 'get',
|
|
23
|
+
url: apiUrl,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
apiUrl = `${rootUrl}/wbapi/web/post/comments/${id}?group_id=${data.group_id}&sink=1&page=${response.data.page_total}`;
|
|
27
|
+
|
|
28
|
+
response = await got({
|
|
29
|
+
method: 'get',
|
|
30
|
+
url: apiUrl,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const items = response.data.data.map((item) => ({
|
|
34
|
+
title: `${item.nick_name}: ${item.content}`,
|
|
35
|
+
link: `${currentUrl}#${item.comment_id}${item.sub_replies.length > 0 ? `+${item.sub_replies.map((r) => r.comment_id).join('+')}` : ''}`,
|
|
36
|
+
pubDate: parseDate(item.created_ts * 1000),
|
|
37
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
38
|
+
content: item.content,
|
|
39
|
+
images: item.imglist.map((i) => ({
|
|
40
|
+
size: i.size,
|
|
41
|
+
url: i.url,
|
|
42
|
+
})),
|
|
43
|
+
replies:
|
|
44
|
+
item.sub_replies.map((r) => ({
|
|
45
|
+
nickname: r.nickname,
|
|
46
|
+
content: r.content,
|
|
47
|
+
time: new Date(r.created_ts * 1000).toLocaleString(),
|
|
48
|
+
})) ?? undefined,
|
|
49
|
+
}),
|
|
50
|
+
}));
|
|
51
|
+
|
|
52
|
+
ctx.state.data = {
|
|
53
|
+
title: `斗鱼鱼吧 - ${data.title}`,
|
|
54
|
+
link: currentUrl,
|
|
55
|
+
item: items,
|
|
56
|
+
description: data.content,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'douyu.com': {
|
|
3
|
+
_name: '斗鱼',
|
|
4
|
+
www: [
|
|
5
|
+
{
|
|
6
|
+
title: '直播间开播',
|
|
7
|
+
docs: 'https://docs.rsshub.app/live.html#dou-yu-zhi-bo-zhi-bo-jian-kai-bo',
|
|
8
|
+
source: ['/:id', '/'],
|
|
9
|
+
target: '/douyu/room/:id',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
yuba: [
|
|
13
|
+
{
|
|
14
|
+
title: '鱼吧帖子',
|
|
15
|
+
docs: 'https://docs.rsshub.app/bbs.html#dou-yu-yu-ba-tie-zi',
|
|
16
|
+
source: ['/group/:id', '/group/newself/:id', '/group/newall/:id', '/'],
|
|
17
|
+
target: '/douyu/group/:id',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
title: '鱼吧跟帖',
|
|
21
|
+
docs: 'https://docs.rsshub.app/bbs.html#dou-yu-yu-ba-gen-tie',
|
|
22
|
+
source: ['/p/:id', '/'],
|
|
23
|
+
target: '/douyu/post/:id',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{ if content }}
|
|
2
|
+
{{ content }}
|
|
3
|
+
{{ /if }}
|
|
4
|
+
{{ if images }}
|
|
5
|
+
{{ each images image }}
|
|
6
|
+
<img src="{{ image.url }}" width="{{ image.size.w }}" height="{{ image.size.h }}">
|
|
7
|
+
{{ /each }}
|
|
8
|
+
{{ /if }}
|
|
9
|
+
{{ if replies }}
|
|
10
|
+
<h3>回复</h3>
|
|
11
|
+
{{ each replies reply }}
|
|
12
|
+
<p><b>{{ reply.nickname }}</b> <small>[{{ reply.time }}]</small>: {{ reply.content }}</p>
|
|
13
|
+
{{ /each }}
|
|
14
|
+
{{ /if }}
|