rsshub 1.0.0-master.fc5a2f6 → 1.0.0-master.fc648b5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.js +4 -0
- package/lib/middleware/anti-hotlink.js +90 -22
- package/lib/middleware/parameter.js +65 -32
- package/lib/middleware/templates/iframe.art +14 -0
- package/lib/radar-rules.js +0 -92
- package/lib/router.js +22 -22
- package/lib/routes/agefans/update.js +1 -1
- package/lib/routes/novel/biqugeinfo.js +2 -2
- package/lib/routes/universities/uestc/sice.js +12 -33
- package/lib/routes/weibo/user.js +10 -19
- package/lib/v2/19lou/index.js +74 -0
- package/lib/v2/19lou/maintainer.js +3 -0
- package/lib/v2/19lou/radar.js +29 -0
- package/lib/v2/19lou/router.js +3 -0
- package/lib/v2/36kr/router.js +1 -1
- package/lib/v2/36kr/user.js +47 -22
- package/lib/v2/acfun/article.js +100 -0
- package/lib/{routes → v2}/acfun/bangumi.js +7 -7
- package/lib/v2/acfun/maintainer.js +5 -0
- package/lib/v2/acfun/radar.js +25 -0
- package/lib/v2/acfun/router.js +5 -0
- package/lib/v2/acfun/video.js +45 -0
- package/lib/v2/agora0/index.js +54 -0
- package/lib/v2/agora0/maintainer.js +3 -0
- package/lib/v2/agora0/radar.js +13 -0
- package/lib/v2/agora0/router.js +3 -0
- package/lib/v2/apnews/maintainer.js +3 -0
- package/lib/v2/apnews/radar.js +13 -0
- package/lib/v2/apnews/router.js +3 -0
- package/lib/v2/apnews/templates/description.art +14 -0
- package/lib/v2/apnews/topics.js +44 -0
- package/lib/v2/appleinsider/index.js +59 -0
- package/lib/v2/appleinsider/maintainer.js +3 -0
- package/lib/v2/appleinsider/radar.js +13 -0
- package/lib/v2/appleinsider/router.js +3 -0
- package/lib/v2/cbnweek/index.js +46 -0
- package/lib/v2/cbnweek/maintainer.js +3 -0
- package/lib/v2/cbnweek/radar.js +13 -0
- package/lib/v2/cbnweek/router.js +3 -0
- package/lib/v2/ccac/news.js +12 -3
- package/lib/v2/cde/index.js +2 -2
- package/lib/v2/cde/maintainer.js +1 -0
- package/lib/v2/cde/radar.js +22 -4
- package/lib/v2/cde/router.js +1 -0
- package/lib/v2/cde/templates/xxgk/breakthroughCure.art +18 -0
- package/lib/v2/cde/templates/xxgk/cliniCal.art +16 -0
- package/lib/v2/cde/templates/xxgk/priorityApproval.art +18 -0
- package/lib/v2/cde/utils.js +2 -2
- package/lib/v2/cde/xxgk.js +73 -0
- package/lib/v2/chinadegrees/maintainer.js +3 -0
- package/lib/v2/chinadegrees/province.js +66 -0
- package/lib/v2/chinadegrees/radar.js +13 -0
- package/lib/v2/chinadegrees/router.js +3 -0
- package/lib/v2/chinadegrees/templates/description.art +4 -0
- package/lib/v2/cnjxol/index.js +94 -0
- package/lib/v2/cnjxol/maintainer.js +4 -0
- package/lib/v2/cnjxol/radar.js +19 -0
- package/lib/v2/cnjxol/router.js +3 -0
- package/lib/v2/cnjxol/templates/description.art +2 -0
- package/lib/v2/cscse/maintainer.js +3 -0
- package/lib/v2/cscse/radar.js +13 -0
- package/lib/v2/cscse/router.js +3 -0
- package/lib/v2/cscse/tzgg.js +54 -0
- package/lib/v2/dgjyw/index.js +67 -0
- package/lib/v2/dgjyw/maintainer.js +3 -0
- package/lib/v2/dgjyw/radar.js +13 -0
- package/lib/v2/dgjyw/router.js +3 -0
- package/lib/v2/domp4/detail.js +67 -0
- package/lib/v2/domp4/latest.js +31 -0
- package/lib/v2/domp4/maintainer.js +4 -0
- package/lib/v2/domp4/radar.js +25 -0
- package/lib/v2/domp4/router.js +4 -0
- package/lib/v2/domp4/utils.js +72 -0
- package/lib/v2/douyin/hashtag.js +5 -43
- package/lib/v2/douyin/live.js +68 -0
- package/lib/v2/douyin/maintainer.js +2 -0
- package/lib/v2/douyin/radar.js +8 -0
- package/lib/v2/douyin/router.js +1 -0
- package/lib/v2/douyin/user.js +5 -43
- package/lib/v2/douyin/utils.js +50 -0
- package/lib/v2/economist/full.js +6 -4
- package/lib/v2/elsevier/issue.js +62 -0
- package/lib/v2/elsevier/journal.js +72 -0
- package/lib/v2/elsevier/maintainer.js +2 -2
- package/lib/v2/elsevier/radar.js +5 -5
- package/lib/v2/elsevier/router.js +4 -2
- package/lib/v2/elsevier/templates/description.art +5 -5
- package/lib/v2/gov/beijing/jw/tzgg.js +58 -0
- package/lib/v2/gov/customs/list.js +21 -17
- package/lib/v2/gov/customs/utils.js +9 -5
- package/lib/v2/gov/maintainer.js +3 -0
- package/lib/v2/gov/nmpa/generic.js +76 -0
- package/lib/v2/gov/pbc/goutongjiaoliu.js +20 -15
- package/lib/v2/gov/pbc/tradeAnnouncement.js +18 -14
- package/lib/v2/gov/radar.js +57 -27
- package/lib/v2/gov/router.js +3 -0
- package/lib/v2/gov/xuzhou/hrss.js +54 -0
- package/lib/v2/hackertalk/index.js +23 -0
- package/lib/v2/hackertalk/maintainer.js +3 -0
- package/lib/v2/hackertalk/radar.js +13 -0
- package/lib/v2/hackertalk/router.js +3 -0
- package/lib/v2/hashnode/blog.js +62 -0
- package/lib/v2/hashnode/maintainer.js +3 -0
- package/lib/v2/hashnode/radar.js +13 -0
- package/lib/v2/hashnode/router.js +3 -0
- package/lib/v2/hashnode/templates/description.art +2 -0
- package/lib/v2/hdu/cs/{index.js → notice.js} +1 -4
- package/lib/v2/hdu/cs/pg.js +54 -0
- package/lib/v2/hdu/maintainer.js +1 -0
- package/lib/v2/hdu/radar.js +6 -0
- package/lib/v2/hdu/router.js +2 -1
- package/lib/v2/heu/gx/list.js +2 -2
- package/lib/v2/heu/job/list.js +2 -2
- package/lib/v2/heu/uae/list.js +2 -2
- package/lib/v2/heu/yjsy/list.js +2 -2
- package/lib/v2/hk01/channel.js +40 -0
- package/lib/{routes → v2}/hk01/hot.js +2 -1
- package/lib/v2/hk01/issue.js +41 -0
- package/lib/v2/hk01/maintainer.js +7 -0
- package/lib/v2/hk01/radar.js +37 -0
- package/lib/v2/hk01/router.js +7 -0
- package/lib/{routes → v2}/hk01/tag.js +2 -1
- package/lib/{routes → v2}/hk01/zone.js +3 -2
- package/lib/v2/hotukdeals/index.js +1 -1
- package/lib/v2/ieee/journal.js +78 -0
- package/lib/v2/ieee/maintainer.js +2 -2
- package/lib/v2/ieee/radar.js +4 -4
- package/lib/v2/ieee/{latestdate.js → recent.js} +34 -42
- package/lib/v2/ieee/router.js +4 -2
- package/lib/v2/ieee/templates/description.art +5 -5
- package/lib/v2/ielts/index.js +7 -2
- package/lib/v2/keep/maintainer.js +3 -0
- package/lib/v2/keep/radar.js +13 -0
- package/lib/v2/keep/router.js +3 -0
- package/lib/v2/keep/templates/user.art +16 -0
- package/lib/{routes → v2}/keep/user.js +14 -4
- package/lib/v2/mdpi/journal.js +65 -0
- package/lib/v2/mdpi/maintainer.js +3 -0
- package/lib/v2/mdpi/radar.js +13 -0
- package/lib/v2/mdpi/router.js +3 -0
- package/lib/v2/mdpi/templates/description.art +12 -0
- package/lib/v2/mindmeister/example.js +44 -0
- package/lib/v2/mindmeister/maintainer.js +3 -0
- package/lib/v2/mindmeister/radar.js +13 -0
- package/lib/v2/mindmeister/router.js +3 -0
- package/lib/v2/mindmeister/templates/image.art +1 -0
- package/lib/v2/mirror/index.js +34 -0
- package/lib/v2/mirror/maintainer.js +3 -0
- package/lib/v2/mirror/radar.js +17 -0
- package/lib/v2/mirror/router.js +3 -0
- package/lib/v2/nbd/radar.js +2 -2
- package/lib/v2/ncwu/maintainer.js +3 -0
- package/lib/v2/ncwu/notice.js +27 -0
- package/lib/v2/ncwu/radar.js +13 -0
- package/lib/v2/ncwu/router.js +3 -0
- package/lib/v2/netease/exclusive.js +148 -0
- package/lib/v2/netease/maintainer.js +1 -0
- package/lib/v2/netease/radar.js +8 -0
- package/lib/v2/netease/router.js +1 -0
- package/lib/v2/netease/templates/exclusive.art +11 -0
- package/lib/v2/nju/rczp.js +34 -24
- package/lib/v2/njust/utils.js +4 -0
- package/lib/v2/nuaa/utils/pypasswaf.js +4 -5
- package/lib/v2/nyaa/maintainer.js +4 -0
- package/lib/v2/nyaa/radar.js +32 -0
- package/lib/v2/nyaa/router.js +4 -0
- package/lib/{routes → v2}/nyaa/search.js +4 -2
- package/lib/v2/nytimes/daily_briefing_chinese.js +47 -41
- package/lib/v2/nytimes/index.js +3 -3
- package/lib/v2/nytimes/maintainer.js +1 -1
- package/lib/v2/nytimes/templates/image.art +3 -0
- package/lib/v2/nytimes/utils.js +7 -1
- package/lib/v2/oceanengine/arithmeticIndex.js +145 -0
- package/lib/v2/oceanengine/maintainer.js +3 -0
- package/lib/v2/oceanengine/radar.js +13 -0
- package/lib/v2/oceanengine/router.js +3 -0
- package/lib/v2/oceanengine/templates/content.art +14 -0
- package/lib/v2/openwrt/maintainer.js +3 -0
- package/lib/v2/openwrt/radar.js +13 -0
- package/lib/v2/openwrt/releases.js +25 -0
- package/lib/v2/openwrt/router.js +3 -0
- package/lib/v2/pincong/utils.js +7 -1
- package/lib/v2/pku/maintainer.js +3 -0
- package/lib/v2/pku/radar.js +20 -0
- package/lib/v2/pku/router.js +3 -0
- package/lib/v2/pku/ss/admission.js +53 -0
- package/lib/v2/pku/ss/notice.js +53 -0
- package/lib/v2/pku/ss/pg_admin.js +53 -0
- package/lib/v2/prestige-av/maintainer.js +3 -0
- package/lib/v2/prestige-av/radar.js +18 -0
- package/lib/v2/prestige-av/router.js +3 -0
- package/lib/{routes → v2}/prestige-av/series.js +8 -5
- package/lib/v2/qq/kg/cache.js +28 -0
- package/lib/v2/qq/kg/reply.js +21 -0
- package/lib/v2/qq/kg/user.js +50 -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/samsung/maintainer.js +3 -0
- package/lib/v2/samsung/radar.js +13 -0
- package/lib/v2/samsung/research/blog.js +49 -0
- package/lib/v2/samsung/router.js +3 -0
- package/lib/v2/{jasa/latest.js → scitation/journal.js} +24 -27
- package/lib/v2/scitation/maintainer.js +4 -0
- package/lib/v2/scitation/radar.js +19 -0
- package/lib/v2/scitation/router.js +4 -0
- package/lib/v2/scitation/section.js +90 -0
- package/lib/v2/scitation/templates/description.art +11 -0
- package/lib/v2/shuiguopai/index.js +76 -0
- package/lib/v2/shuiguopai/maintainer.js +3 -0
- package/lib/v2/shuiguopai/radar.js +13 -0
- package/lib/v2/shuiguopai/router.js +3 -0
- package/lib/v2/shuiguopai/templates/description.art +6 -0
- package/lib/v2/springer/journal.js +72 -0
- package/lib/v2/springer/maintainer.js +3 -0
- package/lib/v2/springer/radar.js +13 -0
- package/lib/v2/springer/router.js +3 -0
- package/lib/v2/springer/templates/description.art +12 -0
- package/lib/v2/supchina/index.js +67 -0
- package/lib/v2/supchina/maintainer.js +4 -0
- package/lib/v2/supchina/podcasts.js +66 -0
- package/lib/v2/supchina/radar.js +19 -0
- package/lib/v2/supchina/router.js +4 -0
- package/lib/v2/techflow520/index.js +34 -0
- package/lib/v2/techflow520/maintainer.js +4 -0
- package/lib/v2/techflow520/newsflash.js +32 -0
- package/lib/v2/techflow520/radar.js +19 -0
- package/lib/v2/techflow520/router.js +4 -0
- package/lib/v2/tencent/cloud/column.js +51 -0
- package/lib/v2/tencent/maintainer.js +1 -0
- package/lib/v2/tencent/radar.js +11 -0
- package/lib/v2/tencent/router.js +1 -0
- package/lib/v2/test/index.js +16 -1
- package/lib/v2/tiktok/user.js +28 -38
- package/lib/v2/trending/allTrending.js +169 -0
- package/lib/v2/trending/maintainer.js +3 -0
- package/lib/v2/trending/radar.js +35 -0
- package/lib/v2/trending/router.js +3 -0
- package/lib/v2/trending/templates/content.art +24 -0
- package/lib/v2/u3c3/index.js +59 -0
- package/lib/v2/u3c3/maintainer.js +3 -0
- package/lib/v2/u3c3/radar.js +29 -0
- package/lib/v2/u3c3/router.js +3 -0
- package/lib/v2/uraaka-joshi/uraaka-joshi-user.js +7 -1
- package/lib/v2/uraaka-joshi/uraaka-joshi.js +8 -1
- package/lib/v2/vlive/index.js +71 -0
- package/lib/v2/vlive/maintainer.js +3 -0
- package/lib/v2/vlive/radar.js +13 -0
- package/lib/v2/vlive/router.js +3 -0
- package/lib/v2/vlive/templates/post.art +8 -0
- package/lib/v2/vlive/templates/video.art +3 -0
- package/lib/v2/xiaohongshu/util.js +6 -6
- package/lib/v2/xjtu/2yuan/news.js +61 -0
- package/lib/v2/xjtu/dean.js +83 -0
- package/lib/{routes/universities → v2}/xjtu/ee.js +5 -5
- package/lib/{routes/universities → v2}/xjtu/gs/tzgg.js +6 -6
- package/lib/v2/xjtu/international.js +51 -0
- package/lib/v2/xjtu/job.js +81 -0
- package/lib/v2/xjtu/maintainer.js +9 -0
- package/lib/v2/xjtu/radar.js +53 -0
- package/lib/v2/xjtu/router.js +9 -0
- package/lib/v2/xjtu/std.js +58 -0
- package/lib/v2/xjtu/templates/attachments.art +3 -0
- package/lib/v2/xjtu/templates/std.art +4 -0
- package/lib/v2/xueqiu/column.js +42 -0
- package/lib/v2/xueqiu/maintainer.js +1 -0
- package/lib/v2/xueqiu/radar.js +6 -0
- package/lib/v2/xueqiu/router.js +1 -0
- package/lib/v2/zhangyoubao/index.js +42 -0
- package/lib/v2/zhangyoubao/maintainer.js +3 -0
- package/lib/v2/zhangyoubao/radar.js +13 -0
- package/lib/v2/zhangyoubao/router.js +3 -0
- package/lib/v2/zhangyoubao/templates/article.art +1 -0
- package/package.json +20 -19
- package/lib/routes/acfun/video.js +0 -44
- package/lib/routes/apnews/topics.js +0 -43
- package/lib/routes/dgjyw/index.js +0 -66
- package/lib/routes/hk01/channel.js +0 -22
- package/lib/routes/hk01/issue.js +0 -22
- package/lib/routes/mirror/entries.js +0 -80
- package/lib/routes/universities/ncwu/notice.js +0 -42
- package/lib/routes/universities/xjtu/dean.js +0 -86
- package/lib/routes/universities/xjtu/international.js +0 -53
- package/lib/routes/universities/xjtu/job.js +0 -50
- package/lib/v2/elsevier/latest.js +0 -87
- package/lib/v2/elsevier/volume.js +0 -75
- package/lib/v2/ieee/latestvol.js +0 -87
- package/lib/v2/jasa/maintainer.js +0 -4
- package/lib/v2/jasa/radar.js +0 -19
- package/lib/v2/jasa/router.js +0 -4
- package/lib/v2/jasa/section.js +0 -95
- package/lib/v2/jasa/templates/description.art +0 -11
package/lib/routes/weibo/user.js
CHANGED
|
@@ -62,7 +62,7 @@ module.exports = async (ctx) => {
|
|
|
62
62
|
false
|
|
63
63
|
);
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
let resultItems = await Promise.all(
|
|
66
66
|
cards
|
|
67
67
|
.filter((item) => item.mblog)
|
|
68
68
|
.map(async (item) => {
|
|
@@ -131,27 +131,18 @@ module.exports = async (ctx) => {
|
|
|
131
131
|
link,
|
|
132
132
|
pubDate,
|
|
133
133
|
author: item.mblog.user.screen_name,
|
|
134
|
+
isPinned: item.profile_type_id?.startsWith('proweibotop'),
|
|
134
135
|
};
|
|
135
136
|
})
|
|
136
137
|
);
|
|
137
138
|
|
|
138
|
-
// remove pinned weibo if
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
|
|
145
|
-
resultItem[0].pubDate &&
|
|
146
|
-
resultItem[0].pubDate <
|
|
147
|
-
Math.min(
|
|
148
|
-
...resultItem
|
|
149
|
-
.slice(1)
|
|
150
|
-
.map((item) => item.pubDate)
|
|
151
|
-
.filter((item) => item)
|
|
152
|
-
)
|
|
153
|
-
) {
|
|
154
|
-
resultItem.shift();
|
|
139
|
+
// remove pinned weibo if they are too old (older than all the rest weibo)
|
|
140
|
+
// the character of pinned weibo is `card.profile_type_id.startsWith('proweibotop')`
|
|
141
|
+
// there can be 1 or 2 (WHAT A FANTASTIC BRAIN THE PM HAS?) pinned weibo at the same time
|
|
142
|
+
const pinnedItems = resultItems.filter((item) => item.isPinned);
|
|
143
|
+
const ordinaryItems = resultItems.filter((item) => !item.isPinned);
|
|
144
|
+
if (pinnedItems.length > 0 && ordinaryItems.length > 0 && Math.max(...pinnedItems.map((i) => i.pubDate).filter(Boolean)) < Math.min(...ordinaryItems.map((i) => i.pubDate).filter(Boolean))) {
|
|
145
|
+
resultItems = ordinaryItems;
|
|
155
146
|
}
|
|
156
147
|
|
|
157
148
|
ctx.state.data = {
|
|
@@ -159,6 +150,6 @@ module.exports = async (ctx) => {
|
|
|
159
150
|
link: `https://weibo.com/${uid}/`,
|
|
160
151
|
description,
|
|
161
152
|
image: profileImageUrl,
|
|
162
|
-
item:
|
|
153
|
+
item: resultItems,
|
|
163
154
|
};
|
|
164
155
|
};
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
const iconv = require('iconv-lite');
|
|
6
|
+
|
|
7
|
+
const setCookie = function (cookieName, cookieValue, seconds, path, domain, secure) {
|
|
8
|
+
let expires = null;
|
|
9
|
+
if (seconds !== -1) {
|
|
10
|
+
expires = new Date();
|
|
11
|
+
expires.setTime(expires.getTime() + seconds);
|
|
12
|
+
}
|
|
13
|
+
return [encodeURI(cookieName), '=', encodeURI(cookieValue), expires ? '; expires=' + expires.toGMTString() : '', path ? '; path=' + path : '/', domain ? '; domain=' + domain : '', secure ? '; secure' : ''].join('');
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
module.exports = async (ctx) => {
|
|
17
|
+
const city = ctx.params.city ?? 'www';
|
|
18
|
+
|
|
19
|
+
const rootUrl = `https://${city}.19lou.com`;
|
|
20
|
+
|
|
21
|
+
const response = await got({
|
|
22
|
+
method: 'get',
|
|
23
|
+
url: rootUrl,
|
|
24
|
+
responseType: 'buffer',
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const $ = cheerio.load(iconv.decode(response.data, 'gbk'));
|
|
28
|
+
|
|
29
|
+
$('.title-more').remove();
|
|
30
|
+
|
|
31
|
+
let items = $('.center-center-jiazi')
|
|
32
|
+
.find('a[title]')
|
|
33
|
+
.toArray()
|
|
34
|
+
.map((item) => {
|
|
35
|
+
item = $(item);
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
title: item.attr('title'),
|
|
39
|
+
link: `https:${item.attr('href')}`,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
items = await Promise.all(
|
|
44
|
+
items.map((item) =>
|
|
45
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
46
|
+
const detailResponse = await got({
|
|
47
|
+
method: 'get',
|
|
48
|
+
url: item.link,
|
|
49
|
+
responseType: 'buffer',
|
|
50
|
+
headers: {
|
|
51
|
+
cookie: setCookie('_Z3nY0d4C_', '37XgPK9h', 365, '/', '19lou.com'),
|
|
52
|
+
referer: rootUrl,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const content = cheerio.load(iconv.decode(detailResponse.data, 'gbk'));
|
|
57
|
+
|
|
58
|
+
content('.name-lz, .postView-pk-mod').remove();
|
|
59
|
+
|
|
60
|
+
item.author = content('.uname, .user-name').first().text();
|
|
61
|
+
item.description = content('.post-cont').first().html() || content('.thread-cont').html();
|
|
62
|
+
item.pubDate = timezone(parseDate(content('.cont-top-left meta').first().attr('content')), +8);
|
|
63
|
+
|
|
64
|
+
return item;
|
|
65
|
+
})
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
ctx.state.data = {
|
|
70
|
+
title: $('title').text().split('-')[0],
|
|
71
|
+
link: rootUrl,
|
|
72
|
+
item: items,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'19lou.com': {
|
|
3
|
+
_name: '19 楼',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: '头条',
|
|
7
|
+
docs: 'https://docs.rsshub.app/bbs.html#19-lou-tou-tiao',
|
|
8
|
+
source: ['/'],
|
|
9
|
+
target: (params, url) => `/19lou/${new URL(url).toString().match(/\/\/(.*?)\.19lou/)[1]}`,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
www: [
|
|
13
|
+
{
|
|
14
|
+
title: '头条',
|
|
15
|
+
docs: 'https://docs.rsshub.app/bbs.html#19-lou-tou-tiao',
|
|
16
|
+
source: ['/'],
|
|
17
|
+
target: '/19lou/www',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
jiaxing: [
|
|
21
|
+
{
|
|
22
|
+
title: '头条',
|
|
23
|
+
docs: 'https://docs.rsshub.app/bbs.html#19-lou-tou-tiao',
|
|
24
|
+
source: ['/'],
|
|
25
|
+
target: '/19lou/jiaxing',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
};
|
package/lib/v2/36kr/router.js
CHANGED
|
@@ -3,5 +3,5 @@ module.exports = (router) => {
|
|
|
3
3
|
router.get('/news/:category?', require('./news'));
|
|
4
4
|
router.get('/newsflashes', require('./newsflashes'));
|
|
5
5
|
router.get('/search/article/:keyword', require('./search/article'));
|
|
6
|
-
router.get('/user/:
|
|
6
|
+
router.get('/user/:id', require('./user'));
|
|
7
7
|
};
|
package/lib/v2/36kr/user.js
CHANGED
|
@@ -2,35 +2,60 @@ const got = require('@/utils/got');
|
|
|
2
2
|
const { parseDate } = require('@/utils/parse-date');
|
|
3
3
|
|
|
4
4
|
module.exports = async (ctx) => {
|
|
5
|
-
const
|
|
5
|
+
const id = ctx.params.id;
|
|
6
|
+
|
|
7
|
+
const rootUrl = 'https://36kr.com';
|
|
8
|
+
const apiRootUrl = 'https://gateway.36kr.com';
|
|
9
|
+
const currentUrl = `${rootUrl}/user/${id}`;
|
|
10
|
+
|
|
11
|
+
const infoResponse = await got({
|
|
12
|
+
method: 'post',
|
|
13
|
+
url: `${apiRootUrl}/api/mis/user/info`,
|
|
14
|
+
json: {
|
|
15
|
+
param: {
|
|
16
|
+
userId: id,
|
|
17
|
+
siteId: 1,
|
|
18
|
+
platformId: 2,
|
|
19
|
+
},
|
|
20
|
+
platformId: 2,
|
|
21
|
+
siteId: 1,
|
|
22
|
+
userId: id,
|
|
23
|
+
partner_id: 'web',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
6
27
|
const response = await got({
|
|
7
|
-
method: '
|
|
8
|
-
url:
|
|
28
|
+
method: 'post',
|
|
29
|
+
url: `${apiRootUrl}/api/mis/me/article`,
|
|
30
|
+
json: {
|
|
31
|
+
param: {
|
|
32
|
+
userId: id,
|
|
33
|
+
pageEvent: 0,
|
|
34
|
+
pageSize: 20,
|
|
35
|
+
pageCallback: '',
|
|
36
|
+
siteId: 1,
|
|
37
|
+
platformId: 2,
|
|
38
|
+
},
|
|
39
|
+
pageCallback: '',
|
|
40
|
+
pageEvent: 0,
|
|
41
|
+
pageSize: 20,
|
|
42
|
+
platformId: 2,
|
|
43
|
+
siteId: 1,
|
|
44
|
+
userId: id,
|
|
45
|
+
partner_id: 'web',
|
|
46
|
+
},
|
|
9
47
|
});
|
|
10
|
-
const data = JSON.parse(response.data.match(/"authorDetailData":(.*?),"channel":/)[1]);
|
|
11
48
|
|
|
12
|
-
const
|
|
13
|
-
const authorFlowList = data.authorFlowList.data.itemList;
|
|
14
|
-
const articleList = authorFlowList.map((item) => ({
|
|
49
|
+
const items = response.data.data.itemList.map((item) => ({
|
|
15
50
|
title: item.templateMaterial.widgetTitle,
|
|
16
|
-
link:
|
|
51
|
+
link: `${rootUrl}/p/${item.itemId}`,
|
|
17
52
|
pubDate: parseDate(item.templateMaterial.publishTime),
|
|
53
|
+
description: `<p>${item.templateMaterial.widgetContent}</p>`,
|
|
18
54
|
}));
|
|
19
55
|
|
|
20
56
|
ctx.state.data = {
|
|
21
|
-
title: `
|
|
22
|
-
link:
|
|
23
|
-
item:
|
|
24
|
-
articleList.map((item) =>
|
|
25
|
-
ctx.cache.tryGet(item.link, async () => {
|
|
26
|
-
const contentResponse = await got({ method: 'get', url: item.link });
|
|
27
|
-
const result = contentResponse.data.match(/"articleDetailData":(.*?),"articleRecommendData":/) || contentResponse.data.match(/"videoDetail":(.*?),"authorVideos":/);
|
|
28
|
-
const contentData = JSON.parse(result[1]);
|
|
29
|
-
item.description = contentData.data.widgetContent;
|
|
30
|
-
return item;
|
|
31
|
-
})
|
|
32
|
-
)
|
|
33
|
-
),
|
|
34
|
-
description: `${authorInfo.label} | ${authorInfo.summary}`,
|
|
57
|
+
title: `36kr - ${infoResponse.data.data.userNick}`,
|
|
58
|
+
link: currentUrl,
|
|
59
|
+
item: items,
|
|
35
60
|
};
|
|
36
61
|
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
const baseUrl = 'https://www.acfun.cn';
|
|
6
|
+
const categoryMap = {
|
|
7
|
+
184: {
|
|
8
|
+
title: '二次元画师',
|
|
9
|
+
realmId: 'realmId=18' + '&realmId=14' + '&realmId=51',
|
|
10
|
+
},
|
|
11
|
+
110: {
|
|
12
|
+
title: '综合',
|
|
13
|
+
realmId: 'realmId=5' + '&realmId=22' + '&realmId=28' + '&realmId=3' + '&realmId=4',
|
|
14
|
+
},
|
|
15
|
+
73: {
|
|
16
|
+
title: '生活情感',
|
|
17
|
+
realmId: 'realmId=50' + '&realmId=25' + '&realmId=34' + '&realmId=7' + '&realmId=6' + '&realmId=17' + '&realmId=1' + '&realmId=2' + '&realmId=49',
|
|
18
|
+
},
|
|
19
|
+
164: {
|
|
20
|
+
title: '游戏',
|
|
21
|
+
realmId: 'realmId=8' + '&realmId=53' + '&realmId=52' + '&realmId=11' + '&realmId=43' + '&realmId=44' + '&realmId=45' + '&realmId=46' + '&realmId=47',
|
|
22
|
+
},
|
|
23
|
+
74: {
|
|
24
|
+
title: '动漫文化',
|
|
25
|
+
realmId: 'realmId=13' + '&realmId=31' + '&realmId=48',
|
|
26
|
+
},
|
|
27
|
+
75: {
|
|
28
|
+
title: '漫画文学',
|
|
29
|
+
realmId: 'realmId=15' + '&realmId=23' + '&realmId=16',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const sortTypeEnum = ['createTime', 'lastCommentTime', 'hotScore'];
|
|
33
|
+
const timeRangeEnum = ['all', 'oneDay', 'threeDay', 'oneWeek', 'oneMonth'];
|
|
34
|
+
|
|
35
|
+
module.exports = async (ctx) => {
|
|
36
|
+
const { categoryId, sortType = 'createTime', timeRange = 'all' } = ctx.params;
|
|
37
|
+
if (!categoryMap[categoryId]) {
|
|
38
|
+
throw `Invalid category Id: ${categoryId}`;
|
|
39
|
+
}
|
|
40
|
+
if (!sortTypeEnum.includes(sortType)) {
|
|
41
|
+
throw `Invalid sort type: ${sortType}`;
|
|
42
|
+
}
|
|
43
|
+
if (!timeRangeEnum.includes(timeRange)) {
|
|
44
|
+
throw `Invalid time range: ${timeRange}`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const url = `${baseUrl}/v/list${categoryId}/index.htm`;
|
|
48
|
+
const response = await got.post(
|
|
49
|
+
`${baseUrl}/rest/pc-direct/article/feed` +
|
|
50
|
+
'?cursor=first_page' +
|
|
51
|
+
'&onlyOriginal=false' +
|
|
52
|
+
'&limit=10' +
|
|
53
|
+
`&sortType=${sortType}` +
|
|
54
|
+
`&timeRange=${sortType === 'hotScore' ? timeRange : 'all'}` +
|
|
55
|
+
`&${categoryMap[categoryId].realmId}`,
|
|
56
|
+
{
|
|
57
|
+
headers: {
|
|
58
|
+
referer: url,
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const list = response.data.data.map((item) => ({
|
|
64
|
+
title: item.title,
|
|
65
|
+
link: `${baseUrl}/a/ac${item.articleId}`,
|
|
66
|
+
author: item.userName,
|
|
67
|
+
pubDate: parseDate(item.createTime, 'x'),
|
|
68
|
+
category: item.realmName,
|
|
69
|
+
}));
|
|
70
|
+
|
|
71
|
+
const items = await Promise.all(
|
|
72
|
+
list.map((item) =>
|
|
73
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
74
|
+
const response = await got(item.link, {
|
|
75
|
+
headers: {
|
|
76
|
+
referer: url,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
const $ = cheerio.load(response.data);
|
|
80
|
+
const articleInfo = $('.main script')
|
|
81
|
+
.text()
|
|
82
|
+
.match(/window.articleInfo = (.*);\n\s*window.likeDomain/)[1];
|
|
83
|
+
const data = JSON.parse(articleInfo);
|
|
84
|
+
|
|
85
|
+
item.description = data.parts[0].content;
|
|
86
|
+
if (data.tagList) {
|
|
87
|
+
item.category = [item.category, ...data.tagList.map((tag) => tag.name)];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return item;
|
|
91
|
+
})
|
|
92
|
+
)
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
ctx.state.data = {
|
|
96
|
+
title: categoryMap[categoryId].title,
|
|
97
|
+
link: url,
|
|
98
|
+
item: items,
|
|
99
|
+
};
|
|
100
|
+
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
const got = require('@/utils/got');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
2
3
|
|
|
3
4
|
module.exports = async (ctx) => {
|
|
4
5
|
const { id } = ctx.params;
|
|
5
|
-
const url = `
|
|
6
|
+
const url = `https://www.acfun.cn/bangumi/aa${id}`;
|
|
6
7
|
|
|
7
|
-
const bangumiPage = await got({
|
|
8
|
-
method: 'get',
|
|
9
|
-
url,
|
|
8
|
+
const bangumiPage = await got(url, {
|
|
10
9
|
headers: {
|
|
11
|
-
Referer: '
|
|
10
|
+
Referer: 'https://www.acfun.cn',
|
|
12
11
|
},
|
|
13
12
|
});
|
|
14
13
|
const bangumiData = JSON.parse(bangumiPage.data.match(/window.bangumiData = (.*?);\n/)[1]);
|
|
@@ -18,11 +17,12 @@ module.exports = async (ctx) => {
|
|
|
18
17
|
title: bangumiData.bangumiTitle,
|
|
19
18
|
link: url,
|
|
20
19
|
description: bangumiData.bangumiIntro,
|
|
20
|
+
image: bangumiData.belongResource.coverImageV,
|
|
21
21
|
item: bangumiList.items.map((item) => ({
|
|
22
22
|
title: `${item.episodeName} - ${item.title}`,
|
|
23
|
-
description: `<img src="${item.
|
|
23
|
+
description: `<img src="${item.imgInfo.thumbnailImage.cdnUrls[0].url.split('?')[0]}">`,
|
|
24
24
|
link: `http://www.acfun.cn/bangumi/aa${id}_36188_${item.itemId}`,
|
|
25
|
-
pubDate:
|
|
25
|
+
pubDate: parseDate(item.updateTime, 'x'),
|
|
26
26
|
})),
|
|
27
27
|
};
|
|
28
28
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'acfun.cn': {
|
|
3
|
+
_name: 'AcFun',
|
|
4
|
+
www: [
|
|
5
|
+
{
|
|
6
|
+
tilte: '番剧',
|
|
7
|
+
docs: 'https://docs.rsshub.app/anime.html#acfun-fan-ju',
|
|
8
|
+
source: '/bangumi/:id',
|
|
9
|
+
target: (params) => `/acfun/bangumi/${params.id.replace('aa', '')}`,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
title: '用户投稿',
|
|
13
|
+
docs: 'https://docs.rsshub.app/anime.html#acfun-yong-hu-tou-gao',
|
|
14
|
+
source: '/u/:id',
|
|
15
|
+
target: '/acfun/user/video/:id',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
title: '文章',
|
|
19
|
+
docs: 'https://docs.rsshub.app/anime.html#acfun',
|
|
20
|
+
source: '/v/:categoryId/index.htm',
|
|
21
|
+
target: (params) => `/acfun/article/${params.categoryId.replace('list', '')}`,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
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 url = `https://www.acfun.cn/u/${uid}`;
|
|
8
|
+
const host = 'https://www.acfun.cn';
|
|
9
|
+
const response = await got(url, {
|
|
10
|
+
headers: {
|
|
11
|
+
Referer: host,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
const data = response.data;
|
|
15
|
+
|
|
16
|
+
const $ = cheerio.load(data);
|
|
17
|
+
const title = $('title').text();
|
|
18
|
+
const description = $('.signature .complete').text();
|
|
19
|
+
const list = $('#ac-space-video-list a').get();
|
|
20
|
+
const image = $('head style')
|
|
21
|
+
.text()
|
|
22
|
+
.match(/.user-photo{\n\s*background:url\((.*)\) 0% 0% \/ 100% no-repeat;/)[1];
|
|
23
|
+
|
|
24
|
+
ctx.state.data = {
|
|
25
|
+
title,
|
|
26
|
+
link: url,
|
|
27
|
+
description,
|
|
28
|
+
image,
|
|
29
|
+
item: list.map((item) => {
|
|
30
|
+
item = $(item);
|
|
31
|
+
|
|
32
|
+
const itemTitle = item.find('p.title').text();
|
|
33
|
+
const itemImg = item.find('figure img').attr('src');
|
|
34
|
+
const itemUrl = item.attr('href');
|
|
35
|
+
const itemDate = item.find('.date').text();
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
title: itemTitle,
|
|
39
|
+
description: `<img src="${itemImg.split('?')[0]}">`,
|
|
40
|
+
link: host + itemUrl,
|
|
41
|
+
pubDate: parseDate(itemDate, 'YYYY/MM/DD'),
|
|
42
|
+
};
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
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 ?? 'initium';
|
|
7
|
+
|
|
8
|
+
const rootUrl = 'https://agora0.gitlab.io';
|
|
9
|
+
const currentUrl = `${rootUrl}/blog/${category}`;
|
|
10
|
+
|
|
11
|
+
const response = await got({
|
|
12
|
+
method: 'get',
|
|
13
|
+
url: currentUrl,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const $ = cheerio.load(response.data);
|
|
17
|
+
|
|
18
|
+
let items = $('.card span:not(.comments) a')
|
|
19
|
+
.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 50)
|
|
20
|
+
.toArray()
|
|
21
|
+
.map((item) => {
|
|
22
|
+
item = $(item);
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
title: item.text(),
|
|
26
|
+
link: item.attr('href'),
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
items = await Promise.all(
|
|
31
|
+
items.map((item) =>
|
|
32
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
33
|
+
const detailResponse = await got({
|
|
34
|
+
method: 'get',
|
|
35
|
+
url: item.link,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const content = cheerio.load(detailResponse.data);
|
|
39
|
+
|
|
40
|
+
item.author = content('meta[name="author"]').attr('content');
|
|
41
|
+
item.pubDate = parseDate(content('meta[property="article:published_time"]').attr('content'));
|
|
42
|
+
item.description = content('.post-content').html();
|
|
43
|
+
|
|
44
|
+
return item;
|
|
45
|
+
})
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
ctx.state.data = {
|
|
50
|
+
title: $('title').text(),
|
|
51
|
+
link: currentUrl,
|
|
52
|
+
item: items,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{{ if media }}
|
|
2
|
+
{{ each media }}
|
|
3
|
+
{{ if $value.type === 'Photo' }}
|
|
4
|
+
<figure>
|
|
5
|
+
<img src="{{ $value.gcsBaseUrl + $value.imageRenderedSizes[0] + $value.imageFileExtension }}" alt="{{ $value.flattenedCaption }}">
|
|
6
|
+
<figcaption>{{@ $value.caption }}</figcaption>
|
|
7
|
+
</figure>
|
|
8
|
+
{{ else if $value.type === 'YouTube' }}
|
|
9
|
+
<iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube-nocookie.com/embed/{{ $value.externalId }}" frameborder="0" allowfullscreen></iframe>
|
|
10
|
+
{{ if $value.caption }}{{@ $value.caption }}{{ /if }}
|
|
11
|
+
{{ /if }}
|
|
12
|
+
{{ /each }}
|
|
13
|
+
{{ /if }}
|
|
14
|
+
{{@ description }}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const { art } = require('@/utils/render');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const HOME_PAGE = 'https://apnews.com';
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const { topic = 'trending-news' } = ctx.params;
|
|
10
|
+
const urlLink = `${HOME_PAGE}/hub/${topic}`;
|
|
11
|
+
const response = await got(urlLink);
|
|
12
|
+
const $ = cheerio.load(response.data);
|
|
13
|
+
const data = JSON.parse(
|
|
14
|
+
$('script')
|
|
15
|
+
.not('[src], [type]')
|
|
16
|
+
.text()
|
|
17
|
+
.match(/window\['titanium-state'\] = (.*)\nwindow\['titanium-cacheConfig'\]/)[1]
|
|
18
|
+
);
|
|
19
|
+
const meta = data.hub.data[`/${topic}`];
|
|
20
|
+
|
|
21
|
+
const items = meta.cards.map((item) => {
|
|
22
|
+
const description = cheerio.load(item.contents[0].storyHTML, null, false);
|
|
23
|
+
description('.ad-placeholder').remove();
|
|
24
|
+
return {
|
|
25
|
+
title: item.contents[0].headline,
|
|
26
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
27
|
+
media: item.contents[0].media,
|
|
28
|
+
description: description.html(),
|
|
29
|
+
}),
|
|
30
|
+
link: `${HOME_PAGE}/article/${item.contents[0].canonicalUrl}-${item.contents[0].shortId}`,
|
|
31
|
+
author: item.contents[0].bylines ? item.contents[0].bylines.slice(3) : null,
|
|
32
|
+
pubDate: parseDate(item.contents[0].published),
|
|
33
|
+
category: item.contents[0].tagObjs.map((tag) => tag.name),
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
ctx.state.data = {
|
|
38
|
+
title: meta.tagObjs[0].seoTitle,
|
|
39
|
+
description: meta.tagObjs[0].seoDescription,
|
|
40
|
+
link: urlLink,
|
|
41
|
+
item: items,
|
|
42
|
+
language: $('html').attr('lang'),
|
|
43
|
+
};
|
|
44
|
+
};
|