rsshub 1.0.0-master.d65e83a → 1.0.0-master.d72dce4
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 +3 -0
- package/lib/middleware/parameter.js +5 -3
- package/lib/radar-rules.js +0 -187
- package/lib/router.js +40 -100
- package/lib/routes/bookwalkertw/news.js +2 -2
- package/lib/routes/coolapk/utils.js +2 -0
- package/lib/routes/dongqiudi/result.js +13 -25
- package/lib/routes/dsndsht23/index.js +1 -1
- package/lib/routes/eastday/sh.js +4 -12
- package/lib/routes/ehentai/ehapi.js +0 -1
- package/lib/routes/{flyertea → flyert}/creditcard.js +3 -2
- package/lib/routes/{flyertea → flyert}/preferential.js +2 -2
- package/lib/routes/{flyertea → flyert}/utils.js +5 -5
- package/lib/routes/futunn/highlights.js +39 -37
- package/lib/routes/gamer/gnn_index.js +1 -1
- package/lib/routes/mi/youpin/new.js +13 -31
- package/lib/routes/mirror/entries.js +80 -0
- package/lib/routes/universities/sjtu/jwc.js +51 -53
- package/lib/routes/vgn/index.js +1 -1
- package/lib/routes/who/news-room.js +2 -2
- package/lib/routes/yxdzqb/index.js +5 -5
- package/lib/routes/zhihu/collection.js +26 -2
- package/lib/routes/zhihu/pin/utils.js +17 -7
- package/lib/routes/zhihu/posts.js +2 -1
- package/lib/routes/zhihu/topic.js +10 -2
- package/lib/routes/zhihu/zhuanlan.js +12 -1
- package/lib/v2/abmedia/category.js +30 -0
- package/lib/v2/abmedia/index.js +26 -0
- package/lib/v2/abmedia/maintainer.js +3 -0
- package/lib/v2/abmedia/radar.js +19 -0
- package/lib/v2/abmedia/router.js +4 -0
- package/lib/v2/acm-ecnu/contest.js +44 -0
- package/lib/v2/acm-ecnu/maintainer.js +3 -0
- package/lib/v2/acm-ecnu/radar.js +19 -0
- package/lib/v2/acm-ecnu/router.js +3 -0
- package/lib/v2/acm-ecnu/templates/description.art +3 -0
- package/lib/v2/agirls/index.js +71 -0
- package/lib/v2/agirls/maintainer.js +5 -0
- package/lib/v2/agirls/radar.js +25 -0
- package/lib/v2/agirls/router.js +5 -0
- package/lib/v2/agirls/templates/description.art +1 -0
- package/lib/v2/agirls/topic.js +71 -0
- package/lib/v2/agirls/topic_list.js +44 -0
- package/lib/v2/appledaily/index.js +69 -0
- package/lib/v2/appledaily/maintainer.js +3 -0
- package/lib/v2/appledaily/radar.js +157 -0
- package/lib/v2/appledaily/router.js +3 -0
- package/lib/v2/appledaily/templates/content.art +7 -0
- package/lib/v2/atcoder/contest.js +64 -0
- package/lib/v2/atcoder/maintainer.js +4 -0
- package/lib/v2/atcoder/post.js +38 -0
- package/lib/v2/atcoder/radar.js +22 -0
- package/lib/v2/atcoder/router.js +4 -0
- package/lib/v2/baozimh/index.js +49 -0
- package/lib/v2/baozimh/maintainer.js +3 -0
- package/lib/v2/baozimh/radar.js +13 -0
- package/lib/v2/baozimh/router.js +3 -0
- package/lib/v2/blockbeats/index.js +50 -0
- package/lib/v2/blockbeats/maintainer.js +3 -0
- package/lib/v2/blockbeats/radar.js +19 -0
- package/lib/v2/blockbeats/router.js +3 -0
- package/lib/v2/changba/maintainer.js +3 -0
- package/lib/v2/changba/radar.js +13 -0
- package/lib/v2/changba/router.js +3 -0
- package/lib/v2/changba/templates/work_description.art +2 -0
- package/lib/v2/changba/user.js +84 -0
- package/lib/v2/codeforces/contests.js +37 -0
- package/lib/v2/codeforces/maintainer.js +3 -0
- package/lib/v2/codeforces/radar.js +13 -0
- package/lib/v2/codeforces/router.js +3 -0
- package/lib/v2/codeforces/templates/contest.art +11 -0
- package/lib/v2/consumer/index.js +55 -0
- package/lib/v2/consumer/maintainer.js +3 -0
- package/lib/v2/consumer/radar.js +13 -0
- package/lib/v2/consumer/router.js +3 -0
- package/lib/{routes → v2}/dockerhub/build.js +3 -1
- package/lib/v2/dockerhub/maintainer.js +4 -0
- package/lib/v2/dockerhub/radar.js +19 -0
- package/lib/v2/dockerhub/router.js +4 -0
- package/lib/v2/dockerhub/tag.js +33 -0
- package/lib/v2/dockerhub/utils.js +10 -0
- package/lib/{routes → v2}/douban/book/rank.js +0 -0
- package/lib/{routes → v2}/douban/channel/subject.js +0 -0
- package/lib/{routes → v2}/douban/channel/topic.js +0 -0
- package/lib/{routes → v2}/douban/commercialpress/latest.js +0 -0
- package/lib/{routes → v2}/douban/event/hot.js +0 -0
- package/lib/v2/douban/maintainer.js +27 -0
- package/lib/{routes/douban → v2/douban/other}/bookstore.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/celebrity.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/classification.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/doulist.js +0 -0
- package/lib/v2/douban/other/explore.js +50 -0
- package/lib/{routes/douban → v2/douban/other}/explore_column.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/group.js +1 -1
- package/lib/v2/douban/other/jobs.js +33 -0
- package/lib/{routes/douban → v2/douban/other}/later.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/latest_book.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/latest_music.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/playing.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/replied.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/replies.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/topic.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/ustop.js +0 -0
- package/lib/{routes/douban → v2/douban/other}/weekly_best.js +0 -0
- package/lib/{routes → v2}/douban/people/status.js +0 -0
- package/lib/{routes → v2}/douban/people/wish.js +0 -0
- package/lib/v2/douban/radar.js +54 -0
- package/lib/v2/douban/router.js +27 -0
- package/lib/v2/douban/templates/explore.art +7 -0
- package/lib/v2/dushu/fuzhou/index.js +42 -0
- package/lib/v2/dushu/fuzhou/templates/message.art +9 -0
- package/lib/v2/dushu/maintainer.js +3 -0
- package/lib/v2/dushu/radar.js +24 -0
- package/lib/v2/dushu/router.js +3 -0
- package/lib/v2/e-hentai/index.js +115 -0
- package/lib/v2/e-hentai/maintainer.js +5 -0
- package/lib/v2/e-hentai/radar.js +25 -0
- package/lib/v2/e-hentai/router.js +3 -0
- package/lib/v2/e-hentai/templates/images.art +3 -0
- package/lib/v2/ecust-jxjy/maintainer.js +3 -0
- package/lib/v2/ecust-jxjy/news.js +47 -0
- package/lib/v2/ecust-jxjy/radar.js +13 -0
- package/lib/v2/ecust-jxjy/router.js +3 -0
- package/lib/v2/epicgames/router.js +1 -1
- package/lib/{routes/everything → v2}/eventernote/actors.js +0 -0
- package/lib/v2/eventernote/maintainer.js +3 -0
- package/lib/v2/eventernote/radar.js +13 -0
- package/lib/v2/eventernote/router.js +3 -0
- package/lib/{routes → v2}/ezone/index.js +13 -5
- package/lib/v2/ezone/maintainer.js +3 -0
- package/lib/v2/ezone/radar.js +13 -0
- package/lib/v2/ezone/router.js +3 -0
- package/lib/v2/firefox/index.js +69 -0
- package/lib/v2/firefox/maintainer.js +3 -0
- package/lib/v2/firefox/radar.js +13 -0
- package/lib/v2/firefox/router.js +3 -0
- package/lib/v2/firefox/templates/description.art +5 -0
- package/lib/{routes → v2}/ft/channel.js +1 -0
- package/lib/v2/ft/maintainer.js +4 -0
- package/lib/v2/ft/myft.js +44 -0
- package/lib/v2/ft/radar.js +24 -0
- package/lib/v2/ft/router.js +4 -0
- package/lib/{routes → v2}/ft/utils.js +19 -19
- package/lib/{routes → v2}/gamer/hot.js +15 -4
- package/lib/v2/gamer/maintainer.js +3 -0
- package/lib/v2/gamer/radar.js +13 -0
- package/lib/v2/gamer/router.js +3 -0
- package/lib/{routes → v2}/github/branches.js +0 -0
- package/lib/v2/github/comments.js +64 -0
- package/lib/{routes → v2}/github/contributors.js +0 -0
- package/lib/{routes → v2}/github/file.js +0 -0
- package/lib/{routes → v2}/github/follower.js +0 -0
- package/lib/{routes → v2}/github/issue.js +0 -0
- package/lib/v2/github/maintainer.js +15 -0
- package/lib/{routes → v2}/github/pulls.js +0 -0
- package/lib/v2/github/radar.js +79 -0
- package/lib/{routes → v2}/github/repos.js +0 -0
- package/lib/v2/github/router.js +15 -0
- package/lib/{routes → v2}/github/search.js +0 -0
- package/lib/{routes → v2}/github/star.js +0 -0
- package/lib/{routes → v2}/github/starred_repos.js +0 -0
- package/lib/v2/github/templates/comments-description.art +1 -0
- package/lib/{routes → v2}/github/topic.js +0 -0
- package/lib/{routes → v2}/github/trending.js +3 -3
- package/lib/{routes → v2}/google/album.js +0 -0
- package/lib/{routes → v2}/google/citations.js +0 -0
- package/lib/{routes → v2}/google/doodles.js +0 -0
- package/lib/v2/google/fonts.js +43 -0
- package/lib/v2/google/maintainer.js +8 -0
- package/lib/{routes → v2}/google/news.js +0 -0
- package/lib/v2/google/radar.js +64 -0
- package/lib/v2/google/router.js +8 -0
- package/lib/{routes → v2}/google/scholar.js +0 -0
- package/lib/{routes → v2}/google/sites.js +0 -0
- package/lib/v2/google/templates/fonts.art +15 -0
- package/lib/v2/gov/beijing/kw/index.js +44 -0
- package/lib/v2/gov/maintainer.js +3 -0
- package/lib/v2/gov/radar.js +295 -0
- package/lib/v2/gov/router.js +3 -0
- package/lib/v2/gov/shenzhen/hrss/szksy/index.js +41 -0
- package/lib/v2/gov/shenzhen/zzb/index.js +40 -0
- package/lib/v2/hex-rays/index.js +47 -0
- package/lib/v2/hex-rays/maintainer.js +3 -0
- package/lib/v2/hex-rays/radar.js +13 -0
- package/lib/v2/hex-rays/router.js +3 -0
- package/lib/v2/hkepc/index.js +198 -0
- package/lib/v2/hkepc/maintainer.js +3 -0
- package/lib/v2/hkepc/radar.js +19 -0
- package/lib/v2/hkepc/router.js +3 -0
- package/lib/v2/hkepc/templates/description.art +1 -0
- package/lib/v2/hkepc/templates/image.art +1 -0
- package/lib/v2/houxu/index.js +85 -0
- package/lib/v2/houxu/maintainer.js +4 -0
- package/lib/v2/houxu/radar.js +19 -0
- package/lib/v2/houxu/router.js +3 -0
- package/lib/v2/houxu/templates/description.art +9 -0
- package/lib/v2/informs/index.js +74 -0
- package/lib/v2/informs/maintainer.js +3 -0
- package/lib/v2/informs/radar.js +109 -0
- package/lib/v2/informs/router.js +3 -0
- package/lib/v2/informs/templates/content.art +3 -0
- package/lib/v2/ithome/zt.js +9 -1
- package/lib/v2/jandan/index.js +6 -1
- package/lib/v2/latepost/index.js +62 -0
- package/lib/v2/latepost/maintainer.js +3 -0
- package/lib/v2/latepost/radar.js +13 -0
- package/lib/v2/latepost/router.js +3 -0
- package/lib/v2/leiphone/index.js +1 -1
- package/lib/v2/leiphone/radar.js +1 -1
- package/lib/v2/leiphone/router.js +1 -1
- package/lib/v2/logonews/index.js +76 -0
- package/lib/v2/logonews/maintainer.js +8 -0
- package/lib/v2/logonews/radar.js +43 -0
- package/lib/v2/logonews/router.js +5 -0
- package/lib/v2/logonews/templates/description.art +4 -0
- package/lib/v2/mvm/index.js +6 -6
- package/lib/v2/nifd/maintainer.js +3 -0
- package/lib/v2/nifd/radar.js +117 -0
- package/lib/v2/nifd/research.js +52 -0
- package/lib/v2/nifd/router.js +3 -0
- package/lib/v2/nippon/index.js +31 -0
- package/lib/v2/nippon/maintainer.js +3 -0
- package/lib/v2/nippon/radar.js +13 -0
- package/lib/v2/nippon/router.js +3 -0
- package/lib/{routes → v2}/odaily/activity.js +7 -6
- package/lib/v2/odaily/maintainer.js +6 -0
- package/lib/{routes → v2}/odaily/newsflash.js +4 -3
- package/lib/{routes → v2}/odaily/post.js +16 -10
- package/lib/v2/odaily/radar.js +60 -0
- package/lib/v2/odaily/router.js +6 -0
- package/lib/{routes → v2}/odaily/user.js +8 -7
- package/lib/v2/odaily/utils.js +3 -0
- package/lib/v2/people/index.js +83 -0
- package/lib/v2/people/maintainer.js +3 -0
- package/lib/v2/people/radar.js +9 -1
- package/lib/v2/people/router.js +3 -0
- package/lib/{routes → v2}/people/xjpjh.js +0 -0
- package/lib/v2/qq/ac/comic.js +43 -0
- package/lib/v2/qq/ac/rank.js +20 -0
- package/lib/v2/qq/ac/templates/description.art +9 -0
- package/lib/v2/qq/ac/utils.js +71 -0
- package/lib/v2/qq/maintainer.js +2 -0
- package/lib/v2/qq/radar.js +14 -0
- package/lib/v2/qq/router.js +2 -0
- package/lib/v2/radio-canada/latest.js +43 -0
- package/lib/v2/radio-canada/maintainer.js +3 -0
- package/lib/v2/radio-canada/radar.js +13 -0
- package/lib/v2/radio-canada/router.js +3 -0
- package/lib/v2/storm/index.js +57 -0
- package/lib/v2/storm/maintainer.js +3 -0
- package/lib/v2/storm/radar.js +13 -0
- package/lib/v2/storm/router.js +3 -0
- package/lib/v2/taobao/maintainer.js +3 -0
- package/lib/v2/taobao/radar.js +117 -0
- package/lib/v2/taobao/router.js +3 -0
- package/lib/v2/taobao/templates/zhongchou.art +4 -0
- package/lib/{routes → v2}/taobao/zhongchou.js +6 -7
- package/lib/{routes → v2}/telegram/blog.js +3 -3
- package/lib/{routes → v2}/telegram/channel.js +2 -1
- package/lib/v2/telegram/maintainer.js +5 -0
- package/lib/v2/telegram/radar.js +35 -0
- package/lib/v2/telegram/router.js +5 -0
- package/lib/{routes → v2}/telegram/stickerpack.js +0 -0
- package/lib/v2/topys/index.js +66 -0
- package/lib/v2/topys/maintainer.js +3 -0
- package/lib/v2/topys/radar.js +13 -0
- package/lib/v2/topys/router.js +3 -0
- package/lib/v2/wechat/feeddd.js +13 -5
- package/lib/v2/wechat/maintainer.js +1 -1
- package/lib/{routes/people/cpc/24h.js → v2/whoscall/index.js} +17 -14
- package/lib/v2/whoscall/maintainer.js +5 -0
- package/lib/v2/whoscall/radar.js +25 -0
- package/lib/v2/whoscall/router.js +3 -0
- package/lib/v2/zaker/index.js +65 -0
- package/lib/v2/zaker/maintainer.js +3 -0
- package/lib/v2/zaker/radar.js +19 -0
- package/lib/v2/zaker/router.js +3 -0
- package/lib/{routes → v2}/zaobao/index.js +0 -0
- package/lib/{routes → v2}/zaobao/interactive.js +0 -0
- package/lib/v2/zaobao/maintainer.js +6 -0
- package/lib/v2/zaobao/radar.js +28 -0
- package/lib/{routes → v2}/zaobao/realtime.js +3 -1
- package/lib/v2/zaobao/router.js +6 -0
- package/lib/v2/zaobao/templates/zaobao.art +17 -0
- package/lib/{routes → v2}/zaobao/util.js +55 -18
- package/lib/{routes → v2}/zaobao/znews.js +0 -3
- package/package.json +1 -1
- package/lib/routes/changba/user.js +0 -71
- package/lib/routes/douban/explore.js +0 -33
- package/lib/routes/ft/myft.js +0 -46
- package/lib/routes/hex-rays/index.js +0 -28
- package/lib/routes/hkepc/index.js +0 -164
- package/lib/routes/houxu/events.js +0 -27
- package/lib/routes/houxu/live.js +0 -39
- package/lib/routes/houxu/lives.js +0 -58
- package/lib/routes/latepost/index.js +0 -84
- package/lib/routes/people/env.js +0 -73
- package/lib/routes/people/opinion.js +0 -69
- package/lib/routes/topys/article.js +0 -55
- package/lib/routes/zaker/focusread.js +0 -65
- package/lib/routes/zaker/source.js +0 -66
package/lib/routes/eastday/sh.js
CHANGED
|
@@ -6,24 +6,16 @@ module.exports = async (ctx) => {
|
|
|
6
6
|
const domain = 'http://wap.eastday.com';
|
|
7
7
|
|
|
8
8
|
const response = await got({
|
|
9
|
-
method: '
|
|
10
|
-
url: `https://apin.eastday.com/
|
|
11
|
-
json: {
|
|
12
|
-
channelId: '15',
|
|
13
|
-
currentPage: 1,
|
|
14
|
-
pageSize: 20,
|
|
15
|
-
appId: '190504',
|
|
16
|
-
deviceId: '00000000',
|
|
17
|
-
version: '0.0.0.2',
|
|
18
|
-
},
|
|
9
|
+
method: 'get',
|
|
10
|
+
url: `https://apin.eastday.com/apiplus/special/specialnewslistbyurl?specialUrl=1632798465040016&skipCount=0&limitCount=20`,
|
|
19
11
|
});
|
|
20
12
|
|
|
21
13
|
const result = await Promise.all(
|
|
22
|
-
response.data.list.map(async (item) => {
|
|
14
|
+
response.data.data.list.map(async (item) => {
|
|
23
15
|
const link = item.url;
|
|
24
16
|
const entity = {
|
|
25
17
|
title: item.title,
|
|
26
|
-
description: item.abstracts
|
|
18
|
+
description: item.abstracts,
|
|
27
19
|
pubDate: new Date(item.time).toUTCString(),
|
|
28
20
|
link,
|
|
29
21
|
};
|
|
@@ -4,7 +4,7 @@ const util = require('./utils');
|
|
|
4
4
|
const iconv = require('iconv-lite');
|
|
5
5
|
|
|
6
6
|
const gbk2utf8 = (s) => iconv.decode(s, 'gbk');
|
|
7
|
-
const host = 'https://www.
|
|
7
|
+
const host = 'https://www.flyert.com';
|
|
8
8
|
|
|
9
9
|
module.exports = async (ctx) => {
|
|
10
10
|
const bank = ctx.params.bank;
|
|
@@ -72,13 +72,14 @@ module.exports = async (ctx) => {
|
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
const $ = cheerio.load(gbk2utf8(response.data));
|
|
75
|
+
|
|
75
76
|
const list = $("[id*='normalthread']").get();
|
|
76
77
|
|
|
77
78
|
const result = await util.ProcessFeed(list, ctx.cache);
|
|
78
79
|
|
|
79
80
|
ctx.state.data = {
|
|
80
81
|
title: `飞客茶馆信用卡 - ${bankname}`,
|
|
81
|
-
link: 'https://www.
|
|
82
|
+
link: 'https://www.flyert.com/',
|
|
82
83
|
description: `飞客茶馆信用卡 - ${bankname}`,
|
|
83
84
|
item: result,
|
|
84
85
|
};
|
|
@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
|
|
|
3
3
|
const iconv = require('iconv-lite');
|
|
4
4
|
|
|
5
5
|
const gbk2utf8 = (s) => iconv.decode(s, 'gbk');
|
|
6
|
-
const host = 'https://www.
|
|
6
|
+
const host = 'https://www.flyert.com';
|
|
7
7
|
const target = `${host}/forum.php?mod=forumdisplay&sum=all&fid=all&catid=322`;
|
|
8
8
|
|
|
9
9
|
module.exports = async (ctx) => {
|
|
@@ -15,7 +15,7 @@ module.exports = async (ctx) => {
|
|
|
15
15
|
const items = $('.comiis_wzli');
|
|
16
16
|
ctx.state.data = {
|
|
17
17
|
title: '飞客茶馆优惠',
|
|
18
|
-
link: 'https://www.
|
|
18
|
+
link: 'https://www.flyert.com/',
|
|
19
19
|
description: '飞客茶馆优惠',
|
|
20
20
|
item:
|
|
21
21
|
items &&
|
|
@@ -32,15 +32,15 @@ async function load(link) {
|
|
|
32
32
|
return { description };
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const ProcessFeed = (list, caches) => {
|
|
36
|
-
const host = 'https://www.
|
|
35
|
+
const ProcessFeed = async (list, caches) => {
|
|
36
|
+
const host = 'https://www.flyert.com';
|
|
37
37
|
|
|
38
|
-
return Promise.all(
|
|
38
|
+
return await Promise.all(
|
|
39
39
|
list.map(async (item) => {
|
|
40
40
|
const $ = cheerio.load(item);
|
|
41
41
|
|
|
42
42
|
const $label = $(".comiis_common a[data-track='版块页主题分类']");
|
|
43
|
-
const $title = $(".comiis_common a[data-track='
|
|
43
|
+
const $title = $(".comiis_common a[data-track='版块页文章']");
|
|
44
44
|
// 还原相对链接为绝对链接
|
|
45
45
|
const itemUrl = url.resolve(host, $title.attr('href'));
|
|
46
46
|
|
|
@@ -53,7 +53,7 @@ const ProcessFeed = (list, caches) => {
|
|
|
53
53
|
|
|
54
54
|
// 使用tryGet方法从缓存获取内容。
|
|
55
55
|
// 当缓存中无法获取到链接内容的时候,则使用load方法加载文章内容。
|
|
56
|
-
const other = await caches.tryGet(itemUrl, () => load(itemUrl));
|
|
56
|
+
const other = await caches.tryGet(itemUrl, async () => await load(itemUrl));
|
|
57
57
|
|
|
58
58
|
// 合并解析后的结果集作为该篇文章最终的输出结果
|
|
59
59
|
return Promise.resolve(Object.assign({}, single, other));
|
|
@@ -1,56 +1,58 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
|
-
const
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
5
|
|
|
5
6
|
module.exports = async (ctx) => {
|
|
6
7
|
const link = `https://news.futunn.com/main`;
|
|
7
8
|
|
|
8
9
|
const response = await got.get(link);
|
|
9
10
|
const $ = cheerio.load(response.data);
|
|
10
|
-
|
|
11
|
-
const
|
|
11
|
+
|
|
12
|
+
const contents = $('script:not([src]):contains("window._params")');
|
|
13
|
+
const params = contents.html().trim().slice(17, -1);
|
|
12
14
|
|
|
13
15
|
const newslist = JSON.parse(params).preList;
|
|
14
16
|
|
|
15
17
|
const out = await Promise.all(
|
|
16
|
-
newslist
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
18
|
+
newslist
|
|
19
|
+
.filter((info) => {
|
|
20
|
+
const url = new URL(info.url);
|
|
21
|
+
if (url.hostname !== 'news.futunn.com') {
|
|
22
|
+
// ignore videos.futunn.com
|
|
23
|
+
return false;
|
|
24
|
+
} else if (url.searchParams.get('src') !== '3') {
|
|
25
|
+
// ignore src=12 redirecting to mp.weixin.qq.com
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
return true;
|
|
29
|
+
})
|
|
30
|
+
.map((info) =>
|
|
31
|
+
ctx.cache.tryGet(info.url, async () => {
|
|
32
|
+
const response = await got({
|
|
33
|
+
url: info.url,
|
|
34
|
+
method: 'get',
|
|
35
|
+
headers: {
|
|
36
|
+
Referer: link,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const $ = cheerio.load(response.data);
|
|
41
|
+
const description = $('div.newsDetailBox div.main div.inner').html();
|
|
42
|
+
const date = $('div.timeBar').children().remove().end().text().trim();
|
|
43
|
+
|
|
44
|
+
info.link = info.url;
|
|
45
|
+
info.description = description;
|
|
46
|
+
info.pubDate = timezone(parseDate(date, 'YYYY/MM/DD HH:mm'), +8);
|
|
47
|
+
|
|
48
|
+
return info;
|
|
49
|
+
})
|
|
50
|
+
)
|
|
48
51
|
);
|
|
49
|
-
const outfilter = out.filter((t) => t.description !== '原文已被删除');
|
|
50
52
|
|
|
51
53
|
ctx.state.data = {
|
|
52
54
|
title: `富途牛牛要闻`,
|
|
53
55
|
link,
|
|
54
|
-
item:
|
|
56
|
+
item: out,
|
|
55
57
|
};
|
|
56
58
|
};
|
|
@@ -1,44 +1,26 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
|
|
3
3
|
module.exports = async (ctx) => {
|
|
4
|
-
const sort = ctx.params.sort || '';
|
|
5
4
|
const response = await got({
|
|
6
|
-
method: '
|
|
7
|
-
url: 'https://
|
|
5
|
+
method: 'post',
|
|
6
|
+
url: 'https://m.xiaomiyoupin.com/homepage/main/v1005',
|
|
8
7
|
});
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
goodsList = item.data.result.list;
|
|
20
|
-
} else {
|
|
21
|
-
goodsList = item.data.tabs[sort].result.list;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
goodsList.forEach((goods) => {
|
|
25
|
-
const item = goods.value.goods;
|
|
26
|
-
const img = item.pic_url;
|
|
27
|
-
acc.push({
|
|
28
|
-
title: item.name,
|
|
29
|
-
description: `<img src="${img}"><br>${item.summary}<br>价格:${item.market_price / 100}元`,
|
|
30
|
-
link: item.jump_url,
|
|
31
|
-
pubDate: new Date(item.first_release_time * 1000).toUTCString(),
|
|
32
|
-
});
|
|
9
|
+
const items = response.data.data.homepage.floors
|
|
10
|
+
.filter((floor) => floor.module_key === 'product_hot')[0]
|
|
11
|
+
.data.items.map((item) => {
|
|
12
|
+
const i = item.item;
|
|
13
|
+
return {
|
|
14
|
+
title: i.name,
|
|
15
|
+
description: `<img src="${i.pic_url}"><br>${i.summary}<br>价格:${i.market_price / 100}元`,
|
|
16
|
+
link: i.jump_url,
|
|
17
|
+
};
|
|
33
18
|
});
|
|
34
19
|
|
|
35
|
-
return acc;
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
20
|
ctx.state.data = {
|
|
39
|
-
title:
|
|
21
|
+
title: '小米有品每日上新',
|
|
40
22
|
link: 'https://m.xiaomiyoupin.com/w/newproduct?pageid=1605',
|
|
41
23
|
description: '小米有品每日上新',
|
|
42
|
-
item,
|
|
24
|
+
item: items,
|
|
43
25
|
};
|
|
44
26
|
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const id = ctx.params.id;
|
|
6
|
+
let link;
|
|
7
|
+
let subDomain = 0;
|
|
8
|
+
if (id.endsWith('.eth') || id.length === 42 || id.length === 40) {
|
|
9
|
+
link = 'https://mirror.xyz/' + id;
|
|
10
|
+
} else {
|
|
11
|
+
link = 'https://' + id + '.mirror.xyz';
|
|
12
|
+
subDomain = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const response = await got({
|
|
16
|
+
method: 'get',
|
|
17
|
+
url: link,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const data = response.body;
|
|
21
|
+
const $ = cheerio.load(data);
|
|
22
|
+
|
|
23
|
+
const author = $('div#__next > div.GlobalNavigation > div.GlobalNavigationContainer > div > div > div > div > div > a').text();
|
|
24
|
+
|
|
25
|
+
// 标题
|
|
26
|
+
const article = $('h1')
|
|
27
|
+
.map(function () {
|
|
28
|
+
return $(this).text();
|
|
29
|
+
})
|
|
30
|
+
.get();
|
|
31
|
+
|
|
32
|
+
// 地址
|
|
33
|
+
const addr = $('h1')
|
|
34
|
+
.parent()
|
|
35
|
+
.parent()
|
|
36
|
+
.parent()
|
|
37
|
+
.map(function () {
|
|
38
|
+
return $(this).attr('href');
|
|
39
|
+
})
|
|
40
|
+
.get();
|
|
41
|
+
|
|
42
|
+
// 发布日期
|
|
43
|
+
const date = $('div#__next > div > div > div > div > div > div > div > div > div')
|
|
44
|
+
.map(function () {
|
|
45
|
+
return $(this).text();
|
|
46
|
+
})
|
|
47
|
+
.get();
|
|
48
|
+
|
|
49
|
+
// 摘要
|
|
50
|
+
const des = $('h1')
|
|
51
|
+
.parent()
|
|
52
|
+
.parent()
|
|
53
|
+
.parent()
|
|
54
|
+
.parent()
|
|
55
|
+
.next()
|
|
56
|
+
.next()
|
|
57
|
+
.map(function () {
|
|
58
|
+
return $(this).text();
|
|
59
|
+
})
|
|
60
|
+
.get();
|
|
61
|
+
|
|
62
|
+
const items = [];
|
|
63
|
+
article.forEach((item, index) => {
|
|
64
|
+
items.push({
|
|
65
|
+
title: item,
|
|
66
|
+
author,
|
|
67
|
+
description: des[index],
|
|
68
|
+
pubDate: date[index],
|
|
69
|
+
link: subDomain ? link + addr[index] : 'https://mirror.xyz' + addr[index],
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const title = author + ' - Mirror';
|
|
74
|
+
ctx.state.data = {
|
|
75
|
+
title,
|
|
76
|
+
link,
|
|
77
|
+
allowEmpty: true,
|
|
78
|
+
item: items,
|
|
79
|
+
};
|
|
80
|
+
};
|
|
@@ -1,102 +1,100 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
|
-
const
|
|
4
|
-
const iconv = require('iconv-lite');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
4
|
|
|
6
|
-
const urlRoot = '
|
|
7
|
-
|
|
8
|
-
const transcode = (buffer) => {
|
|
9
|
-
const data = iconv.decode(buffer, 'gb2312');
|
|
10
|
-
return cheerio.load(data);
|
|
11
|
-
};
|
|
5
|
+
const urlRoot = 'https://jwc.sjtu.edu.cn/xwtg';
|
|
12
6
|
|
|
13
7
|
async function getFullArticle(link) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
const fullArtData = transcode(response.data);
|
|
21
|
-
const fullArt = fullArtData('.main_r_co_fo').html();
|
|
22
|
-
return fullArt;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
return '<h1> 这条消息被 -1s 了 </h1>';
|
|
8
|
+
const response = await got(link);
|
|
9
|
+
const $ = cheerio.load(response.body);
|
|
10
|
+
const content = $('.content-con');
|
|
11
|
+
if (content.length === 0) {
|
|
12
|
+
return null;
|
|
25
13
|
}
|
|
14
|
+
// resolve links of <img> and <a>
|
|
15
|
+
content.find('img').each((_, e) => {
|
|
16
|
+
const relativeLink = $(e).attr('src');
|
|
17
|
+
const absLink = new URL(relativeLink, urlRoot).href;
|
|
18
|
+
$(e).attr('src', absLink);
|
|
19
|
+
});
|
|
20
|
+
content.find('a').each((_, e) => {
|
|
21
|
+
const relativeLink = $(e).attr('href');
|
|
22
|
+
const absLink = new URL(relativeLink, urlRoot).href;
|
|
23
|
+
$(e).attr('href', absLink);
|
|
24
|
+
});
|
|
25
|
+
return content.html();
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
module.exports = async (ctx) => {
|
|
29
|
-
const type = ctx.params.type
|
|
29
|
+
const type = ctx.params.type ?? 'all';
|
|
30
30
|
const config = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
all: {
|
|
32
|
+
section: '通知通告',
|
|
33
|
+
link: '/tztg.htm',
|
|
34
34
|
},
|
|
35
35
|
news: {
|
|
36
|
-
link: '
|
|
36
|
+
link: '/xwzx.htm',
|
|
37
37
|
section: '新闻中心',
|
|
38
38
|
},
|
|
39
39
|
notice: {
|
|
40
|
-
link: '
|
|
40
|
+
link: '/tztg.htm',
|
|
41
41
|
section: '通知通告',
|
|
42
42
|
},
|
|
43
43
|
operation: {
|
|
44
|
-
link: '
|
|
44
|
+
link: '/jxyx.htm',
|
|
45
45
|
section: '教学运行',
|
|
46
46
|
},
|
|
47
47
|
affairs: {
|
|
48
|
-
link: '
|
|
48
|
+
link: '/zcxw.htm',
|
|
49
49
|
section: '注册学务',
|
|
50
50
|
},
|
|
51
51
|
yjb: {
|
|
52
|
-
link: '
|
|
52
|
+
link: '/yjb.htm',
|
|
53
53
|
section: '研究办',
|
|
54
54
|
},
|
|
55
55
|
jgb: {
|
|
56
|
-
link: '
|
|
56
|
+
link: '/jgb.htm',
|
|
57
57
|
section: '教改办',
|
|
58
58
|
},
|
|
59
59
|
zhb: {
|
|
60
|
-
link: '
|
|
60
|
+
link: '/zhb.htm',
|
|
61
61
|
section: '综合办',
|
|
62
62
|
},
|
|
63
|
+
language: {
|
|
64
|
+
link: '/yywz.htm',
|
|
65
|
+
section: '语言文字',
|
|
66
|
+
},
|
|
63
67
|
party: {
|
|
64
|
-
link: '
|
|
68
|
+
link: '/ghyzb.htm',
|
|
65
69
|
section: '工会与支部',
|
|
66
70
|
},
|
|
71
|
+
ge: {
|
|
72
|
+
link: '/tsjy.htm',
|
|
73
|
+
section: '通识教育',
|
|
74
|
+
},
|
|
67
75
|
};
|
|
68
76
|
|
|
69
|
-
const sectionLink =
|
|
77
|
+
const sectionLink = urlRoot + config[type].link;
|
|
70
78
|
|
|
71
79
|
const response = await got({
|
|
72
80
|
method: 'get',
|
|
73
81
|
url: sectionLink,
|
|
74
|
-
responseType: 'buffer',
|
|
75
82
|
});
|
|
76
83
|
|
|
77
|
-
const $ =
|
|
84
|
+
const $ = cheerio.load(response.body);
|
|
78
85
|
|
|
79
86
|
const out = await Promise.all(
|
|
80
|
-
$('.
|
|
81
|
-
.find('
|
|
82
|
-
.slice(0, 10)
|
|
87
|
+
$('body > div.list-box > div.container > div > div.ny_right > div > div.ny_right_con > div > ul')
|
|
88
|
+
.find('li')
|
|
83
89
|
.map(async (i, e) => {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
.children('td')
|
|
93
|
-
.eq(-1)
|
|
94
|
-
.text()
|
|
95
|
-
.match(/\d{4}-\d{2}-\d{2}/)[0]
|
|
96
|
-
);
|
|
97
|
-
const timeZone = 8;
|
|
98
|
-
const serverOffset = date.getTimezoneOffset() / 60;
|
|
99
|
-
const pubDate = new Date(date.getTime() - 60 * 60 * 1000 * (timeZone + serverOffset)).toUTCString();
|
|
90
|
+
const info = $(e).find('.wz');
|
|
91
|
+
const relativeLink = info.find('a').attr('href');
|
|
92
|
+
const link = new URL(relativeLink, sectionLink).href;
|
|
93
|
+
const title = info.find('a > h2').text();
|
|
94
|
+
const timeElement = $(e).find('.sj');
|
|
95
|
+
const day = timeElement.find('h2').text();
|
|
96
|
+
const yearAndMonth = timeElement.find('p').text();
|
|
97
|
+
const pubDate = parseDate(`${yearAndMonth}.${day}`, 'YYYY.MM.DD');
|
|
100
98
|
const description = await ctx.cache.tryGet(link, () => getFullArticle(link));
|
|
101
99
|
const single = {
|
|
102
100
|
title,
|
package/lib/routes/vgn/index.js
CHANGED
|
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
|
|
|
21
21
|
title: item.title,
|
|
22
22
|
description: item.content,
|
|
23
23
|
pubDate: new Date(item.release_time * 1000).toUTCString(),
|
|
24
|
-
link: `https://vgn.cn/
|
|
24
|
+
link: `https://vgn.cn/article/news/${item.id}`,
|
|
25
25
|
})),
|
|
26
26
|
};
|
|
27
27
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
3
|
const url = require('url');
|
|
4
|
-
const
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
5
|
|
|
6
6
|
const host = 'https://www.who.int/';
|
|
7
7
|
|
|
@@ -20,7 +20,7 @@ module.exports = async (ctx) => {
|
|
|
20
20
|
const $elem = $(elem);
|
|
21
21
|
const title = $elem.find('p').text();
|
|
22
22
|
const link = url.resolve(host, $elem.find('a').attr('href'));
|
|
23
|
-
const pubDate =
|
|
23
|
+
const pubDate = parseDate($elem.find('.timestamp').text(), 'YYYY年M月D日');
|
|
24
24
|
|
|
25
25
|
const item = {
|
|
26
26
|
title,
|
|
@@ -5,11 +5,11 @@ const cheerio = require('cheerio');
|
|
|
5
5
|
const host = 'https://www.yxdzqb.com';
|
|
6
6
|
|
|
7
7
|
const map = {
|
|
8
|
-
new: '
|
|
9
|
-
hot: '
|
|
10
|
-
hot_chinese: '
|
|
11
|
-
low: '
|
|
12
|
-
low_chinese: '
|
|
8
|
+
new: 'index_discount.html',
|
|
9
|
+
hot: 'index_popular.html',
|
|
10
|
+
hot_chinese: 'index_popular_cn.html',
|
|
11
|
+
low: 'index_low.html',
|
|
12
|
+
low_chinese: 'index_low_cn.html',
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
module.exports = async (ctx) => {
|
|
@@ -5,6 +5,7 @@ const { generateData } = require('./pin/utils');
|
|
|
5
5
|
|
|
6
6
|
module.exports = async (ctx) => {
|
|
7
7
|
const id = ctx.params.id;
|
|
8
|
+
const getAll = ctx.params.getAll;
|
|
8
9
|
|
|
9
10
|
const response = await got({
|
|
10
11
|
method: 'get',
|
|
@@ -17,6 +18,29 @@ module.exports = async (ctx) => {
|
|
|
17
18
|
|
|
18
19
|
const list = response.data.data;
|
|
19
20
|
|
|
21
|
+
if (getAll) {
|
|
22
|
+
const totals = response.data.paging.totals;
|
|
23
|
+
|
|
24
|
+
const offsetList = [...new Array(Math.round(totals / 20)).keys()].map((item) => item * 20).slice(1);
|
|
25
|
+
const otherList = await Promise.all(
|
|
26
|
+
offsetList.map((offset) =>
|
|
27
|
+
ctx.cache.tryGet(`https://www.zhihu.com/api/v4/collections/${id}/items?offset=${offset}&limit=20`, async () => {
|
|
28
|
+
const response = await got({
|
|
29
|
+
method: 'get',
|
|
30
|
+
url: `https://www.zhihu.com/api/v4/collections/${id}/items?offset=${offset}&limit=20`,
|
|
31
|
+
headers: {
|
|
32
|
+
...utils.header,
|
|
33
|
+
Referer: `https://www.zhihu.com/collection/${id}`,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return response.data.data;
|
|
38
|
+
})
|
|
39
|
+
)
|
|
40
|
+
).then((item) => item.flat());
|
|
41
|
+
list.push(...otherList);
|
|
42
|
+
}
|
|
43
|
+
|
|
20
44
|
const response2 = await got({
|
|
21
45
|
method: 'get',
|
|
22
46
|
url: `https://www.zhihu.com/collection/${id}`,
|
|
@@ -42,9 +66,9 @@ module.exports = async (ctx) => {
|
|
|
42
66
|
item.content.type === 'pin'
|
|
43
67
|
? generateDataPin(item)
|
|
44
68
|
: {
|
|
45
|
-
title: item.content.type === 'article' ? item.content.title : item.content.question.title,
|
|
69
|
+
title: item.content.type === 'article' || item.content.type === 'zvideo' ? item.content.title : item.content.question.title,
|
|
46
70
|
link: item.content.url,
|
|
47
|
-
description: item.content.content,
|
|
71
|
+
description: item.content.type === 'zvideo' ? `<img src=${item.content.video.url}/>` : item.content.content,
|
|
48
72
|
pubDate: new Date((item.content.type === 'article' ? item.content.updated : item.content.updated_time) * 1000).toUTCString(),
|
|
49
73
|
}
|
|
50
74
|
),
|
|
@@ -17,13 +17,23 @@ module.exports = {
|
|
|
17
17
|
break;
|
|
18
18
|
|
|
19
19
|
case 'video':
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
try {
|
|
21
|
+
description += `<video
|
|
22
|
+
controls="controls"
|
|
23
|
+
width="${item.playlist.hd.width}"
|
|
24
|
+
height="${item.playlist.hd.height}"
|
|
25
|
+
poster="${item.cover_info.thumbnail}"
|
|
26
|
+
src="${item.playlist.hd.play_url}"
|
|
27
|
+
>`;
|
|
28
|
+
} catch (e) {
|
|
29
|
+
description += `<video
|
|
30
|
+
controls="controls"
|
|
31
|
+
width="${item.playlist.pop().width}"
|
|
32
|
+
height="${item.playlist.pop().height}"
|
|
33
|
+
poster="${item.thumbnail}"
|
|
34
|
+
src="${item.playlist.pop().play_url}"
|
|
35
|
+
>`;
|
|
36
|
+
}
|
|
27
37
|
break;
|
|
28
38
|
|
|
29
39
|
case 'link':
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
2
|
const utils = require('./utils');
|
|
3
3
|
const cheerio = require('cheerio');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
5
|
|
|
5
6
|
module.exports = async (ctx) => {
|
|
6
7
|
const id = ctx.params.id;
|
|
@@ -38,7 +39,7 @@ module.exports = async (ctx) => {
|
|
|
38
39
|
title: String(item.title),
|
|
39
40
|
description: item.content,
|
|
40
41
|
link: item.url,
|
|
41
|
-
pubDate:
|
|
42
|
+
pubDate: parseDate(item.updated * 1000),
|
|
42
43
|
})),
|
|
43
44
|
};
|
|
44
45
|
};
|