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
package/lib/routes/36kr/news.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
const url = require('url');
|
|
2
|
-
const got = require('@/utils/got');
|
|
3
|
-
const cheerio = require('cheerio');
|
|
4
|
-
|
|
5
|
-
const config = {
|
|
6
|
-
latest: {
|
|
7
|
-
link: '/information/web_news/latest',
|
|
8
|
-
title: '最新',
|
|
9
|
-
},
|
|
10
|
-
recommend: {
|
|
11
|
-
link: '/information/web_recommend',
|
|
12
|
-
title: '推荐',
|
|
13
|
-
},
|
|
14
|
-
contact: {
|
|
15
|
-
link: '/information/contact',
|
|
16
|
-
title: '创投',
|
|
17
|
-
},
|
|
18
|
-
ccs: {
|
|
19
|
-
link: '/information/ccs',
|
|
20
|
-
title: '中概股',
|
|
21
|
-
},
|
|
22
|
-
travel: {
|
|
23
|
-
link: '/information/travel',
|
|
24
|
-
title: '汽车',
|
|
25
|
-
},
|
|
26
|
-
technology: {
|
|
27
|
-
link: '/technology',
|
|
28
|
-
title: '科技',
|
|
29
|
-
},
|
|
30
|
-
enterpriseservice: {
|
|
31
|
-
link: '/information/enterpriseservice',
|
|
32
|
-
title: '企服',
|
|
33
|
-
},
|
|
34
|
-
banking: {
|
|
35
|
-
link: '/information/banking',
|
|
36
|
-
title: '金融',
|
|
37
|
-
},
|
|
38
|
-
life: {
|
|
39
|
-
link: '/information/happy_life',
|
|
40
|
-
title: '生活',
|
|
41
|
-
},
|
|
42
|
-
innovate: {
|
|
43
|
-
link: '/information/innovate',
|
|
44
|
-
title: '创新',
|
|
45
|
-
},
|
|
46
|
-
estate: {
|
|
47
|
-
link: '/information/real_estate',
|
|
48
|
-
title: '房产',
|
|
49
|
-
},
|
|
50
|
-
workplace: {
|
|
51
|
-
link: '/information/web_zhichang',
|
|
52
|
-
title: '职场',
|
|
53
|
-
},
|
|
54
|
-
other: {
|
|
55
|
-
link: '/information/other',
|
|
56
|
-
title: '其他',
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
module.exports = async (ctx) => {
|
|
61
|
-
const cfg = config[ctx.params.caty];
|
|
62
|
-
if (!cfg) {
|
|
63
|
-
throw Error('Bad category. See <a href="https://docs.rsshub.app/government.html#bei-jing-shi-wei-sheng-jian-kang-wei-yuan-hui">docs</a>');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const newsUrl = url.resolve(`https://36kr.com/`, cfg.link);
|
|
67
|
-
const response = await got({
|
|
68
|
-
method: 'get',
|
|
69
|
-
url: newsUrl,
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const data = JSON.parse(response.data.match(/<script>window\.initialState=(.*?)<\/script>/)[1]);
|
|
73
|
-
|
|
74
|
-
const informationList = data.information.informationList.itemList.map((item) => ({
|
|
75
|
-
title: item.templateMaterial.widgetTitle,
|
|
76
|
-
link: `https://36kr.com/p/${item.itemId}`,
|
|
77
|
-
pubDate: new Date(item.templateMaterial.publishTime).toUTCString(),
|
|
78
|
-
}));
|
|
79
|
-
|
|
80
|
-
ctx.state.data = {
|
|
81
|
-
title: `36氪资讯 - ${cfg.title}`,
|
|
82
|
-
link: newsUrl,
|
|
83
|
-
item: await Promise.all(
|
|
84
|
-
informationList.map((item) =>
|
|
85
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
86
|
-
const contentResponse = await got({ method: 'get', url: item.link });
|
|
87
|
-
const content = cheerio.load(contentResponse.data);
|
|
88
|
-
item.description = content('div.common-width.content.articleDetailContent.kr-rich-text-wrapper').html();
|
|
89
|
-
return item;
|
|
90
|
-
})
|
|
91
|
-
)
|
|
92
|
-
),
|
|
93
|
-
};
|
|
94
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const Cheerio = require('cheerio');
|
|
2
|
-
const got = require('got');
|
|
3
|
-
async function loadArticle(link) {
|
|
4
|
-
const resp = await got(link);
|
|
5
|
-
const article = Cheerio.load(resp.body);
|
|
6
|
-
const title = article('.entry-title').text();
|
|
7
|
-
const entry_children = article('div.entry-content').children().toArray();
|
|
8
|
-
const imgs = Cheerio.load(entry_children.shift()).text(); // 去除懒加载代码减少返回体积
|
|
9
|
-
const txt = Cheerio.load(entry_children).html();
|
|
10
|
-
return {
|
|
11
|
-
title,
|
|
12
|
-
description: imgs.concat(txt),
|
|
13
|
-
pubDate: article('time')[0].attribs.datetime.replace('>', ''),
|
|
14
|
-
link,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
module.exports = loadArticle;
|
package/lib/routes/8kcos/cat.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const got = require('got');
|
|
2
|
-
const Cheerio = require('cheerio');
|
|
3
|
-
const { SUB_NAME_PREFIX, SUB_URL } = require('./const');
|
|
4
|
-
const loadArticle = require('./article');
|
|
5
|
-
module.exports = async (ctx) => {
|
|
6
|
-
const { cat = '8kasianidol' } = ctx.params;
|
|
7
|
-
const url = `${SUB_URL}category/${cat}/`;
|
|
8
|
-
const resp = await got(url);
|
|
9
|
-
const $ = Cheerio.load(resp.body);
|
|
10
|
-
ctx.state.data = resp.body
|
|
11
|
-
? {
|
|
12
|
-
title: `${SUB_NAME_PREFIX}-${$('#wrap > div > div > div > div.sec-panel-head > h1 > span').text()}`,
|
|
13
|
-
link: url,
|
|
14
|
-
item: await Promise.all(
|
|
15
|
-
Cheerio.load(resp.body)('#wrap > div > div > div > ul > li.item')
|
|
16
|
-
.map((_, e) => {
|
|
17
|
-
const { href } = Cheerio.load(e)('h2 > a')[0].attribs;
|
|
18
|
-
return ctx.cache.tryGet(href, () => loadArticle(href));
|
|
19
|
-
})
|
|
20
|
-
.toArray()
|
|
21
|
-
),
|
|
22
|
-
}
|
|
23
|
-
: {
|
|
24
|
-
title: `${SUB_NAME_PREFIX}-${cat}`,
|
|
25
|
-
link: url,
|
|
26
|
-
item: [{ title: '获取失败' }],
|
|
27
|
-
};
|
|
28
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const got = require('got');
|
|
2
|
-
const Cheerio = require('cheerio');
|
|
3
|
-
const { SUB_NAME_PREFIX, SUB_URL } = require('./const');
|
|
4
|
-
const loadArticle = require('./article');
|
|
5
|
-
const url = SUB_URL;
|
|
6
|
-
|
|
7
|
-
module.exports = async (ctx) => {
|
|
8
|
-
const response = await got(url);
|
|
9
|
-
ctx.state.data = {
|
|
10
|
-
title: `${SUB_NAME_PREFIX}-最新`,
|
|
11
|
-
link: url,
|
|
12
|
-
item: response.body
|
|
13
|
-
? await Promise.all(
|
|
14
|
-
Cheerio.load(response.body)('#wrap > div > div > div > ul > li.item')
|
|
15
|
-
.map((_, e) => {
|
|
16
|
-
const { href } = Cheerio.load(e)('div > h2 > a')[0].attribs;
|
|
17
|
-
return ctx.cache.tryGet(href, () => loadArticle(href));
|
|
18
|
-
})
|
|
19
|
-
.toArray()
|
|
20
|
-
)
|
|
21
|
-
: [
|
|
22
|
-
{
|
|
23
|
-
title: '获取失败!',
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
};
|
|
27
|
-
};
|
package/lib/routes/95mm/tab.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const utils = require('./utils');
|
|
2
|
-
|
|
3
|
-
module.exports = async (ctx) => {
|
|
4
|
-
ctx.params.tab = ctx.params.tab || '最新';
|
|
5
|
-
|
|
6
|
-
const rootUrl = `https://www.95mm.net/home-ajax/index.html?tabcid=${ctx.params.tab}&page=1`;
|
|
7
|
-
|
|
8
|
-
ctx.state.data = await utils(ctx, ctx.params.tab, rootUrl);
|
|
9
|
-
};
|
package/lib/routes/95mm/tag.js
DELETED
package/lib/routes/95mm/utils.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx, title, rootUrl) => {
|
|
5
|
-
const response = await got({
|
|
6
|
-
method: 'get',
|
|
7
|
-
url: rootUrl,
|
|
8
|
-
header: {
|
|
9
|
-
Referer: 'https://www.95mm.net',
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
const $ = cheerio.load(response.data);
|
|
14
|
-
|
|
15
|
-
const list = $('div.list-body')
|
|
16
|
-
.map((_, item) => {
|
|
17
|
-
item = $(item);
|
|
18
|
-
const a = item.find('a');
|
|
19
|
-
return {
|
|
20
|
-
title: a.text(),
|
|
21
|
-
link: a.attr('href'),
|
|
22
|
-
};
|
|
23
|
-
})
|
|
24
|
-
.get();
|
|
25
|
-
|
|
26
|
-
const items = await Promise.all(
|
|
27
|
-
list.map((item) =>
|
|
28
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
29
|
-
const detailResponse = await got({
|
|
30
|
-
method: 'get',
|
|
31
|
-
url: item.link,
|
|
32
|
-
});
|
|
33
|
-
const images = detailResponse.data.match(/src": '(.*?)',"width/g);
|
|
34
|
-
|
|
35
|
-
item.description = '';
|
|
36
|
-
|
|
37
|
-
for (const i of images) {
|
|
38
|
-
item.description += `<img src="${i.split("'")[1]}">`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return item;
|
|
42
|
-
})
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
title: `${title} - MM范`,
|
|
48
|
-
link: rootUrl,
|
|
49
|
-
item: items,
|
|
50
|
-
};
|
|
51
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const url = require('url');
|
|
4
|
-
|
|
5
|
-
const host = 'https://support.apple.com/';
|
|
6
|
-
|
|
7
|
-
module.exports = async (ctx) => {
|
|
8
|
-
const country = ctx.params.country || '';
|
|
9
|
-
const link = url.resolve(host, `${country}/exchange_repair/`);
|
|
10
|
-
|
|
11
|
-
const response = await got.get(link);
|
|
12
|
-
const $ = cheerio.load(response.data);
|
|
13
|
-
const list = $('section.as-columns').get().slice(0, 5);
|
|
14
|
-
|
|
15
|
-
const out = await Promise.all(
|
|
16
|
-
list.map(async (item) => {
|
|
17
|
-
const $ = cheerio.load(item);
|
|
18
|
-
const $a = $('.icon-chevronright').parent();
|
|
19
|
-
const itemUrl = url.resolve(host, $a.attr('href'));
|
|
20
|
-
|
|
21
|
-
const cache = await ctx.cache.get(itemUrl);
|
|
22
|
-
if (cache) {
|
|
23
|
-
return Promise.resolve(JSON.parse(cache));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const response = await got.get(itemUrl);
|
|
27
|
-
const $$ = cheerio.load(response.data);
|
|
28
|
-
const description = $$('.main').html();
|
|
29
|
-
|
|
30
|
-
const single = {
|
|
31
|
-
title: $a.text(),
|
|
32
|
-
link: itemUrl,
|
|
33
|
-
author: 'Apple Inc.',
|
|
34
|
-
description,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
ctx.cache.set(itemUrl, JSON.stringify(single));
|
|
38
|
-
return Promise.resolve(single);
|
|
39
|
-
})
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
ctx.state.data = {
|
|
43
|
-
title: `Apple - ${$('.main>.richText h1').text()}`,
|
|
44
|
-
link,
|
|
45
|
-
item: out,
|
|
46
|
-
};
|
|
47
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
|
|
3
|
-
module.exports = async (ctx) => {
|
|
4
|
-
const uid = ctx.params.uid;
|
|
5
|
-
const response = await got({
|
|
6
|
-
method: 'get',
|
|
7
|
-
headers: {
|
|
8
|
-
Accept: '*/*',
|
|
9
|
-
Host: 'i.eastmoney.com',
|
|
10
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
11
|
-
'Cache-Control': 'no-cache',
|
|
12
|
-
},
|
|
13
|
-
url: `https://i.eastmoney.com/api/ta/UserPostList?p=1&ps=20&uid=${uid}`,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const data = response.data.data.re;
|
|
17
|
-
const username = data[0].post_user.user_nickname;
|
|
18
|
-
|
|
19
|
-
ctx.state.data = {
|
|
20
|
-
title: `天天基金-${username}的主页`,
|
|
21
|
-
link: `https://i.eastmoney.com//${uid}`,
|
|
22
|
-
description: `${username} 的 动态`,
|
|
23
|
-
item: data.map((item) => ({
|
|
24
|
-
title: item.post_title,
|
|
25
|
-
description: item.post_content,
|
|
26
|
-
pubDate: item.post_display_time,
|
|
27
|
-
link: `http://guba.eastmoney.com/news,${item.code_name},${item.post_id}.html`,
|
|
28
|
-
})),
|
|
29
|
-
};
|
|
30
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
|
|
3
|
-
module.exports = async (ctx) => {
|
|
4
|
-
const blogdomain = `${ctx.params.username}.lofter.com`;
|
|
5
|
-
const response = await got({
|
|
6
|
-
method: 'post',
|
|
7
|
-
url: `http://api.lofter.com/v2.0/blogHomePage.api?product=lofter-iphone-6.8.2`,
|
|
8
|
-
headers: {
|
|
9
|
-
Host: 'api.lofter.com',
|
|
10
|
-
'User-Agent': 'LOFTER/6.8.2 (iPhone; iOS 13.4; Scale/2.00)',
|
|
11
|
-
},
|
|
12
|
-
form: {
|
|
13
|
-
blogdomain,
|
|
14
|
-
checkpwd: '1',
|
|
15
|
-
following: '0',
|
|
16
|
-
limit: '15',
|
|
17
|
-
method: 'getPostLists',
|
|
18
|
-
needgetpoststat: '1',
|
|
19
|
-
offset: '0',
|
|
20
|
-
postdigestnew: '1',
|
|
21
|
-
supportposttypes: '1,2,3,4,5,6',
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
if (!response.data.response || response.data.response.posts.length === 0) {
|
|
25
|
-
throw 'Blog Not Found';
|
|
26
|
-
}
|
|
27
|
-
const data = response.data.response.posts;
|
|
28
|
-
const blogNickName = data[0].post.blogInfo.blogNickName;
|
|
29
|
-
const selfIntro = data[0].post.blogInfo.selfIntro;
|
|
30
|
-
|
|
31
|
-
ctx.state.data = {
|
|
32
|
-
title: `${blogNickName} - lofter`,
|
|
33
|
-
link: `https://${blogdomain}`,
|
|
34
|
-
description: selfIntro,
|
|
35
|
-
item: data.map((item) => {
|
|
36
|
-
let content = item.post.content;
|
|
37
|
-
const title = item.post.title || item.post.noticeLinkTitle;
|
|
38
|
-
const photos = JSON.parse(item.post.photoLinks || `[]`);
|
|
39
|
-
const images = [];
|
|
40
|
-
photos.forEach((photo) => {
|
|
41
|
-
images.push(`<p><img src="${photo.raw}"/></p>`);
|
|
42
|
-
});
|
|
43
|
-
content = `${content}${images.join('')}`;
|
|
44
|
-
return {
|
|
45
|
-
title,
|
|
46
|
-
description: content,
|
|
47
|
-
pubDate: new Date(item.post.publishTime).toUTCString(),
|
|
48
|
-
link: item.post.blogPageUrl,
|
|
49
|
-
guid: item.post.blogPageUrl,
|
|
50
|
-
author: blogNickName,
|
|
51
|
-
};
|
|
52
|
-
}),
|
|
53
|
-
};
|
|
54
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const cheerio = require('cheerio');
|
|
2
|
-
const got = require('@/utils/got');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const url = 'http://www.nbd.com.cn/columns/332';
|
|
6
|
-
const response = await got({
|
|
7
|
-
method: 'get',
|
|
8
|
-
url,
|
|
9
|
-
headers: {
|
|
10
|
-
Referer: 'http://www.nbd.com.cn',
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const $ = cheerio.load(response.data);
|
|
15
|
-
const $list = $('li.u-news-title').slice(0, 15).get();
|
|
16
|
-
const description = $('head title').text().trim();
|
|
17
|
-
|
|
18
|
-
const resultItem = await Promise.all(
|
|
19
|
-
$list.map(async (item) => {
|
|
20
|
-
const title = $(item).find('a').text().trim();
|
|
21
|
-
const pubDate = $(item).find('span').text().trim();
|
|
22
|
-
const itemUrl = $(item).find('a').attr('href');
|
|
23
|
-
|
|
24
|
-
const single = {
|
|
25
|
-
title,
|
|
26
|
-
link: itemUrl,
|
|
27
|
-
pubDate,
|
|
28
|
-
description: '',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const cache = await ctx.cache.get(itemUrl);
|
|
32
|
-
if (cache) {
|
|
33
|
-
return Promise.resolve(JSON.parse(cache));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const detail = await got({
|
|
37
|
-
method: 'get',
|
|
38
|
-
url: itemUrl,
|
|
39
|
-
headers: {
|
|
40
|
-
Referer: 'http://www.nbd.com.cn',
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
const $ = cheerio.load(detail.data);
|
|
46
|
-
single.description = $('div.g-article').html();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
ctx.cache.set(itemUrl, JSON.stringify(single));
|
|
50
|
-
return Promise.resolve(single);
|
|
51
|
-
})
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
ctx.state.data = {
|
|
55
|
-
title: '重磅原创-每经网',
|
|
56
|
-
link: url,
|
|
57
|
-
item: resultItem,
|
|
58
|
-
description,
|
|
59
|
-
};
|
|
60
|
-
};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const chrono = require('chrono-node');
|
|
4
|
-
|
|
5
|
-
module.exports = async (ctx) => {
|
|
6
|
-
const id = ctx.params.id;
|
|
7
|
-
const displayVideo = !!ctx.params.displayVideo;
|
|
8
|
-
|
|
9
|
-
const url = `https://www.picuki.com/profile/${id}`;
|
|
10
|
-
|
|
11
|
-
const response = await got.get(url);
|
|
12
|
-
const $ = cheerio.load(response.data);
|
|
13
|
-
|
|
14
|
-
const profile_name = $('.profile-name-bottom').text();
|
|
15
|
-
const profile_img = $('.profile-avatar > img').attr('src');
|
|
16
|
-
const profile_description = $('.profile-description').text();
|
|
17
|
-
|
|
18
|
-
const list = $('ul.box-photos [data-s="media"]').get();
|
|
19
|
-
|
|
20
|
-
async function getMedia(url) {
|
|
21
|
-
const response = await got.get(url);
|
|
22
|
-
const $ = cheerio.load(response.data);
|
|
23
|
-
// Instagram 允许最多 10 条图片/视频任意混合于一条 post,picuki 在所有情况下都会将它(们)置于 .single-photo 内
|
|
24
|
-
const media_items = $('.single-photo img,video').get();
|
|
25
|
-
let html = '';
|
|
26
|
-
media_items.forEach((item) => {
|
|
27
|
-
item = $(item);
|
|
28
|
-
html += item.toString(); // 可能是视频,也可能是图片,格式都比较友好,这里直接添加
|
|
29
|
-
});
|
|
30
|
-
return html;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function deVideo(media) {
|
|
34
|
-
const $ = cheerio.load(media);
|
|
35
|
-
const media_list = $('img,video').get();
|
|
36
|
-
let media_deVideo = '';
|
|
37
|
-
media_list.forEach((medium) => {
|
|
38
|
-
medium = $(medium);
|
|
39
|
-
const poster = medium.attr('poster');
|
|
40
|
-
// 如果有 poster 属性,表明它是视频,将它替换为它的 poster;如果不是,就原样返回
|
|
41
|
-
media_deVideo += poster ? `<img src='${poster}' alt='video poster'>` : medium.toString();
|
|
42
|
-
});
|
|
43
|
-
return media_deVideo;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const items = await Promise.all(
|
|
47
|
-
list.map(async (post) => {
|
|
48
|
-
post = $(post);
|
|
49
|
-
|
|
50
|
-
const post_link = post.find('.photo > a').attr('href');
|
|
51
|
-
const cache = await ctx.cache.get(post_link);
|
|
52
|
-
|
|
53
|
-
let cache_d;
|
|
54
|
-
if (cache) {
|
|
55
|
-
cache_d = JSON.parse(cache);
|
|
56
|
-
} else {
|
|
57
|
-
const post_description = post.find('.photo-description').text().trim();
|
|
58
|
-
const post_time = post.find('.time');
|
|
59
|
-
const media_displayVideo = await getMedia(post_link);
|
|
60
|
-
const media = deVideo(media_displayVideo);
|
|
61
|
-
|
|
62
|
-
cache_d = {
|
|
63
|
-
title: post_description || 'Untitled',
|
|
64
|
-
author: `@${id}`,
|
|
65
|
-
media_prefix: media,
|
|
66
|
-
media_displayVideo_prefix: media_displayVideo,
|
|
67
|
-
description_body: post_description.length > 100 ? `<p>${post_description}</p>` : '',
|
|
68
|
-
link: post_link,
|
|
69
|
-
pubDate: post_time ? chrono.parseDate(post_time.text()) : new Date(),
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
ctx.cache.set(post_link, JSON.stringify(cache_d));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
cache_d.description = (displayVideo ? cache_d.media_displayVideo_prefix : cache_d.media_prefix) + cache_d.description_body;
|
|
76
|
-
delete cache_d.media_prefix;
|
|
77
|
-
delete cache_d.media_displayVideo_prefix;
|
|
78
|
-
delete cache_d.description_body;
|
|
79
|
-
return cache_d;
|
|
80
|
-
})
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
ctx.state.data = {
|
|
84
|
-
title: `${profile_name} (@${id}) - Picuki`,
|
|
85
|
-
link: url,
|
|
86
|
-
image: profile_img,
|
|
87
|
-
description: profile_description,
|
|
88
|
-
item: items,
|
|
89
|
-
};
|
|
90
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const dayjs = require('dayjs');
|
|
3
|
-
|
|
4
|
-
module.exports = async (ctx) => {
|
|
5
|
-
const category = ctx.params.category;
|
|
6
|
-
|
|
7
|
-
let title;
|
|
8
|
-
let link;
|
|
9
|
-
let path = category;
|
|
10
|
-
switch (category) {
|
|
11
|
-
case 'topic':
|
|
12
|
-
title = '热门话题';
|
|
13
|
-
link = 'https://readhub.cn/topics';
|
|
14
|
-
break;
|
|
15
|
-
case 'news':
|
|
16
|
-
title = '科技动态';
|
|
17
|
-
link = 'https://readhub.cn/news';
|
|
18
|
-
break;
|
|
19
|
-
case 'technews':
|
|
20
|
-
title = '开发者资讯';
|
|
21
|
-
link = 'https://readhub.cn/tech';
|
|
22
|
-
break;
|
|
23
|
-
case 'blockchain':
|
|
24
|
-
title = '区块链快讯';
|
|
25
|
-
link = 'https://readhub.cn/blockchain';
|
|
26
|
-
break;
|
|
27
|
-
case 'daily':
|
|
28
|
-
title = '每日早报';
|
|
29
|
-
link = 'https://readhub.cn/daily';
|
|
30
|
-
break;
|
|
31
|
-
default:
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (path === 'daily') {
|
|
36
|
-
path = 'topic/daily';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const {
|
|
40
|
-
data: { data },
|
|
41
|
-
} = await got({
|
|
42
|
-
method: 'get',
|
|
43
|
-
url: `https://api.readhub.cn/${path}`,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const out = await Promise.all(
|
|
47
|
-
data.map(async (news) => {
|
|
48
|
-
const id = news.id;
|
|
49
|
-
let item;
|
|
50
|
-
if (category === 'topic' || category === 'daily') {
|
|
51
|
-
const link = `https://readhub.cn/topic/${id}`;
|
|
52
|
-
const cache = await ctx.cache.get(link);
|
|
53
|
-
if (cache) {
|
|
54
|
-
return Promise.resolve(JSON.parse(cache));
|
|
55
|
-
}
|
|
56
|
-
const { data } = await got.get(`https://api.readhub.cn/topic/${id}`);
|
|
57
|
-
let description = data.summary;
|
|
58
|
-
if (data.newsArray) {
|
|
59
|
-
description += '<br/><br/>媒体报道:';
|
|
60
|
-
for (const one of data.newsArray) {
|
|
61
|
-
description += `<br/>${dayjs(new Date(one.publishDate)).format('YY-MM-DD')} ${one.siteName}: <a href='${one.mobileUrl || one.url}'>${one.title}</a>`;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (data.timeline && data.timeline.topics) {
|
|
65
|
-
let type = '相关事件';
|
|
66
|
-
if (data.timeline.commonEntities && data.timeline.commonEntities.length > 0) {
|
|
67
|
-
type = '事件追踪';
|
|
68
|
-
}
|
|
69
|
-
description += `<br/><br/>${type}:`;
|
|
70
|
-
for (const one of data.timeline.topics) {
|
|
71
|
-
description += `<br/>${dayjs(new Date(one.createdAt)).format('YY-MM-DD')} <a href='https://readhub.cn/topic/${one.id}'>${one.title.trim()}</a>`;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
item = {
|
|
75
|
-
title: data.title,
|
|
76
|
-
description: description.replace(new RegExp('\n', 'g'), '<br/>'),
|
|
77
|
-
pubDate: data.publishDate,
|
|
78
|
-
guid: id,
|
|
79
|
-
link,
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
ctx.cache.set(link, JSON.stringify(item));
|
|
83
|
-
} else {
|
|
84
|
-
const description = news.summaryAuto || news.summary || news.title;
|
|
85
|
-
item = {
|
|
86
|
-
title: news.title,
|
|
87
|
-
description: description.replace(new RegExp('\n', 'g'), '<br/>'),
|
|
88
|
-
pubDate: news.publishDate,
|
|
89
|
-
guid: id,
|
|
90
|
-
link: news.url || news.mobileUrl,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
return item;
|
|
94
|
-
})
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
ctx.state.data = {
|
|
98
|
-
title: `Readhub - ${title}`,
|
|
99
|
-
link,
|
|
100
|
-
item: out,
|
|
101
|
-
};
|
|
102
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const got = require('@/utils/got');
|
|
2
|
-
const cheerio = require('cheerio');
|
|
3
|
-
const url = require('url');
|
|
4
|
-
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
-
|
|
6
|
-
const host = 'https://www.who.int/';
|
|
7
|
-
|
|
8
|
-
module.exports = async (ctx) => {
|
|
9
|
-
const type = ctx.params.type;
|
|
10
|
-
|
|
11
|
-
const link = url.resolve('https://www.who.int/zh/news-room/', type);
|
|
12
|
-
const response = await got.get(encodeURI(link));
|
|
13
|
-
const $ = cheerio.load(response.data);
|
|
14
|
-
|
|
15
|
-
const list = $('div.list-view--item');
|
|
16
|
-
const title = $('ul.sf-breadscrumb.breadcrumb li.active').text();
|
|
17
|
-
const out = await Promise.all(
|
|
18
|
-
list
|
|
19
|
-
.map(async (index, elem) => {
|
|
20
|
-
const $elem = $(elem);
|
|
21
|
-
const title = $elem.find('p').text();
|
|
22
|
-
const link = url.resolve(host, $elem.find('a').attr('href'));
|
|
23
|
-
const pubDate = parseDate($elem.find('.timestamp').text(), 'YYYY年M月D日');
|
|
24
|
-
|
|
25
|
-
const item = {
|
|
26
|
-
title,
|
|
27
|
-
pubDate,
|
|
28
|
-
link: encodeURI(link),
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const key = link;
|
|
32
|
-
const value = await ctx.cache.get(key);
|
|
33
|
-
if (value) {
|
|
34
|
-
item.description = value;
|
|
35
|
-
} else {
|
|
36
|
-
const detail = await got.get(item.link);
|
|
37
|
-
const data = detail.data;
|
|
38
|
-
const $ = cheerio.load(data);
|
|
39
|
-
|
|
40
|
-
item.description = $('article')
|
|
41
|
-
.html()
|
|
42
|
-
.replace(/src="\//g, `src="${host}`);
|
|
43
|
-
ctx.cache.set(key, item.description);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return item;
|
|
47
|
-
})
|
|
48
|
-
.get()
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
ctx.state.data = {
|
|
52
|
-
title: `世界卫生组织媒体中心-${title}`,
|
|
53
|
-
link,
|
|
54
|
-
item: out,
|
|
55
|
-
};
|
|
56
|
-
};
|