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
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const category = ctx.params.category ?? 'feature-stories';
|
|
7
|
+
const language = ctx.params.language ?? '';
|
|
8
|
+
|
|
9
|
+
const rootUrl = 'https://www.who.int';
|
|
10
|
+
const currentUrl = `${rootUrl}/${language ? `${language}/` : ''}news-room/${category}`;
|
|
11
|
+
|
|
12
|
+
const response = await got({
|
|
13
|
+
method: 'get',
|
|
14
|
+
url: currentUrl,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const $ = cheerio.load(response.data);
|
|
18
|
+
|
|
19
|
+
let list = $('.list-view--item a');
|
|
20
|
+
|
|
21
|
+
if (list.length === 0) {
|
|
22
|
+
const response = await got({
|
|
23
|
+
method: 'get',
|
|
24
|
+
url: `${rootUrl}/api/hubs/${category.replace(/-/g, '')}?sf_culture=zh&$orderby=PublicationDateAndTime%20desc&$select=Title,PublicationDateAndTime,ItemDefaultUrl&$top=30`,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
list = response.data.value.map((item) => ({
|
|
28
|
+
title: item.Title,
|
|
29
|
+
link: `${currentUrl}/detail/${item.ItemDefaultUrl}`,
|
|
30
|
+
pubDate: parseDate(item.PublicationDateAndTime),
|
|
31
|
+
}));
|
|
32
|
+
} else {
|
|
33
|
+
list = list
|
|
34
|
+
.map((_, item) => {
|
|
35
|
+
item = $(item);
|
|
36
|
+
const link = item.attr('href');
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
link: `${link.indexOf('http') === 0 ? '' : rootUrl}${item.attr('href')}`,
|
|
40
|
+
};
|
|
41
|
+
})
|
|
42
|
+
.get();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const items = await Promise.all(
|
|
46
|
+
list.map(
|
|
47
|
+
async (item) =>
|
|
48
|
+
await ctx.cache.tryGet(item.link, async () => {
|
|
49
|
+
const detailResponse = await got({
|
|
50
|
+
method: 'get',
|
|
51
|
+
url: item.link,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const matches = detailResponse.data.match(/"headline":"(.*)","description":"(.*)","datePublished":"(.*)","image"/);
|
|
55
|
+
|
|
56
|
+
if (matches) {
|
|
57
|
+
item.title = matches[1];
|
|
58
|
+
item.description = matches[2];
|
|
59
|
+
item.pubDate = parseDate(matches[3]);
|
|
60
|
+
} else {
|
|
61
|
+
const content = cheerio.load(detailResponse.data);
|
|
62
|
+
|
|
63
|
+
item.description = content('.sf-content-block').html();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return item;
|
|
67
|
+
})
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
ctx.state.data = {
|
|
72
|
+
title: `${$('meta[property="og:title"]').attr('content')} - WHO`,
|
|
73
|
+
link: currentUrl,
|
|
74
|
+
item: items,
|
|
75
|
+
};
|
|
76
|
+
};
|
|
@@ -2,7 +2,7 @@ const got = require('@/utils/got');
|
|
|
2
2
|
const { parseDate } = require('@/utils/parse-date');
|
|
3
3
|
|
|
4
4
|
module.exports = async (ctx) => {
|
|
5
|
-
const language = ctx.params.language
|
|
5
|
+
const language = ctx.params.language ?? 'en';
|
|
6
6
|
|
|
7
7
|
const rootUrl = 'https://www.who.int';
|
|
8
8
|
const currentUrl = `${rootUrl}/${language === 'en' ? '' : `${language}/`}news`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'who.int': {
|
|
3
|
+
_name: '世界卫生组织 WHO',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '新闻稿',
|
|
7
|
+
docs: 'https://docs.rsshub.app/government.html#shi-jie-wei-sheng-zu-zhi-who',
|
|
8
|
+
source: '/news',
|
|
9
|
+
target: '/who/news',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '媒体中心',
|
|
13
|
+
docs: 'https://docs.rsshub.app/government.html#shi-jie-wei-sheng-zu-zhi-who',
|
|
14
|
+
source: '/news-room/:type',
|
|
15
|
+
target: '/who/news-room/:type',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '总干事的讲话',
|
|
19
|
+
docs: 'https://docs.rsshub.app/government.html#shi-jie-wei-sheng-zu-zhi-who',
|
|
20
|
+
source: '/director-general/speeches',
|
|
21
|
+
target: '/who/speeches',
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const { parseString } = require('xml2js');
|
|
3
|
+
const cheerio = require('cheerio');
|
|
4
|
+
const currentURL = 'https://zh.wikinews.org/wiki/Special:%E6%96%B0%E9%97%BB%E8%AE%A2%E9%98%85';
|
|
5
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const resp = await got(currentURL);
|
|
9
|
+
const {
|
|
10
|
+
urlset: { url: urls },
|
|
11
|
+
} = await new Promise((resolve, reject) => {
|
|
12
|
+
parseString(resp.data, (err, result) => {
|
|
13
|
+
if (err) {
|
|
14
|
+
reject(err);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
resolve(result);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
ctx.state.data = {
|
|
22
|
+
title: '最新新闻 - 维基新闻',
|
|
23
|
+
link: currentURL,
|
|
24
|
+
item: await Promise.all(
|
|
25
|
+
urls.map(async (url) => {
|
|
26
|
+
const loc = url.loc[0];
|
|
27
|
+
const news = url['news:news'][0];
|
|
28
|
+
const description = await ctx.cache.tryGet(loc, async () => {
|
|
29
|
+
const resp = await got(loc);
|
|
30
|
+
const $ = cheerio.load(resp.data);
|
|
31
|
+
return $('#bodyContent').html();
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
title: news['news:title'][0],
|
|
35
|
+
pubDate: parseDate(news['news:publication_date'][0]),
|
|
36
|
+
category: news['news:keywords'][0].split(',').map((item) => item.trim()),
|
|
37
|
+
link: loc,
|
|
38
|
+
description,
|
|
39
|
+
};
|
|
40
|
+
})
|
|
41
|
+
),
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const parser = require('@/utils/rss-parser');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
3
|
const got = require('@/utils/got');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
5
|
|
|
5
6
|
const categoryToXMLFileName = {
|
|
6
7
|
opinion: 'RSSOpinion.xml',
|
|
@@ -57,7 +58,7 @@ module.exports = async (ctx) => {
|
|
|
57
58
|
});
|
|
58
59
|
const html = response.body;
|
|
59
60
|
const $ = cheerio.load(html);
|
|
60
|
-
const content = $('.articleBody >
|
|
61
|
+
const content = $('.articleBody > section');
|
|
61
62
|
|
|
62
63
|
// Cover
|
|
63
64
|
const cover = $('.articleLead > div.is-lead-inset > div.header > .img-header > div.image-container > amp-img > img');
|
|
@@ -73,6 +74,7 @@ module.exports = async (ctx) => {
|
|
|
73
74
|
// Metadata (categories & updatedAt)
|
|
74
75
|
const updatedAt = $('meta[itemprop="dateModified"]').attr('content');
|
|
75
76
|
const publishedAt = $('meta[itemprop="datePublished"]').attr('content');
|
|
77
|
+
const author = $('.author > a[rel="author"]').html();
|
|
76
78
|
|
|
77
79
|
const categories = $('meta[name="keywords"]')
|
|
78
80
|
.attr('content')
|
|
@@ -113,9 +115,9 @@ module.exports = async (ctx) => {
|
|
|
113
115
|
return {
|
|
114
116
|
title: item.title,
|
|
115
117
|
id: item.guid,
|
|
116
|
-
pubDate:
|
|
117
|
-
updated:
|
|
118
|
-
author
|
|
118
|
+
pubDate: parseDate(publishedAt),
|
|
119
|
+
updated: parseDate(updatedAt),
|
|
120
|
+
author,
|
|
119
121
|
link: item.link,
|
|
120
122
|
summary,
|
|
121
123
|
description: content.html(),
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'wsj.com': {
|
|
3
|
+
_name: '华尔街日报 The Wall Street Journal (WSJ)',
|
|
4
|
+
cn: [
|
|
5
|
+
{
|
|
6
|
+
title: '新闻',
|
|
7
|
+
docs: 'https://docs.rsshub.app/traditional-media.html#hua-er-jie-ri-bao-the-wall-street-journal-wsj',
|
|
8
|
+
souce: '/',
|
|
9
|
+
target: '/wsj/zh-cn',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
www: [
|
|
13
|
+
{
|
|
14
|
+
title: '新闻',
|
|
15
|
+
docs: 'https://docs.rsshub.app/traditional-media.html#hua-er-jie-ri-bao-the-wall-street-journal-wsj',
|
|
16
|
+
souce: '/',
|
|
17
|
+
target: '/wsj/en-us',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
|
|
|
21
21
|
link: `https://www.xiaoyuzhoufm.com/episode/${item.eid}`,
|
|
22
22
|
pubDate: parseDate(item.pubDate),
|
|
23
23
|
description: item.shownotes,
|
|
24
|
-
itunes_item_image: item.image.smallPicUrl,
|
|
24
|
+
itunes_item_image: (item.image || item.podcast?.image)?.smallPicUrl,
|
|
25
25
|
}));
|
|
26
26
|
|
|
27
27
|
ctx.state.data = {
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
module.exports = async (ctx) => {
|
|
6
|
+
const uid = ctx.params.uid;
|
|
7
|
+
const host = 'https://xmanhua.com';
|
|
8
|
+
const url = `https://xmanhua.com/${uid}/`;
|
|
9
|
+
const response = await got({
|
|
10
|
+
method: 'get',
|
|
11
|
+
url,
|
|
12
|
+
headers: {
|
|
13
|
+
Referer: host,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const data = response.data;
|
|
18
|
+
const $ = cheerio.load(data);
|
|
19
|
+
const list = $('div #chapterlistload').find('.detail-list-form-item');
|
|
20
|
+
// 作者
|
|
21
|
+
const autherName = $('body > div.detail-info-1 > div > div > p.detail-info-tip > span:nth-child(1)').text().split(':')[1];
|
|
22
|
+
// 检查漫画是否已经完结
|
|
23
|
+
const finished_text = $('div.detail-list-form-title').clone().children().remove().end().text();
|
|
24
|
+
let finished = false;
|
|
25
|
+
let newOneDate = finished_text.split(',')[1];
|
|
26
|
+
if (newOneDate.includes('月') && newOneDate.includes('號')) {
|
|
27
|
+
const month = parseInt(newOneDate.split('月')[0]);
|
|
28
|
+
const date = parseInt(newOneDate.split('月')[1].split('號')[0]);
|
|
29
|
+
const year = new Date().getFullYear();
|
|
30
|
+
newOneDate = new Date(year, month - 1, date + 1);
|
|
31
|
+
} else {
|
|
32
|
+
newOneDate = new Date(newOneDate);
|
|
33
|
+
newOneDate.setDate(newOneDate.getDate() + 1);
|
|
34
|
+
}
|
|
35
|
+
if (finished_text.includes('已完結') || finished_text.includes('已完结')) {
|
|
36
|
+
finished = true;
|
|
37
|
+
}
|
|
38
|
+
// 最新一话的地址
|
|
39
|
+
const updatedOne = $('div.detail-list-form-title span.s a').attr('href');
|
|
40
|
+
const items = list
|
|
41
|
+
.map((index, item) => {
|
|
42
|
+
item = $(item);
|
|
43
|
+
const itemTitle = item.text();
|
|
44
|
+
const itemUrl = item.attr('href');
|
|
45
|
+
let itemDate;
|
|
46
|
+
if (itemUrl === updatedOne) {
|
|
47
|
+
itemDate = parseDate(newOneDate);
|
|
48
|
+
} else {
|
|
49
|
+
itemDate = '';
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
title: itemTitle,
|
|
53
|
+
link: host + itemUrl,
|
|
54
|
+
auther: autherName,
|
|
55
|
+
pubDate: itemDate,
|
|
56
|
+
guid: host + itemUrl,
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
.get();
|
|
60
|
+
const name = $('body > div.detail-info-1 > div > div > p.detail-info-title').text();
|
|
61
|
+
let description_ = '';
|
|
62
|
+
if (finished) {
|
|
63
|
+
description_ = '已完结';
|
|
64
|
+
} else {
|
|
65
|
+
description_ = '连载中';
|
|
66
|
+
}
|
|
67
|
+
ctx.state.data = {
|
|
68
|
+
title: `x漫画 ${name}`,
|
|
69
|
+
link: `https://xmanhua.com/${uid}`,
|
|
70
|
+
description: description_,
|
|
71
|
+
allowEmpty: true,
|
|
72
|
+
item: items,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const timezone = require('@/utils/timezone');
|
|
3
5
|
|
|
4
6
|
module.exports = async (ctx) => {
|
|
5
7
|
const id = ctx.params.id;
|
|
@@ -13,7 +15,7 @@ module.exports = async (ctx) => {
|
|
|
13
15
|
|
|
14
16
|
const out = await Promise.all(
|
|
15
17
|
list
|
|
16
|
-
.map(async (
|
|
18
|
+
.map(async (_, item) => {
|
|
17
19
|
item = $(item);
|
|
18
20
|
const title = item.find('td:nth-child(1) > a:nth-child(2)').text();
|
|
19
21
|
const author = item.find('td:nth-child(2) cite a').text();
|
|
@@ -24,25 +26,15 @@ module.exports = async (ctx) => {
|
|
|
24
26
|
title,
|
|
25
27
|
author,
|
|
26
28
|
link,
|
|
27
|
-
pubDate:
|
|
29
|
+
pubDate: timezone(parseDate(date, 'YYYY-MM-DD HH:mm'), +8),
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
const value = await ctx.cache.get(key);
|
|
32
|
-
if (value) {
|
|
33
|
-
single.description = value;
|
|
34
|
-
} else {
|
|
32
|
+
single.description = await ctx.cache.tryGet(link, async () => {
|
|
35
33
|
const response = await got.get(link);
|
|
36
34
|
const $ = cheerio.load(response.data);
|
|
37
|
-
$('.detail_ent
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
$img.attr('src', 'https:' + src);
|
|
41
|
-
});
|
|
42
|
-
single.description = $('.detail_ent').html();
|
|
43
|
-
ctx.cache.set(key, single.description);
|
|
44
|
-
}
|
|
45
|
-
return Promise.resolve(single);
|
|
35
|
+
return $('.detail_ent').html();
|
|
36
|
+
});
|
|
37
|
+
return single;
|
|
46
38
|
})
|
|
47
39
|
.get()
|
|
48
40
|
);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
const categories = {
|
|
7
|
+
nba: 'NBA',
|
|
8
|
+
zuqiu: '足球',
|
|
9
|
+
dianjing: '电竞',
|
|
10
|
+
other: '综合',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports = async (ctx) => {
|
|
14
|
+
const category = ctx.params.category ?? 'nba';
|
|
15
|
+
|
|
16
|
+
const rootUrl = 'https://news.zhibo8.cc';
|
|
17
|
+
|
|
18
|
+
let list,
|
|
19
|
+
apiUrl = '',
|
|
20
|
+
currentUrl = '',
|
|
21
|
+
response;
|
|
22
|
+
|
|
23
|
+
if (category === 'nba' || category === 'zuqiu') {
|
|
24
|
+
currentUrl = `${rootUrl}/${category}/more.htm`;
|
|
25
|
+
|
|
26
|
+
response = await got({
|
|
27
|
+
method: 'get',
|
|
28
|
+
url: currentUrl,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const $ = cheerio.load(response.data);
|
|
32
|
+
|
|
33
|
+
list = $('ul.articleList li')
|
|
34
|
+
.slice(0, 30)
|
|
35
|
+
.map((_, item) => {
|
|
36
|
+
item = $(item);
|
|
37
|
+
const a = item.find('a');
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
title: a.text(),
|
|
41
|
+
link: `http:${a.attr('href')}`,
|
|
42
|
+
pubDate: timezone(parseDate(item.find('span.postTime').text()), +8),
|
|
43
|
+
};
|
|
44
|
+
})
|
|
45
|
+
.get();
|
|
46
|
+
} else {
|
|
47
|
+
currentUrl = `${rootUrl}/${category}`;
|
|
48
|
+
apiUrl = `https://api.qiumibao.com/application/app/index.php?_url=/news/${category}List`;
|
|
49
|
+
|
|
50
|
+
response = await got({
|
|
51
|
+
method: 'get',
|
|
52
|
+
url: apiUrl,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
list = response.data.data.list.map((item) => ({
|
|
56
|
+
title: item.title,
|
|
57
|
+
link: `https:${item.url}`,
|
|
58
|
+
pubDate: timezone(parseDate(item.createtime), +8),
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const items = await Promise.all(
|
|
63
|
+
list.map((item) =>
|
|
64
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
65
|
+
const res = await got({
|
|
66
|
+
method: 'get',
|
|
67
|
+
url: item.link,
|
|
68
|
+
});
|
|
69
|
+
const content = cheerio.load(res.data);
|
|
70
|
+
|
|
71
|
+
item.description = content('div.content').html();
|
|
72
|
+
return item;
|
|
73
|
+
})
|
|
74
|
+
)
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
ctx.state.data = {
|
|
78
|
+
title: `${categories[category]} - 直播吧`,
|
|
79
|
+
link: currentUrl,
|
|
80
|
+
item: items,
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'zhibo8.cc': {
|
|
3
|
+
_name: '直播吧',
|
|
4
|
+
bbs: [
|
|
5
|
+
{
|
|
6
|
+
title: '子论坛',
|
|
7
|
+
docs: 'https://docs.rsshub.app/bbs.html#zhi-bo-ba',
|
|
8
|
+
source: ['/'],
|
|
9
|
+
target: (_params, url) => `/zhibo8/forum/${new URL(url).searchParams.get('fid')}`,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '回帖',
|
|
13
|
+
docs: 'https://docs.rsshub.app/bbs.html#zhi-bo-ba',
|
|
14
|
+
source: ['/'],
|
|
15
|
+
target: (_params, url) => `/zhibo8/post/${new URL(url).searchParams.get('tid')}`,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
news: [
|
|
19
|
+
{
|
|
20
|
+
title: '滚动新闻',
|
|
21
|
+
docs: 'https://docs.rsshub.app/bbs.html#zhi-bo-ba',
|
|
22
|
+
source: ['/:category'],
|
|
23
|
+
target: '/zhibo8/more/:category',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsshub",
|
|
3
|
-
"version": "1.0.0-master.
|
|
3
|
+
"version": "1.0.0-master.fee75c6",
|
|
4
4
|
"description": "Make RSS Great Again!",
|
|
5
5
|
"main": "lib/pkg.js",
|
|
6
6
|
"files": [
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"@vuepress/plugin-pwa": "1.9.7",
|
|
51
51
|
"ci-info": "3.3.0",
|
|
52
52
|
"cross-env": "7.0.3",
|
|
53
|
-
"eslint": "8.
|
|
54
|
-
"eslint-config-prettier": "8.
|
|
53
|
+
"eslint": "8.10.0",
|
|
54
|
+
"eslint-config-prettier": "8.5.0",
|
|
55
55
|
"eslint-plugin-prettier": "4.0.0",
|
|
56
56
|
"eslint-plugin-yml": "0.14.0",
|
|
57
|
-
"fs-extra": "10.0.
|
|
57
|
+
"fs-extra": "10.0.1",
|
|
58
58
|
"jest": "27.5.1",
|
|
59
59
|
"mockdate": "3.0.5",
|
|
60
60
|
"nock": "13.2.4",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@koa/router": "10.1.1",
|
|
80
80
|
"@postlight/mercury-parser": "2.2.1",
|
|
81
|
-
"@sentry/node": "6.
|
|
81
|
+
"@sentry/node": "6.18.1",
|
|
82
82
|
"aes-js": "3.1.2",
|
|
83
83
|
"art-template": "4.13.2",
|
|
84
84
|
"bbcodejs": "0.0.4",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"city-timezones": "1.2.0",
|
|
88
88
|
"crypto-js": "4.1.1",
|
|
89
89
|
"currency-symbol-map": "5.0.1",
|
|
90
|
-
"dayjs": "1.10.
|
|
90
|
+
"dayjs": "1.10.8",
|
|
91
91
|
"dotenv": "16.0.0",
|
|
92
92
|
"emailjs-imap-client": "3.1.0",
|
|
93
93
|
"entities": "3.0.1",
|
|
@@ -118,11 +118,11 @@
|
|
|
118
118
|
"parse-torrent": "9.1.4",
|
|
119
119
|
"pidusage": "3.0.0",
|
|
120
120
|
"plist": "3.0.4",
|
|
121
|
-
"puppeteer": "
|
|
121
|
+
"puppeteer": "13.4.1",
|
|
122
122
|
"query-string": "7.1.1",
|
|
123
123
|
"require-all": "3.0.0",
|
|
124
124
|
"rss-parser": "3.12.0",
|
|
125
|
-
"showdown": "2.0.
|
|
125
|
+
"showdown": "2.0.1",
|
|
126
126
|
"simplecc-wasm": "0.1.4",
|
|
127
127
|
"socks-proxy-agent": "6.1.1",
|
|
128
128
|
"string-similarity": "4.0.4",
|
|
@@ -131,7 +131,8 @@
|
|
|
131
131
|
"tough-cookie": "4.0.0",
|
|
132
132
|
"tunnel": "0.0.6",
|
|
133
133
|
"twit": "2.2.11",
|
|
134
|
-
"winston": "3.
|
|
134
|
+
"winston": "3.6.0",
|
|
135
|
+
"xml2js": "0.4.23"
|
|
135
136
|
},
|
|
136
137
|
"jest": {
|
|
137
138
|
"testMatch": [
|