rsshub 1.0.0-master.fe4f650 → 1.0.0-master.fe560d2
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/README.md +3 -3
- package/lib/config.js +1 -1
- package/lib/middleware/parameter.js +3 -3
- package/lib/radar-rules.js +0 -46
- package/lib/router.js +28 -28
- package/lib/routes/v2ex/post.js +3 -0
- package/lib/utils/puppeteer-utils.js +63 -0
- package/lib/utils/puppeteer.js +13 -8
- package/lib/utils/request-wrapper.js +38 -100
- package/lib/utils/unify-proxy.js +116 -0
- package/lib/utils/wechat-mp.js +2 -0
- package/lib/v2/18comic/utils.js +2 -2
- package/lib/v2/36kr/index.js +29 -24
- package/lib/v2/agora0/maintainer.js +1 -0
- package/lib/v2/agora0/pen0.js +43 -0
- package/lib/v2/agora0/radar.js +12 -1
- package/lib/v2/agora0/router.js +1 -0
- package/lib/v2/aiea/index.js +39 -0
- package/lib/v2/aiea/maintainer.js +3 -0
- package/lib/v2/aiea/radar.js +13 -0
- package/lib/v2/aiea/router.js +3 -0
- package/lib/v2/baidu/radar.js +6 -6
- package/lib/v2/bangumi/online/online.js +4 -2
- package/lib/v2/bangumi/tv/group/reply.js +13 -1
- package/lib/v2/bangumi/tv/group/topic.js +22 -9
- package/lib/v2/bilibili/cache.js +34 -1
- package/lib/v2/bilibili/userCollection.js +1 -2
- package/lib/v2/bilibili/utils.js +10 -0
- package/lib/v2/bilibili/video-all.js +5 -2
- package/lib/v2/bilibili/video.js +3 -1
- package/lib/v2/bytes/bytes.js +25 -0
- package/lib/v2/bytes/maintainer.js +4 -0
- package/lib/v2/bytes/radar.js +13 -0
- package/lib/v2/bytes/router.js +3 -0
- package/lib/v2/caijing/maintainer.js +3 -0
- package/lib/v2/caijing/radar.js +13 -0
- package/lib/v2/caijing/roll.js +46 -0
- package/lib/v2/caijing/router.js +3 -0
- package/lib/v2/cdzjryb/maintainer.js +3 -0
- package/lib/v2/cdzjryb/projectList.js +49 -0
- package/lib/v2/cdzjryb/radar.js +13 -0
- package/lib/v2/cdzjryb/router.js +3 -0
- package/lib/v2/cdzjryb/templates/projectList.art +23 -0
- package/lib/v2/chsi/kydt.js +51 -0
- package/lib/v2/chsi/maintainer.js +3 -0
- package/lib/v2/chsi/radar.js +13 -0
- package/lib/v2/chsi/router.js +3 -0
- package/lib/v2/cnbeta/radar.js +6 -6
- package/lib/v2/cnbeta/router.js +1 -1
- package/lib/v2/cnbeta/type.js +6 -12
- package/lib/v2/cnbeta/utils.js +5 -8
- package/lib/v2/cngal/entry.js +25 -0
- package/lib/v2/cngal/maintainer.js +4 -0
- package/lib/v2/cngal/radar.js +19 -0
- package/lib/v2/cngal/router.js +4 -0
- package/lib/v2/cngal/templates/entry-description.art +4 -0
- package/lib/v2/cngal/templates/weekly-description.art +4 -0
- package/lib/v2/cngal/weekly.js +20 -0
- package/lib/v2/cnki/author.js +45 -0
- package/lib/v2/cnki/journals.js +2 -23
- package/lib/v2/cnki/maintainer.js +1 -0
- package/lib/v2/cnki/radar.js +8 -0
- package/lib/v2/cnki/router.js +1 -0
- package/lib/v2/cnki/utils.js +26 -0
- package/lib/v2/codeforces/maintainer.js +1 -0
- package/lib/v2/codeforces/radar.js +8 -0
- package/lib/v2/codeforces/recent_actions.js +47 -0
- package/lib/v2/codeforces/router.js +1 -0
- package/lib/v2/curius/links.js +43 -0
- package/lib/v2/curius/maintainer.js +3 -0
- package/lib/v2/curius/radar.js +13 -0
- package/lib/v2/curius/router.js +3 -0
- package/lib/v2/curius/templates/description.art +16 -0
- package/lib/v2/douyin/hashtag.js +20 -19
- package/lib/v2/douyin/live.js +2 -21
- package/lib/v2/douyin/user.js +2 -17
- package/lib/v2/douyin/utils.js +85 -0
- package/lib/v2/{acm-ecnu → ecnu}/contest.js +1 -4
- package/lib/v2/ecnu/maintainer.js +4 -0
- package/lib/v2/ecnu/radar.js +30 -0
- package/lib/v2/ecnu/router.js +4 -0
- package/lib/v2/{acm-ecnu → ecnu}/templates/description.art +0 -0
- package/lib/v2/ecnu/yjs.js +37 -0
- package/lib/v2/ehentai/ehapi.js +23 -12
- package/lib/v2/foresightnews/index.js +8 -11
- package/lib/v2/foreverblog/feeds.js +36 -0
- package/lib/v2/foreverblog/maintainer.js +3 -0
- package/lib/v2/foreverblog/radar.js +13 -0
- package/lib/v2/foreverblog/router.js +3 -0
- package/lib/v2/freewechat/maintainer.js +3 -0
- package/lib/v2/freewechat/profile.js +61 -0
- package/lib/v2/freewechat/radar.js +13 -0
- package/lib/v2/freewechat/router.js +3 -0
- package/lib/v2/gcores/category.js +16 -6
- package/lib/v2/good/index.js +15 -14
- package/lib/v2/gov/customs/list.js +1 -1
- package/lib/v2/gov/dianbai/dianbai.js +18 -0
- package/lib/v2/gov/gaozhou/gaozhou.js +19 -0
- package/lib/v2/gov/general/general.js +250 -0
- package/lib/v2/gov/general/templates/zcjdpt.art +128 -0
- package/lib/v2/gov/gz/index.js +38 -0
- package/lib/v2/gov/huazhou/huazhou.js +19 -0
- package/lib/v2/gov/hunan/changsha/major-email.js +52 -0
- package/lib/v2/gov/maintainer.js +19 -2
- package/lib/v2/gov/maoming/maoming.js +417 -0
- package/lib/v2/gov/maonan/maonan.js +100 -0
- package/lib/v2/gov/mgs/mgs.js +19 -0
- package/lib/v2/gov/mmht/mmht.js +19 -0
- package/lib/v2/gov/nmpa/generic.js +1 -1
- package/lib/v2/gov/radar.js +197 -0
- package/lib/v2/gov/router.js +18 -2
- package/lib/v2/gov/sasac/generic.js +42 -0
- package/lib/v2/gov/sdb/sdb.js +19 -0
- package/lib/v2/gov/shanghai/yjj/index.js +3 -1
- package/lib/v2/gov/xinyi/xinyi.js +19 -0
- package/lib/v2/gov/zhengce/govall.js +55 -0
- package/lib/v2/gov/zhengce/wenjian.js +47 -0
- package/lib/v2/gov/zhengce/zhengceku.js +22 -0
- package/lib/v2/gov/zhengce/zuixin.js +39 -0
- package/lib/v2/guanhai/index.js +47 -0
- package/lib/v2/guanhai/maintainer.js +4 -0
- package/lib/v2/guanhai/radar.js +13 -0
- package/lib/v2/guanhai/router.js +3 -0
- package/lib/v2/hackernews/index.js +6 -0
- package/lib/v2/hellogithub/volume.js +15 -32
- package/lib/v2/{heu → hrbeu}/gx/card.js +5 -10
- package/lib/v2/{heu → hrbeu}/gx/list.js +12 -20
- package/lib/v2/hrbeu/job/bigemploy.js +25 -0
- package/lib/v2/{heu → hrbeu}/job/calendar.js +8 -16
- package/lib/v2/{heu → hrbeu}/job/list.js +11 -16
- package/lib/v2/{heu → hrbeu}/maintainer.js +2 -1
- package/lib/v2/{heu → hrbeu}/radar.js +18 -10
- package/lib/v2/{heu → hrbeu}/router.js +3 -2
- package/lib/v2/{heu → hrbeu}/uae/list.js +12 -17
- package/lib/v2/hrbeu/ugs/news.js +98 -0
- package/lib/v2/{heu → hrbeu}/yjsy/list.js +8 -16
- package/lib/v2/ieee-security/maintainer.js +3 -0
- package/lib/v2/ieee-security/radar.js +13 -0
- package/lib/v2/ieee-security/router.js +3 -0
- package/lib/v2/ieee-security/sp.js +36 -0
- package/lib/v2/javbus/index.js +8 -2
- package/lib/v2/javbus/templates/description.art +12 -1
- package/lib/v2/jike/user.js +1 -0
- package/lib/v2/lang/maintainer.js +3 -0
- package/lib/v2/lang/radar.js +13 -0
- package/lib/v2/lang/room.js +40 -0
- package/lib/v2/lang/router.js +3 -0
- package/lib/v2/lang/templates/room.art +1 -0
- package/lib/v2/liulinblog/utils.js +7 -4
- package/lib/v2/luogu/daily.js +1 -1
- package/lib/v2/mangadex/index.js +73 -0
- package/lib/v2/mangadex/maintainer.js +3 -0
- package/lib/v2/mangadex/radar.js +13 -0
- package/lib/v2/mangadex/router.js +3 -0
- package/lib/v2/mihoyo/ys/news.js +3 -2
- package/lib/v2/mirror/index.js +15 -8
- package/lib/v2/mrdx/daily.js +79 -0
- package/lib/v2/mrdx/maintainer.js +3 -0
- package/lib/v2/mrdx/radar.js +13 -0
- package/lib/v2/mrdx/router.js +3 -0
- package/lib/v2/mrdx/utils.js +17 -0
- package/lib/v2/mtime/news.js +1 -1
- package/lib/v2/nautil/maintainer.js +3 -0
- package/lib/v2/nautil/radar.js +13 -0
- package/lib/v2/nautil/router.js +3 -0
- package/lib/v2/nautil/templates/description.art +6 -0
- package/lib/v2/nautil/topics.js +57 -0
- package/lib/v2/ndss-symposium/maintainer.js +3 -0
- package/lib/v2/ndss-symposium/ndss.js +80 -0
- package/lib/v2/ndss-symposium/radar.js +13 -0
- package/lib/v2/ndss-symposium/router.js +3 -0
- package/lib/v2/nextapple/realtime.js +1 -1
- package/lib/v2/nintendo/direct.js +31 -0
- package/lib/v2/nintendo/eshop_cn.js +44 -0
- package/lib/v2/nintendo/eshop_hk.js +79 -0
- package/lib/v2/nintendo/eshop_jp.js +34 -0
- package/lib/v2/nintendo/eshop_us.js +32 -0
- package/lib/v2/nintendo/maintainer.js +7 -0
- package/lib/v2/nintendo/news.js +23 -0
- package/lib/v2/nintendo/news_china.js +35 -0
- package/lib/v2/nintendo/radar.js +70 -0
- package/lib/v2/nintendo/router.js +10 -0
- package/lib/{routes → v2}/nintendo/system-update.js +2 -2
- package/lib/v2/nintendo/templates/direct.art +6 -0
- package/lib/v2/nintendo/templates/eshop_cn.art +21 -0
- package/lib/v2/nintendo/templates/eshop_hk.art +61 -0
- package/lib/v2/nintendo/templates/eshop_jp.art +3 -0
- package/lib/v2/nintendo/templates/eshop_us.art +24 -0
- package/lib/{routes → v2}/nintendo/utils.js +34 -50
- package/lib/v2/njxzc/home.js +13 -9
- package/lib/v2/nmtv/column.js +53 -0
- package/lib/v2/nmtv/maintainer.js +3 -0
- package/lib/v2/nmtv/radar.js +13 -0
- package/lib/v2/nmtv/router.js +3 -0
- package/lib/v2/nmtv/templates/description.art +9 -0
- package/lib/v2/nua/lib.js +39 -0
- package/lib/v2/nua/maintainer.js +1 -0
- package/lib/v2/nua/radar.js +8 -0
- package/lib/v2/nua/router.js +1 -0
- package/lib/v2/nua/utils.js +7 -12
- package/lib/v2/nuaa/utils/pypasswaf.js +3 -2
- package/lib/v2/nyaa/main.js +16 -23
- package/lib/v2/nyaa/maintainer.js +7 -4
- package/lib/v2/nyaa/radar.js +27 -29
- package/lib/v2/nyaa/router.js +4 -2
- package/lib/v2/odaily/post.js +15 -20
- package/lib/v2/odaily/utils.js +1 -1
- package/lib/v2/paradigm/maintainer.js +3 -0
- package/lib/v2/paradigm/radar.js +13 -0
- package/lib/v2/paradigm/router.js +3 -0
- package/lib/v2/paradigm/writing.js +44 -0
- package/lib/v2/picuki/maintainer.js +1 -1
- package/lib/v2/picuki/profile.js +10 -8
- package/lib/v2/picuki/utils.js +21 -0
- package/lib/v2/pixiv/api/getRanking.js +1 -1
- package/lib/v2/pixiv/ranking.js +3 -0
- package/lib/v2/producthunt/templates/descImg.art +2 -2
- package/lib/v2/qlu/maintainer.js +3 -0
- package/lib/v2/qlu/notice.js +54 -0
- package/lib/v2/qlu/radar.js +13 -0
- package/lib/v2/qlu/router.js +3 -0
- package/lib/v2/reactnewsletter/maintainer.js +4 -0
- package/lib/v2/reactnewsletter/radar.js +13 -0
- package/lib/v2/reactnewsletter/reactnewsletter.js +25 -0
- package/lib/v2/reactnewsletter/router.js +3 -0
- package/lib/v2/researchgate/maintainer.js +3 -0
- package/lib/v2/researchgate/publications.js +70 -0
- package/lib/v2/researchgate/radar.js +13 -0
- package/lib/v2/researchgate/router.js +3 -0
- package/lib/v2/saraba1st/digest.js +79 -0
- package/lib/v2/saraba1st/maintainer.js +1 -0
- package/lib/v2/saraba1st/radar.js +12 -3
- package/lib/v2/saraba1st/router.js +1 -0
- package/lib/v2/saraba1st/templates/digest.art +5 -0
- package/lib/v2/sctv/maintainer.js +1 -1
- package/lib/v2/sctv/programme.js +39 -17
- package/lib/v2/sctv/router.js +1 -1
- package/lib/v2/shmtu/jwc.js +57 -0
- package/lib/v2/shmtu/maintainer.js +5 -0
- package/lib/v2/shmtu/portal.js +81 -0
- package/lib/v2/shmtu/radar.js +29 -0
- package/lib/v2/shmtu/router.js +5 -0
- package/lib/v2/shmtu/templates/portal.art +30 -0
- package/lib/v2/shmtu/www.js +58 -0
- package/lib/v2/sigsac/ccs.js +57 -0
- package/lib/v2/sigsac/maintainer.js +3 -0
- package/lib/v2/sigsac/radar.js +13 -0
- package/lib/v2/sigsac/router.js +3 -0
- package/lib/v2/simpleinfo/index.js +50 -0
- package/lib/v2/simpleinfo/maintainer.js +3 -0
- package/lib/v2/simpleinfo/radar.js +19 -0
- package/lib/v2/simpleinfo/router.js +3 -0
- package/lib/v2/simpleinfo/templates/description.art +6 -0
- package/lib/v2/sse/maintainer.js +1 -1
- package/lib/v2/telegram/channel.js +54 -38
- package/lib/v2/tencent/maintainer.js +2 -0
- package/lib/v2/tencent/news/coronavirus/data.js +71 -0
- package/lib/v2/tencent/news/coronavirus/total.js +34 -0
- package/lib/v2/tencent/news/coronavirus/utils.js +17 -0
- package/lib/v2/tencent/radar.js +8 -0
- package/lib/v2/tencent/router.js +2 -0
- package/lib/v2/tencent/templates/coronavirus/chinaTotal.art +6 -0
- package/lib/v2/tencent/templates/coronavirus/data.art +4 -0
- package/lib/v2/test/index.js +8 -0
- package/lib/v2/theverge/index.js +9 -1
- package/lib/v2/theverge/maintainer.js +1 -1
- package/lib/v2/theverge/radar.js +2 -2
- package/lib/v2/theverge/router.js +1 -1
- package/lib/v2/tingshuitz/changsha.js +43 -0
- package/lib/v2/tingshuitz/maintainer.js +1 -0
- package/lib/v2/tingshuitz/radar.js +10 -0
- package/lib/v2/tingshuitz/router.js +1 -0
- package/lib/v2/twitter/web-api/twitter-api.js +19 -15
- package/lib/v2/twreporter/category.js +17 -8
- package/lib/v2/uber/blog.js +59 -0
- package/lib/v2/uber/maintainer.js +3 -0
- package/lib/v2/uber/radar.js +13 -0
- package/lib/v2/uber/router.js +3 -0
- package/lib/v2/usenix/maintainer.js +3 -0
- package/lib/v2/usenix/radar.js +13 -0
- package/lib/v2/usenix/router.js +3 -0
- package/lib/v2/usenix/usenix.js +63 -0
- package/lib/v2/usepanda/index.js +26 -0
- package/lib/v2/usepanda/maintainer.js +3 -0
- package/lib/v2/usepanda/radar.js +11 -0
- package/lib/v2/usepanda/router.js +3 -0
- package/lib/v2/uw/gix/news.js +67 -0
- package/lib/v2/uw/maintainer.js +3 -0
- package/lib/v2/uw/radar.js +13 -0
- package/lib/v2/uw/router.js +3 -0
- package/lib/v2/verse/articles.js +42 -0
- package/lib/v2/verse/maintainer.js +3 -0
- package/lib/v2/verse/radar.js +13 -0
- package/lib/v2/verse/router.js +3 -0
- package/lib/{routes → v2}/weibo/keyword.js +2 -2
- package/lib/v2/weibo/maintainer.js +8 -0
- package/lib/v2/weibo/oasis/user.js +20 -0
- package/lib/v2/weibo/radar.js +48 -0
- package/lib/v2/weibo/router.js +8 -0
- package/lib/{routes → v2}/weibo/search/hot.js +2 -0
- package/lib/{routes → v2}/weibo/super_index.js +2 -2
- package/lib/{routes → v2}/weibo/timeline.js +2 -2
- package/lib/{routes → v2}/weibo/user.js +2 -2
- package/lib/{routes → v2}/weibo/utils.js +49 -14
- package/lib/v2/ymgal/article.js +61 -0
- package/lib/v2/ymgal/game.js +41 -0
- package/lib/v2/ymgal/maintainer.js +4 -0
- package/lib/v2/ymgal/radar.js +31 -0
- package/lib/v2/ymgal/router.js +4 -0
- package/lib/v2/ymgal/templates/description.art +7 -0
- package/lib/v2/zhihu/pin/utils.js +49 -41
- package/package.json +26 -27
- package/lib/routes/blogs/foreverblog.js +0 -33
- package/lib/routes/gov/zhengce/govall.js +0 -59
- package/lib/routes/gov/zhengce/wenjian.js +0 -53
- package/lib/routes/gov/zhengce/zuixin.js +0 -42
- package/lib/routes/langlive/room.js +0 -33
- package/lib/routes/nautilus/topics.js +0 -45
- package/lib/routes/nintendo/direct.js +0 -34
- package/lib/routes/nintendo/eshop_cn.js +0 -51
- package/lib/routes/nintendo/eshop_hk.js +0 -26
- package/lib/routes/nintendo/eshop_jp.js +0 -20
- package/lib/routes/nintendo/eshop_us.js +0 -36
- package/lib/routes/nintendo/news.js +0 -25
- package/lib/routes/nintendo/news_china.js +0 -41
- package/lib/routes/researchgate/publications.js +0 -60
- package/lib/routes/universities/ecnuyjs/ecnuyjs.js +0 -23
- package/lib/routes/universities/shmtu/jwc.js +0 -75
- package/lib/routes/universities/shmtu/www.js +0 -61
- package/lib/routes/weibo/oasis/user.js +0 -17
- package/lib/v2/acm-ecnu/maintainer.js +0 -3
- package/lib/v2/acm-ecnu/radar.js +0 -19
- package/lib/v2/acm-ecnu/router.js +0 -3
- package/lib/v2/cnbeta/index.js +0 -16
- package/lib/v2/heu/job/bigemploy.js +0 -42
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
|
|
5
|
+
const baseUrl = 'https://www.paradigm.xyz';
|
|
6
|
+
|
|
7
|
+
module.exports = async (ctx) => {
|
|
8
|
+
const url = `${baseUrl}/writing`;
|
|
9
|
+
|
|
10
|
+
const response = await got(url);
|
|
11
|
+
const $ = cheerio.load(response.data);
|
|
12
|
+
|
|
13
|
+
const nextData = JSON.parse($('#__NEXT_DATA__').text());
|
|
14
|
+
const buildId = nextData.buildId;
|
|
15
|
+
const list = nextData.props.pageProps.posts.map((item) => ({
|
|
16
|
+
title: item.title,
|
|
17
|
+
link: `${baseUrl}${item.slug}`,
|
|
18
|
+
api: `${baseUrl}/_next/data/${buildId}${item.slug}.json`,
|
|
19
|
+
author: item.authors.map((author) => author.name).join(', '),
|
|
20
|
+
pubDate: parseDate(item.originalDate),
|
|
21
|
+
category: item.tags,
|
|
22
|
+
}));
|
|
23
|
+
|
|
24
|
+
const items = await Promise.all(
|
|
25
|
+
list.map((item) =>
|
|
26
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
27
|
+
const response = await got(item.api);
|
|
28
|
+
const $ = cheerio.load(response.data.pageProps.content, null, false);
|
|
29
|
+
|
|
30
|
+
// Remove the TOC
|
|
31
|
+
$('.toc').remove();
|
|
32
|
+
item.description = $.html();
|
|
33
|
+
|
|
34
|
+
return item;
|
|
35
|
+
})
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
ctx.state.data = {
|
|
40
|
+
title: 'Paradigm - Writing',
|
|
41
|
+
link: url,
|
|
42
|
+
item: items,
|
|
43
|
+
};
|
|
44
|
+
};
|
package/lib/v2/picuki/profile.js
CHANGED
|
@@ -4,8 +4,12 @@ const chrono = require('chrono-node');
|
|
|
4
4
|
const { art } = require('@/utils/render');
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const config = require('@/config').value;
|
|
7
|
+
const { puppeteerGet } = require('./utils');
|
|
7
8
|
|
|
8
9
|
module.exports = async (ctx) => {
|
|
10
|
+
// use Puppeteer due to the obstacle by cloudflare challenge
|
|
11
|
+
const browser = await require('@/utils/puppeteer')();
|
|
12
|
+
|
|
9
13
|
const id = ctx.params.id;
|
|
10
14
|
const displayVideo = ctx.params.functionalFlag !== '0';
|
|
11
15
|
const includeStories = ctx.params.functionalFlag === '10';
|
|
@@ -15,8 +19,8 @@ module.exports = async (ctx) => {
|
|
|
15
19
|
const data = await ctx.cache.tryGet(
|
|
16
20
|
profileUrl,
|
|
17
21
|
async () => {
|
|
18
|
-
const _r = await
|
|
19
|
-
return _r
|
|
22
|
+
const _r = await puppeteerGet(profileUrl, browser);
|
|
23
|
+
return _r;
|
|
20
24
|
},
|
|
21
25
|
config.cache.routeExpire,
|
|
22
26
|
false
|
|
@@ -31,12 +35,8 @@ module.exports = async (ctx) => {
|
|
|
31
35
|
|
|
32
36
|
async function getMedia(url) {
|
|
33
37
|
const getPost = async () => {
|
|
34
|
-
const response = await
|
|
35
|
-
|
|
36
|
-
Referer: profileUrl,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
return response.data;
|
|
38
|
+
const response = await puppeteerGet(url, browser);
|
|
39
|
+
return response;
|
|
40
40
|
};
|
|
41
41
|
let data = await ctx.cache.tryGet(url, getPost);
|
|
42
42
|
if (Object.prototype.toString.call(data) === '[object Object]') {
|
|
@@ -178,6 +178,8 @@ module.exports = async (ctx) => {
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
await browser.close();
|
|
182
|
+
|
|
181
183
|
ctx.state.data = {
|
|
182
184
|
title: `${profileName} (@${id}) - Picuki`,
|
|
183
185
|
link: profileUrl,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const puppeteerGet = async (url, browser) => {
|
|
2
|
+
const page = await browser.newPage();
|
|
3
|
+
// await page.setExtraHTTPHeaders({ referer: host });
|
|
4
|
+
await page.setRequestInterception(true);
|
|
5
|
+
page.on('request', (request) => {
|
|
6
|
+
request.resourceType() === 'document' ? request.continue() : request.abort();
|
|
7
|
+
});
|
|
8
|
+
await page.goto(url, {
|
|
9
|
+
waitUntil: 'domcontentloaded',
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
await page.waitForSelector('.wrapper');
|
|
13
|
+
|
|
14
|
+
const html = await page.evaluate(() => document.documentElement.innerHTML);
|
|
15
|
+
await page.close();
|
|
16
|
+
return html;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
module.exports = {
|
|
20
|
+
puppeteerGet,
|
|
21
|
+
};
|
|
@@ -3,7 +3,7 @@ const maskHeader = require('../constants').maskHeader;
|
|
|
3
3
|
const assert = require('assert');
|
|
4
4
|
const queryString = require('query-string');
|
|
5
5
|
|
|
6
|
-
const allowMode = ['day', 'week', 'month', 'day_male', 'day_female', 'week_original', 'week_rookie', 'day_r18', 'day_male_r18', 'day_female_r18', 'week_r18', 'week_r18g'];
|
|
6
|
+
const allowMode = ['day', 'week', 'month', 'day_male', 'day_female', 'day_ai', 'week_original', 'week_rookie', 'day_r18', 'day_male_r18', 'day_female_r18', 'week_r18', 'week_r18g'];
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* 获取某天的排行榜
|
package/lib/v2/pixiv/ranking.js
CHANGED
|
@@ -17,6 +17,7 @@ const titles = {
|
|
|
17
17
|
day_female_r18: 'pixiv R-18 受女性欢迎排行',
|
|
18
18
|
week_r18: 'pixiv R-18 周排行',
|
|
19
19
|
week_r18g: 'pixiv R-18G 排行',
|
|
20
|
+
day_ai: 'AI 生成作品排行榜',
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
const links = {
|
|
@@ -25,6 +26,7 @@ const links = {
|
|
|
25
26
|
month: 'https://www.pixiv.net/ranking.php?mode=monthly',
|
|
26
27
|
day_male: 'https://www.pixiv.net/ranking.php?mode=male',
|
|
27
28
|
day_female: 'https://www.pixiv.net/ranking.php?mode=female',
|
|
29
|
+
day_ai: 'https://www.pixiv.net/ranking.php?mode=daily_ai',
|
|
28
30
|
week_original: 'https://www.pixiv.net/ranking.php?mode=original',
|
|
29
31
|
week_rookie: 'https://www.pixiv.net/ranking.php?mode=rookie',
|
|
30
32
|
day_r18: 'https://www.pixiv.net/ranking.php?mode=daily_r18',
|
|
@@ -40,6 +42,7 @@ const alias = {
|
|
|
40
42
|
monthly: 'month',
|
|
41
43
|
male: 'day_male',
|
|
42
44
|
female: 'day_female',
|
|
45
|
+
daily_ai: 'day_ai',
|
|
43
46
|
original: 'week_original',
|
|
44
47
|
rookie: 'week_rookie',
|
|
45
48
|
daily_r18: 'day_r18',
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const timezone = require('@/utils/timezone');
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
const host = 'https://www.qlu.edu.cn';
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const response = await got({
|
|
10
|
+
method: 'get',
|
|
11
|
+
url: `${host}/tzggsh/list1.htm`,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const $ = cheerio.load(response.data);
|
|
15
|
+
const list = $('ul.news_list.list2').children();
|
|
16
|
+
|
|
17
|
+
const items = await Promise.all(
|
|
18
|
+
list.map((i, item) => {
|
|
19
|
+
item = $(item);
|
|
20
|
+
const itemTitle = item.find('.news_title').children().text();
|
|
21
|
+
const itemDate = item.find('.news_year').text() + item.find('.news_days').text();
|
|
22
|
+
const path = item.find('.news_title').children().attr('href');
|
|
23
|
+
let itemUrl = '';
|
|
24
|
+
if (!path.startsWith('https://') && !path.startsWith('http://')) {
|
|
25
|
+
itemUrl = host + path;
|
|
26
|
+
} else {
|
|
27
|
+
itemUrl = path;
|
|
28
|
+
}
|
|
29
|
+
return ctx.cache.tryGet(itemUrl, async () => {
|
|
30
|
+
let description = '';
|
|
31
|
+
if (!path.startsWith('https://') && !path.startsWith('http://')) {
|
|
32
|
+
const result = await got(itemUrl);
|
|
33
|
+
const $ = cheerio.load(result.data);
|
|
34
|
+
description = $('.read').html().trim();
|
|
35
|
+
} else {
|
|
36
|
+
description = itemTitle;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
title: itemTitle,
|
|
40
|
+
link: itemUrl,
|
|
41
|
+
pubDate: timezone(parseDate(itemDate), 8),
|
|
42
|
+
description,
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
ctx.state.data = {
|
|
49
|
+
title: `齐鲁工业大学 - 通知公告`,
|
|
50
|
+
link: `${host}/tzggsh/list1.htm`,
|
|
51
|
+
description: '齐鲁工业大学 - 通知公告',
|
|
52
|
+
item: items,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const currentURL = 'https://reactnewsletter.com/issues';
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
|
|
6
|
+
module.exports = async (ctx) => {
|
|
7
|
+
const resp = await got(currentURL);
|
|
8
|
+
const $ = cheerio.load(resp.data);
|
|
9
|
+
const text = $('script#__NEXT_DATA__').text();
|
|
10
|
+
const json = JSON.parse(text);
|
|
11
|
+
|
|
12
|
+
const items = json.props.pageProps.issues.map((item) => ({
|
|
13
|
+
title: item.title,
|
|
14
|
+
pubDate: parseDate(item.date),
|
|
15
|
+
description: item.summary,
|
|
16
|
+
link: `/issues/${item.slug}`,
|
|
17
|
+
}));
|
|
18
|
+
|
|
19
|
+
ctx.state.data = {
|
|
20
|
+
title: 'reactnewsletter.dev',
|
|
21
|
+
description: 'Stay up to date on the latest React news, tutorials, resources, and more. Delivered every Tuesday, for free.',
|
|
22
|
+
link: currentURL,
|
|
23
|
+
item: items,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
const cheerio = require('cheerio');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
|
|
4
|
+
module.exports = async (ctx) => {
|
|
5
|
+
const id = ctx.params.id;
|
|
6
|
+
|
|
7
|
+
const rootUrl = 'https://www.researchgate.net';
|
|
8
|
+
const currentUrl = `${rootUrl}/profile/${id}`;
|
|
9
|
+
const browser = await require('@/utils/puppeteer')();
|
|
10
|
+
const page = await browser.newPage();
|
|
11
|
+
await page.setRequestInterception(true);
|
|
12
|
+
page.on('request', (request) => {
|
|
13
|
+
request.resourceType() === 'document' || request.resourceType() === 'script' ? request.continue() : request.abort();
|
|
14
|
+
});
|
|
15
|
+
await page.goto(currentUrl);
|
|
16
|
+
const response = await page.evaluate(() => document.documentElement.innerHTML);
|
|
17
|
+
await page.close();
|
|
18
|
+
|
|
19
|
+
const $ = cheerio.load(response);
|
|
20
|
+
|
|
21
|
+
const list = $('div[itemprop="headline"] a')
|
|
22
|
+
.toArray()
|
|
23
|
+
.slice(0, ctx.query.limit ? Number(ctx.query.limit) : 15)
|
|
24
|
+
.map((item) => {
|
|
25
|
+
item = $(item);
|
|
26
|
+
return {
|
|
27
|
+
title: item.text(),
|
|
28
|
+
link: item.attr('href'),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const items = await Promise.all(
|
|
33
|
+
list.map((item) =>
|
|
34
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
35
|
+
const page = await browser.newPage();
|
|
36
|
+
await page.setRequestInterception(true);
|
|
37
|
+
page.on('request', (request) => {
|
|
38
|
+
request.resourceType() === 'document' || request.resourceType() === 'script' ? request.continue() : request.abort();
|
|
39
|
+
});
|
|
40
|
+
await page.goto(item.link);
|
|
41
|
+
const detailResponse = await page.evaluate(() => document.documentElement.innerHTML);
|
|
42
|
+
await page.close();
|
|
43
|
+
const content = cheerio.load(detailResponse);
|
|
44
|
+
|
|
45
|
+
item.doi = content('meta[property="citation_doi"]').attr('content');
|
|
46
|
+
item.pubDate = parseDate(content('meta[property="citation_publication_date"]').attr('content'));
|
|
47
|
+
|
|
48
|
+
const authors = [];
|
|
49
|
+
|
|
50
|
+
content('meta[property="citation_author"]').each(function () {
|
|
51
|
+
authors.push(content(this).attr('content'));
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
item.author = authors.join(', ');
|
|
55
|
+
|
|
56
|
+
item.description = content('div[itemprop="description"]').html();
|
|
57
|
+
|
|
58
|
+
return item;
|
|
59
|
+
})
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
await browser.close();
|
|
64
|
+
|
|
65
|
+
ctx.state.data = {
|
|
66
|
+
title: `${$('meta[property="profile:username"]').attr('content')}'s Publications - ResearchGate`,
|
|
67
|
+
link: currentUrl,
|
|
68
|
+
item: items,
|
|
69
|
+
};
|
|
70
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
'researchgate.net': {
|
|
3
|
+
_name: 'ResearchGate',
|
|
4
|
+
'.': [
|
|
5
|
+
{
|
|
6
|
+
title: 'Publications',
|
|
7
|
+
docs: 'https://docs.rsshub.app/study.html#researchgate',
|
|
8
|
+
source: ['/profile/:username'],
|
|
9
|
+
target: '/researchgate/publications/:username',
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const config = require('@/config').value;
|
|
4
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
5
|
+
const timezone = require('@/utils/timezone');
|
|
6
|
+
const { art } = require('@/utils/render');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
|
|
9
|
+
module.exports = async (ctx) => {
|
|
10
|
+
const tid = ctx.params.tid;
|
|
11
|
+
const cookieString = config.saraba1st.cookie ? config.saraba1st.cookie : '';
|
|
12
|
+
const res = await got('https://bbs.saraba1st.com/2b/' + tid + '.html', {
|
|
13
|
+
headers: {
|
|
14
|
+
Cookie: cookieString,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
const $ = cheerio.load(res.data);
|
|
18
|
+
const title = $('head title').text().replace(/-.*/, '');
|
|
19
|
+
const list = $('#threadlisttableid tbody[id^="normalthread_"] tr');
|
|
20
|
+
const count = list
|
|
21
|
+
.slice(0, ctx.query.limit ? Number(ctx.query.limit) : 20)
|
|
22
|
+
.toArray()
|
|
23
|
+
.map((each) => {
|
|
24
|
+
each = $(each);
|
|
25
|
+
const floor = each.find('th.new a.s.xst').text();
|
|
26
|
+
const floorUrl = each.find('th.new a.s.xst').attr('href');
|
|
27
|
+
return {
|
|
28
|
+
title: `${title}:${floor}`,
|
|
29
|
+
link: new URL(floorUrl, 'https://bbs.saraba1st.com/2b/').href,
|
|
30
|
+
author: each.find('td.by cite').text(),
|
|
31
|
+
pubDate: timezone(parseDate(each.find('td.by em').first().text()), +8),
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const resultItems = await Promise.all(
|
|
36
|
+
count.map((i) =>
|
|
37
|
+
ctx.cache.tryGet(i.link, async () => {
|
|
38
|
+
i.description = await fetchContent(i.link);
|
|
39
|
+
return i;
|
|
40
|
+
})
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
ctx.state.data = {
|
|
45
|
+
title: `Stage1 论坛 - ${title}`,
|
|
46
|
+
link: `https://bbs.saraba1st.com/2b/${tid}.html`,
|
|
47
|
+
// item: await resultItems,
|
|
48
|
+
item: resultItems,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
async function fetchContent(url) {
|
|
53
|
+
// Fetch the subpageinof
|
|
54
|
+
const cookieString = config.saraba1st.cookie ? config.saraba1st.cookie : '';
|
|
55
|
+
const subres = await got(url, {
|
|
56
|
+
headers: {
|
|
57
|
+
Cookie: cookieString,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
const subind = cheerio.load(subres.data);
|
|
61
|
+
const stubS = subind('<div>');
|
|
62
|
+
subind('#postlist')
|
|
63
|
+
.find('div[id*="post_"] ')
|
|
64
|
+
.each(function () {
|
|
65
|
+
if (subind(this).find('td[id*="postmessage_"]').length > 0) {
|
|
66
|
+
const section = art(path.join(__dirname, 'templates/digest.art'), {
|
|
67
|
+
author: {
|
|
68
|
+
link: subind(this).find('.pls.favatar div.authi a').attr('href'),
|
|
69
|
+
name: subind(this).find('.pls.favatar div.authi').text(),
|
|
70
|
+
postinfo: subind(this).find('div.authi em[id*=authorposton]').text(),
|
|
71
|
+
},
|
|
72
|
+
msg: subind(this).find('td[id*="postmessage_"]').html(),
|
|
73
|
+
});
|
|
74
|
+
stubS.append(section);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return stubS.html();
|
|
79
|
+
}
|
|
@@ -3,12 +3,21 @@ module.exports = {
|
|
|
3
3
|
_name: 'Saraba1st',
|
|
4
4
|
bbs: [
|
|
5
5
|
{
|
|
6
|
-
title: '
|
|
6
|
+
title: '论坛',
|
|
7
7
|
docs: 'https://docs.rsshub.app/bbs.html#saraba1st',
|
|
8
8
|
source: '/2b/:id',
|
|
9
9
|
target: (params) => {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
let id = params.id;
|
|
11
|
+
// For Digest
|
|
12
|
+
if (id.match('forum') !== null) {
|
|
13
|
+
id = id.substring(0, id.length - 5);
|
|
14
|
+
return `/saraba1st/digest/${id}`;
|
|
15
|
+
}
|
|
16
|
+
// For Thread
|
|
17
|
+
else if (id.match('thread') !== null) {
|
|
18
|
+
id = params.id.includes('thread') ? params.id.split('-')[1] : '';
|
|
19
|
+
return id ? `/saraba1st/thread/${id}` : '';
|
|
20
|
+
}
|
|
12
21
|
},
|
|
13
22
|
},
|
|
14
23
|
],
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<div class="quoted" style="background:rgba(220,220,220,0.3);">
|
|
2
|
+
<a style="text-decoration: none;" href="https://bbs.saraba1st.com/2b/{{ author.link }}">{{ author.name }}</a>
|
|
3
|
+
<span style="text-decoration: none;color:#aaa;">{{ author.postinfo }}</span>
|
|
4
|
+
</div>
|
|
5
|
+
<div class="content" style="margin-bottom:20px!important;">{{@ msg }}</div>
|
package/lib/v2/sctv/programme.js
CHANGED
|
@@ -6,11 +6,13 @@ const path = require('path');
|
|
|
6
6
|
|
|
7
7
|
module.exports = async (ctx) => {
|
|
8
8
|
const id = ctx.params.id ?? '1';
|
|
9
|
+
const limit = ctx.params.limit ? parseInt(ctx.params.limit) : 15;
|
|
10
|
+
const isFull = /t|y/i.test(ctx.params.isFull ?? 'true');
|
|
9
11
|
|
|
10
12
|
const rootUrl = 'https://www.sctv.com';
|
|
11
13
|
const apiRootUrl = 'https://kscgc.sctv-tf.com';
|
|
12
|
-
const apiUrl = `${apiRootUrl}
|
|
13
|
-
const listUrl = `${apiRootUrl}
|
|
14
|
+
const apiUrl = `${apiRootUrl}/sctv/lookback/${id}/date.json`;
|
|
15
|
+
const listUrl = `${apiRootUrl}/sctv/lookback/index/lookbackList.json`;
|
|
14
16
|
const currentUrl = `${rootUrl}/column/detail?programmeIndex=/sctv/lookback/${id}/index.json`;
|
|
15
17
|
|
|
16
18
|
let response = await got({
|
|
@@ -18,23 +20,43 @@ module.exports = async (ctx) => {
|
|
|
18
20
|
url: apiUrl,
|
|
19
21
|
});
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
let items = [];
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const items = response.data.data.programmeList.map((item) => ({
|
|
29
|
-
title: item.programmeTitle,
|
|
30
|
-
link: item.programmeUrl,
|
|
31
|
-
pubDate: timezone(parseDate(item.pubTime), +8),
|
|
32
|
-
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
33
|
-
cover: item.programmeImage,
|
|
34
|
-
video: item.programmeUrl,
|
|
35
|
-
}),
|
|
25
|
+
const array = response.data.data.programmeArray.slice(0, limit).map((list) => ({
|
|
26
|
+
guid: list.id,
|
|
27
|
+
link: `${apiRootUrl}${list.programmeListUrl}`,
|
|
36
28
|
}));
|
|
37
29
|
|
|
30
|
+
await Promise.all(
|
|
31
|
+
array.map((list) =>
|
|
32
|
+
ctx.cache.tryGet(list.link, async () => {
|
|
33
|
+
const detailResponse = await got({
|
|
34
|
+
method: 'get',
|
|
35
|
+
url: list.link,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const currentItems = detailResponse.data.data.programmeList.map((item) => ({
|
|
39
|
+
guid: item.id,
|
|
40
|
+
title: item.programmeTitle,
|
|
41
|
+
link: item.programmeUrl,
|
|
42
|
+
pubDate: timezone(parseDate(item.pubTime), +8),
|
|
43
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
44
|
+
cover: item.programmeImage,
|
|
45
|
+
video: item.programmeUrl,
|
|
46
|
+
}),
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
let currentFullItems = [];
|
|
50
|
+
|
|
51
|
+
if (isFull) {
|
|
52
|
+
currentFullItems = currentItems.filter((item) => /(\d{4}\.\d{2}\.\d{2})/.test(item.title));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
items = [...items, ...(currentFullItems.length === 0 ? currentItems : currentFullItems)];
|
|
56
|
+
})
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
|
|
38
60
|
response = await got({
|
|
39
61
|
method: 'get',
|
|
40
62
|
url: listUrl,
|
|
@@ -52,7 +74,7 @@ module.exports = async (ctx) => {
|
|
|
52
74
|
ctx.state.data = {
|
|
53
75
|
title: `四川广播电视台 - ${name}`,
|
|
54
76
|
link: currentUrl,
|
|
55
|
-
item: items,
|
|
77
|
+
item: items.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 100),
|
|
56
78
|
image: cover,
|
|
57
79
|
};
|
|
58
80
|
};
|
package/lib/v2/sctv/router.js
CHANGED