rsshub 1.0.0-master.f099a33 → 1.0.0-master.f0c5610
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 +1 -0
- package/lib/middleware/parameter.js +27 -6
- package/lib/radar-rules.js +49 -66
- package/lib/router.js +23 -23
- package/lib/routes/agefans/update.js +1 -1
- package/lib/routes/universities/uestc/sice.js +12 -33
- package/lib/utils/wechat-mp.js +9 -2
- package/lib/v2/36kr/index.js +75 -0
- package/lib/v2/36kr/maintainer.js +7 -5
- package/lib/v2/36kr/radar.js +27 -15
- package/lib/v2/36kr/router.js +1 -5
- 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/airchina/index.js +36 -0
- package/lib/v2/airchina/maintainer.js +3 -0
- package/lib/v2/airchina/radar.js +13 -0
- package/lib/v2/airchina/router.js +3 -0
- package/lib/v2/allrecode/index.js +65 -0
- package/lib/v2/allrecode/maintainer.js +5 -0
- package/lib/v2/allrecode/news.js +35 -0
- package/lib/v2/allrecode/radar.js +25 -0
- package/lib/v2/allrecode/router.js +4 -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/biquge/index.js +78 -0
- package/lib/v2/biquge/maintainer.js +3 -0
- package/lib/v2/biquge/radar.js +29 -0
- package/lib/v2/biquge/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/ccfcv/index.js +68 -0
- package/lib/v2/ccfcv/maintainer.js +3 -0
- package/lib/v2/ccfcv/radar.js +25 -0
- package/lib/v2/ccfcv/router.js +3 -0
- package/lib/v2/ccfcv/templates/description.art +1 -0
- package/lib/v2/cde/index.js +2 -2
- package/lib/v2/cde/maintainer.js +2 -0
- package/lib/v2/cde/radar.js +34 -4
- package/lib/v2/cde/router.js +2 -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/cde/zdyz.js +77 -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/clash/maintainer.js +3 -0
- package/lib/v2/clash/premium.js +23 -0
- package/lib/v2/clash/radar.js +13 -0
- package/lib/v2/clash/router.js +3 -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/{routes/universities/scvtc/xygg.js → v2/darwinawards/index.js} +25 -14
- package/lib/v2/darwinawards/maintainer.js +4 -0
- package/lib/v2/darwinawards/radar.js +13 -0
- package/lib/v2/darwinawards/router.js +4 -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/douyin/hashtag.js +7 -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 +1 -43
- package/lib/v2/douyin/utils.js +50 -0
- package/lib/v2/economist/full.js +6 -4
- package/lib/v2/ezone/index.js +5 -3
- package/lib/v2/fda/cdrh.js +60 -0
- package/lib/v2/fda/maintainer.js +3 -0
- package/lib/v2/fda/radar.js +13 -0
- package/lib/v2/fda/router.js +3 -0
- package/lib/v2/gdut/maintainer.js +3 -0
- package/lib/{routes/universities → v2}/gdut/news.js +4 -0
- package/lib/v2/gdut/oa_news.js +214 -0
- package/lib/v2/gdut/radar.js +13 -0
- package/lib/v2/gdut/router.js +3 -0
- package/lib/v2/github/maintainer.js +1 -1
- package/lib/v2/github/templates/trending-description.art +5 -0
- package/lib/v2/github/trending.js +32 -16
- package/lib/v2/gov/customs/list.js +21 -17
- package/lib/v2/gov/customs/utils.js +9 -5
- package/lib/v2/gov/maintainer.js +7 -0
- package/lib/v2/gov/moj/aac/news.js +49 -0
- package/lib/v2/gov/nifdc/index.js +86 -0
- package/lib/v2/gov/nmpa/generic.js +83 -0
- package/lib/v2/gov/nsfc/index.js +83 -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 +94 -2
- package/lib/v2/gov/router.js +7 -0
- package/lib/v2/{pts/dailynews.js → gov/shaanxi/kjt.js} +16 -13
- package/lib/v2/gov/shanghai/yjj/index.js +60 -0
- package/lib/v2/gov/xuzhou/hrss.js +54 -0
- package/lib/v2/hakkatv/maintainer.js +3 -0
- package/lib/v2/hakkatv/radar.js +13 -0
- package/lib/v2/hakkatv/router.js +3 -0
- package/lib/v2/hakkatv/type.js +67 -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/hk01/channel.js +13 -30
- package/lib/v2/hk01/hot.js +13 -14
- package/lib/v2/hk01/issue.js +12 -31
- package/lib/v2/hk01/maintainer.js +5 -5
- package/lib/v2/hk01/radar.js +19 -19
- package/lib/v2/hk01/router.js +4 -4
- package/lib/v2/hk01/tag.js +14 -15
- package/lib/v2/hk01/templates/description.art +53 -0
- package/lib/v2/hk01/utils.js +43 -0
- package/lib/v2/hk01/zone.js +15 -34
- package/lib/v2/houxu/events.js +37 -0
- package/lib/v2/houxu/index.js +21 -69
- package/lib/v2/houxu/lives.js +35 -0
- package/lib/v2/houxu/maintainer.js +4 -2
- package/lib/v2/houxu/memory.js +37 -0
- package/lib/v2/houxu/radar.js +18 -6
- package/lib/v2/houxu/router.js +6 -1
- package/lib/v2/houxu/templates/events.art +5 -0
- package/lib/v2/houxu/templates/lives.art +5 -0
- package/lib/v2/houxu/templates/memory.art +3 -0
- package/lib/v2/ielts/index.js +7 -2
- 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/myfigurecollection/activity.js +58 -0
- package/lib/v2/myfigurecollection/index.js +78 -0
- package/lib/v2/myfigurecollection/maintainer.js +4 -0
- package/lib/v2/myfigurecollection/radar.js +44 -0
- package/lib/v2/myfigurecollection/router.js +4 -0
- package/lib/v2/myfigurecollection/templates/activity.art +8 -0
- package/lib/v2/myfigurecollection/templates/description.art +24 -0
- package/lib/v2/nbd/radar.js +2 -2
- package/lib/v2/ncepu/maintainer.js +3 -0
- package/lib/v2/ncepu/master/masterinfo.js +70 -0
- package/lib/v2/ncepu/radar.js +19 -0
- package/lib/v2/ncepu/router.js +3 -0
- 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/nju/zcc.js +6 -8
- 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/{routes/outagereport/service.js → v2/outagereport/index.js} +2 -2
- package/lib/v2/outagereport/maintainer.js +3 -0
- package/lib/v2/outagereport/radar.js +13 -0
- package/lib/v2/outagereport/router.js +3 -0
- package/lib/v2/peopo/maintainer.js +3 -0
- package/lib/v2/peopo/radar.js +13 -0
- package/lib/v2/peopo/router.js +3 -0
- package/lib/v2/peopo/topic.js +46 -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/pts/curations.js +44 -0
- package/lib/v2/pts/index.js +65 -0
- package/lib/v2/pts/maintainer.js +6 -0
- package/lib/v2/pts/projects.js +44 -0
- package/lib/v2/pts/radar.js +38 -2
- package/lib/v2/pts/router.js +4 -1
- package/lib/v2/pts/templates/description.art +6 -0
- 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/sakurazaka46/blog.js +54 -0
- package/lib/v2/sakurazaka46/maintainer.js +4 -0
- package/lib/v2/sakurazaka46/news.js +51 -0
- package/lib/v2/sakurazaka46/radar.js +19 -0
- package/lib/v2/sakurazaka46/router.js +4 -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/scitation/journal.js +37 -50
- package/lib/v2/scitation/section.js +38 -56
- package/lib/v2/scitation/templates/description.art +4 -7
- package/lib/v2/scitation/utils.js +29 -0
- package/lib/v2/scvtc/maintainer.js +3 -0
- package/lib/v2/scvtc/radar.js +13 -0
- package/lib/v2/scvtc/router.js +3 -0
- package/lib/v2/scvtc/xygg.js +40 -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/sinchew/index.js +68 -0
- package/lib/v2/sinchew/maintainer.js +5 -0
- package/lib/v2/sinchew/radar.js +25 -0
- package/lib/v2/sinchew/router.js +4 -0
- package/lib/v2/sinchew/templates/images.art +4 -0
- package/lib/v2/slowmist/radar.js +13 -0
- package/lib/v2/slowmist/router.js +3 -0
- package/lib/v2/slowmist/slowmist.js +39 -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/taiwannews/hot.js +52 -0
- package/lib/v2/taiwannews/maintainer.js +3 -0
- package/lib/v2/taiwannews/radar.js +13 -0
- package/lib/v2/taiwannews/router.js +3 -0
- package/lib/v2/test/index.js +2 -0
- package/lib/v2/tiktok/user.js +22 -55
- package/lib/v2/tju/cic/index.js +113 -0
- package/lib/v2/tju/maintainer.js +5 -0
- package/lib/v2/tju/oaa/index.js +112 -0
- package/lib/v2/tju/radar.js +65 -0
- package/lib/v2/tju/router.js +5 -0
- package/lib/v2/tju/yzb/index.js +121 -0
- 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/tribalfootball/latest.js +68 -0
- package/lib/v2/tribalfootball/maintainer.js +3 -0
- package/lib/v2/tribalfootball/radar.js +13 -0
- package/lib/v2/tribalfootball/router.js +3 -0
- package/lib/v2/tribalfootball/templates/plus_header.art +6 -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/lib/v2/zhihu/question.js +5 -3
- package/lib/v2/zhihu/router.js +1 -1
- package/lib/v2/zhihu/zhuanlan.js +2 -2
- package/package.json +24 -24
- package/lib/routes/acfun/video.js +0 -44
- package/lib/routes/darwinawards/articles.js +0 -42
- package/lib/routes/dgjyw/index.js +0 -66
- package/lib/routes/sakurazaka46/blog.js +0 -38
- package/lib/routes/universities/ncwu/notice.js +0 -42
- package/lib/routes/universities/tjpyu/ooa.js +0 -73
- 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/36kr/motif.js +0 -36
- package/lib/v2/36kr/news.js +0 -56
- package/lib/v2/36kr/newsflashes.js +0 -37
- package/lib/v2/36kr/search/article.js +0 -70
- package/lib/v2/36kr/user.js +0 -36
- package/lib/v2/houxu/templates/description.art +0 -9
- package/lib/v2/nsfc/maintainer.js +0 -3
- package/lib/v2/nsfc/news.js +0 -92
- package/lib/v2/nsfc/radar.js +0 -31
- package/lib/v2/nsfc/router.js +0 -3
package/lib/config.js
CHANGED
|
@@ -93,6 +93,7 @@ const calculateValue = () => {
|
|
|
93
93
|
},
|
|
94
94
|
feature: {
|
|
95
95
|
allow_user_hotlink_template: envs.ALLOW_USER_HOTLINK_TEMPLATE === 'true',
|
|
96
|
+
filter_regex_engine: envs.FILTER_REGEX_ENGINE || 're2',
|
|
96
97
|
},
|
|
97
98
|
suffix: envs.SUFFIX,
|
|
98
99
|
titleLengthLimit: parseInt(envs.TITLE_LENGTH_LIMIT) || 150,
|
|
@@ -152,10 +152,25 @@ module.exports = async (ctx, next) => {
|
|
|
152
152
|
// filter
|
|
153
153
|
const makeRegex = (string) => {
|
|
154
154
|
// default: case_senstivie = true
|
|
155
|
+
const engine = config.feature.filter_regex_engine;
|
|
155
156
|
if (ctx.query.filter_case_sensitive === 'false') {
|
|
156
|
-
|
|
157
|
+
switch (engine) {
|
|
158
|
+
case 'regexp':
|
|
159
|
+
return new RegExp(string, 'i');
|
|
160
|
+
case 're2':
|
|
161
|
+
return new RE2(string, 'i');
|
|
162
|
+
default:
|
|
163
|
+
throw Error(`Invalid Engine Value: ${engine}, please check your config.`);
|
|
164
|
+
}
|
|
157
165
|
} else {
|
|
158
|
-
|
|
166
|
+
switch (engine) {
|
|
167
|
+
case 'regexp':
|
|
168
|
+
return new RegExp(string);
|
|
169
|
+
case 're2':
|
|
170
|
+
return new RE2(string);
|
|
171
|
+
default:
|
|
172
|
+
throw Error(`Invalid Engine Value: ${engine}, please check your config.`);
|
|
173
|
+
}
|
|
159
174
|
}
|
|
160
175
|
};
|
|
161
176
|
|
|
@@ -164,26 +179,30 @@ module.exports = async (ctx, next) => {
|
|
|
164
179
|
const title = item.title || '';
|
|
165
180
|
const description = item.description || title;
|
|
166
181
|
const author = item.author || '';
|
|
167
|
-
const
|
|
182
|
+
const category = item.category || [];
|
|
183
|
+
const isFilter =
|
|
184
|
+
title.match(makeRegex(ctx.query.filter)) || description.match(makeRegex(ctx.query.filter)) || author.match(makeRegex(ctx.query.filter)) || category.some((c) => c.match(makeRegex(ctx.query.filter)));
|
|
168
185
|
return isFilter;
|
|
169
186
|
});
|
|
170
187
|
}
|
|
171
188
|
|
|
172
|
-
// 启用filter参数时,无效filter_title/description/author
|
|
173
|
-
if (!ctx.query.filter && (ctx.query.filter_title || ctx.query.filter_description || ctx.query.filter_author)) {
|
|
189
|
+
// 启用filter参数时,无效filter_title/description/author/category
|
|
190
|
+
if (!ctx.query.filter && (ctx.query.filter_title || ctx.query.filter_description || ctx.query.filter_author || ctx.query.filter_category)) {
|
|
174
191
|
ctx.state.data.item = ctx.state.data.item.filter((item) => {
|
|
175
192
|
const title = item.title || '';
|
|
176
193
|
const description = item.description || title;
|
|
177
194
|
const author = item.author || '';
|
|
195
|
+
const category = item.category || [];
|
|
178
196
|
let isFilter = true;
|
|
179
197
|
ctx.query.filter_title && (isFilter = title.match(makeRegex(ctx.query.filter_title)));
|
|
180
198
|
ctx.query.filter_description && (isFilter = isFilter && description.match(makeRegex(ctx.query.filter_description)));
|
|
181
199
|
ctx.query.filter_author && (isFilter = isFilter && author.match(makeRegex(ctx.query.filter_author)));
|
|
200
|
+
ctx.query.filter_category && (isFilter = isFilter && category.some((c) => c.match(makeRegex(ctx.query.filter_category))));
|
|
182
201
|
return isFilter;
|
|
183
202
|
});
|
|
184
203
|
}
|
|
185
204
|
|
|
186
|
-
if (ctx.query.filterout || ctx.query.filterout_title || ctx.query.filterout_description || ctx.query.filterout_author) {
|
|
205
|
+
if (ctx.query.filterout || ctx.query.filterout_title || ctx.query.filterout_description || ctx.query.filterout_author || ctx.query.filterout_category) {
|
|
187
206
|
if (ctx.query.filterout) {
|
|
188
207
|
ctx.query.filterout_title = ctx.query.filterout;
|
|
189
208
|
ctx.query.filterout_description = ctx.query.filterout;
|
|
@@ -192,10 +211,12 @@ module.exports = async (ctx, next) => {
|
|
|
192
211
|
const title = item.title;
|
|
193
212
|
const description = item.description || title;
|
|
194
213
|
const author = item.author || '';
|
|
214
|
+
const category = item.category || [];
|
|
195
215
|
let isFilter = true;
|
|
196
216
|
ctx.query.filterout_title && (isFilter = !title.match(makeRegex(ctx.query.filterout_title)));
|
|
197
217
|
ctx.query.filterout_description && (isFilter = isFilter && !description.match(makeRegex(ctx.query.filterout_description)));
|
|
198
218
|
ctx.query.filterout_author && (isFilter = isFilter && !author.match(makeRegex(ctx.query.filterout_author)));
|
|
219
|
+
ctx.query.filterout_category && (isFilter = isFilter && !category.some((c) => c.match(makeRegex(ctx.query.filterout_category))));
|
|
199
220
|
return isFilter;
|
|
200
221
|
});
|
|
201
222
|
}
|
package/lib/radar-rules.js
CHANGED
|
@@ -1089,35 +1089,35 @@ module.exports = {
|
|
|
1089
1089
|
},
|
|
1090
1090
|
],
|
|
1091
1091
|
},
|
|
1092
|
-
'nsfc.gov.cn': {
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
},
|
|
1092
|
+
// 'nsfc.gov.cn': {
|
|
1093
|
+
// _name: '国家自然科学基金委员会',
|
|
1094
|
+
// www: [
|
|
1095
|
+
// {
|
|
1096
|
+
// title: '基金要闻',
|
|
1097
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1098
|
+
// source: '/*',
|
|
1099
|
+
// target: '/nsfc/news/jjyw',
|
|
1100
|
+
// },
|
|
1101
|
+
// {
|
|
1102
|
+
// title: '通知公告',
|
|
1103
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1104
|
+
// source: '/*',
|
|
1105
|
+
// target: '/nsfc/news/tzgg',
|
|
1106
|
+
// },
|
|
1107
|
+
// {
|
|
1108
|
+
// title: '资助成果',
|
|
1109
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1110
|
+
// source: '/*',
|
|
1111
|
+
// target: '/nsfc/news/zzcg',
|
|
1112
|
+
// },
|
|
1113
|
+
// {
|
|
1114
|
+
// title: '科普快讯',
|
|
1115
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1116
|
+
// source: '/*',
|
|
1117
|
+
// target: '/nsfc/news/kpkx',
|
|
1118
|
+
// },
|
|
1119
|
+
// ],
|
|
1120
|
+
// },
|
|
1121
1121
|
'japanpost.jp': {
|
|
1122
1122
|
_name: '日本郵便',
|
|
1123
1123
|
'trackings.post': [
|
|
@@ -1164,26 +1164,26 @@ module.exports = {
|
|
|
1164
1164
|
},
|
|
1165
1165
|
],
|
|
1166
1166
|
},
|
|
1167
|
-
'biquge5200.com': {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
},
|
|
1177
|
-
'biquge.info': {
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
},
|
|
1167
|
+
// 'biquge5200.com': {
|
|
1168
|
+
// www: [
|
|
1169
|
+
// {
|
|
1170
|
+
// title: 'biquge5200.com',
|
|
1171
|
+
// docs: 'https://docs.rsshub.app/reading.html#bi-qu-ge-biquge5200-com',
|
|
1172
|
+
// source: '/:id',
|
|
1173
|
+
// target: '/novel/biquge/:id',
|
|
1174
|
+
// },
|
|
1175
|
+
// ],
|
|
1176
|
+
// },
|
|
1177
|
+
// 'biquge.info': {
|
|
1178
|
+
// www: [
|
|
1179
|
+
// {
|
|
1180
|
+
// title: 'biquge.info',
|
|
1181
|
+
// docs: 'https://docs.rsshub.app/reading.html#bi-qu-ge-biquge-info',
|
|
1182
|
+
// source: '/:id',
|
|
1183
|
+
// target: '/novel/biqugeinfo/:id',
|
|
1184
|
+
// },
|
|
1185
|
+
// ],
|
|
1186
|
+
// },
|
|
1187
1187
|
'matters.news': {
|
|
1188
1188
|
_name: 'Matters',
|
|
1189
1189
|
'.': [
|
|
@@ -1610,23 +1610,6 @@ module.exports = {
|
|
|
1610
1610
|
},
|
|
1611
1611
|
],
|
|
1612
1612
|
},
|
|
1613
|
-
'acfun.cn': {
|
|
1614
|
-
_name: 'AcFun',
|
|
1615
|
-
www: [
|
|
1616
|
-
{
|
|
1617
|
-
tilte: '番剧',
|
|
1618
|
-
docs: 'https://docs.rsshub.app/anime.html#acfun-fan-ju',
|
|
1619
|
-
source: '/bangumi/:id',
|
|
1620
|
-
target: (params) => `/acfun/bangumi/${params.id.replace('aa', '')}`,
|
|
1621
|
-
},
|
|
1622
|
-
{
|
|
1623
|
-
title: '用户投稿',
|
|
1624
|
-
docs: 'https://docs.rsshub.app/anime.html#acfun-yong-hu-tou-gao',
|
|
1625
|
-
source: '/u/:id',
|
|
1626
|
-
target: '/acfun/user/video/:id',
|
|
1627
|
-
},
|
|
1628
|
-
],
|
|
1629
|
-
},
|
|
1630
1613
|
'jjmhw.cc': {
|
|
1631
1614
|
_name: '漫小肆',
|
|
1632
1615
|
www: [
|
package/lib/router.js
CHANGED
|
@@ -228,8 +228,8 @@ router.get('/pornhub/:language?/users/:username', lazyloadRouteHandler('./routes
|
|
|
228
228
|
router.get('/pornhub/:language?/model/:username/:sort?', lazyloadRouteHandler('./routes/pornhub/model'));
|
|
229
229
|
router.get('/pornhub/:language?/pornstar/:username/:sort?', lazyloadRouteHandler('./routes/pornhub/pornstar'));
|
|
230
230
|
|
|
231
|
-
// Prestige
|
|
232
|
-
router.get('/prestige-av/series/:mid/:sort?', lazyloadRouteHandler('./routes/prestige-av/series'));
|
|
231
|
+
// Prestige migrated to v2
|
|
232
|
+
// router.get('/prestige-av/series/:mid/:sort?', lazyloadRouteHandler('./routes/prestige-av/series'));
|
|
233
233
|
|
|
234
234
|
// yande.re
|
|
235
235
|
router.get('/yande.re/post/popular_recent', lazyloadRouteHandler('./routes/yande.re/post_popular_recent'));
|
|
@@ -460,8 +460,8 @@ router.get('/mafengwo/ziyouxing/:code', lazyloadRouteHandler('./routes/mafengwo/
|
|
|
460
460
|
// router.get('/earthquake/ceic/:type', lazyloadRouteHandler('./routes/earthquake/ceic'));
|
|
461
461
|
|
|
462
462
|
// 小说
|
|
463
|
-
router.get('/novel/biquge/:id', lazyloadRouteHandler('./routes/novel/biquge'));
|
|
464
|
-
router.get('/novel/biqugeinfo/:id/:limit?', lazyloadRouteHandler('./routes/novel/biqugeinfo'));
|
|
463
|
+
// router.get('/novel/biquge/:id', lazyloadRouteHandler('./routes/novel/biquge'));
|
|
464
|
+
// router.get('/novel/biqugeinfo/:id/:limit?', lazyloadRouteHandler('./routes/novel/biqugeinfo'));
|
|
465
465
|
router.get('/novel/uukanshu/:uid', lazyloadRouteHandler('./routes/novel/uukanshu'));
|
|
466
466
|
router.get('/novel/wenxuemi/:id1/:id2', lazyloadRouteHandler('./routes/novel/wenxuemi'));
|
|
467
467
|
router.get('/novel/booksky/:id', lazyloadRouteHandler('./routes/novel/booksky'));
|
|
@@ -588,7 +588,7 @@ router.get('/scnu/library', lazyloadRouteHandler('./routes/universities/scnu/lib
|
|
|
588
588
|
router.get('/scnu/cs/match', lazyloadRouteHandler('./routes/universities/scnu/cs/match'));
|
|
589
589
|
|
|
590
590
|
// 广东工业大学
|
|
591
|
-
router.get('/gdut/news', lazyloadRouteHandler('./routes/universities/gdut/news'));
|
|
591
|
+
// router.get('/gdut/news', lazyloadRouteHandler('./routes/universities/gdut/news'));
|
|
592
592
|
|
|
593
593
|
// 中国科学院
|
|
594
594
|
router.get('/cas/sim/academic', lazyloadRouteHandler('./routes/universities/cas/sim/academic'));
|
|
@@ -731,8 +731,8 @@ router.get('/wzbc/:type?', lazyloadRouteHandler('./routes/universities/wzbc/news
|
|
|
731
731
|
// 河南大学
|
|
732
732
|
router.get('/henu/:type?', lazyloadRouteHandler('./routes/universities/henu/news'));
|
|
733
733
|
|
|
734
|
-
// 天津大学
|
|
735
|
-
router.get('/
|
|
734
|
+
// 天津大学 migrated to v2
|
|
735
|
+
// router.get('/tju/oaa/:type?', lazyloadRouteHandler('./routes/universities/tju/oaa'));
|
|
736
736
|
|
|
737
737
|
// 南开大学
|
|
738
738
|
router.get('/nku/jwc/:type?', lazyloadRouteHandler('./routes/universities/nku/jwc/index'));
|
|
@@ -759,7 +759,7 @@ router.get('/upc/main/:type?', lazyloadRouteHandler('./routes/universities/upc/m
|
|
|
759
759
|
router.get('/upc/jsj/:type?', lazyloadRouteHandler('./routes/universities/upc/jsj'));
|
|
760
760
|
|
|
761
761
|
// 华北水利水电大学
|
|
762
|
-
router.get('/ncwu/notice', lazyloadRouteHandler('./routes/universities/ncwu/notice'));
|
|
762
|
+
// router.get('/ncwu/notice', lazyloadRouteHandler('./routes/universities/ncwu/notice'));
|
|
763
763
|
|
|
764
764
|
// 太原师范学院
|
|
765
765
|
router.get('/tynu', lazyloadRouteHandler('./routes/universities/tynu/tynu'));
|
|
@@ -939,9 +939,9 @@ router.get('/nhentai/:key/:keyword/:mode?', lazyloadRouteHandler('./routes/nhent
|
|
|
939
939
|
// 龙腾网
|
|
940
940
|
router.get('/ltaaa/:category?', lazyloadRouteHandler('./routes/ltaaa/index'));
|
|
941
941
|
|
|
942
|
-
// AcFun
|
|
943
|
-
router.get('/acfun/bangumi/:id', lazyloadRouteHandler('./routes/acfun/bangumi'));
|
|
944
|
-
router.get('/acfun/user/video/:uid', lazyloadRouteHandler('./routes/acfun/video'));
|
|
942
|
+
// AcFun migrated to v2
|
|
943
|
+
// router.get('/acfun/bangumi/:id', lazyloadRouteHandler('./routes/acfun/bangumi'));
|
|
944
|
+
// router.get('/acfun/user/video/:uid', lazyloadRouteHandler('./routes/acfun/video'));
|
|
945
945
|
|
|
946
946
|
// Auto Trader
|
|
947
947
|
router.get('/autotrader/:query', lazyloadRouteHandler('./routes/autotrader'));
|
|
@@ -1726,7 +1726,7 @@ router.get('/metacritic/release/:platform/:type/:sort?', lazyloadRouteHandler('.
|
|
|
1726
1726
|
router.get('/kkj/news', lazyloadRouteHandler('./routes/kkj/news'));
|
|
1727
1727
|
|
|
1728
1728
|
// Outage.Report
|
|
1729
|
-
router.get('/outagereport/:name/:count?', lazyloadRouteHandler('./routes/outagereport/service'));
|
|
1729
|
+
// router.get('/outagereport/:name/:count?', lazyloadRouteHandler('./routes/outagereport/service'));
|
|
1730
1730
|
|
|
1731
1731
|
// sixthtone
|
|
1732
1732
|
router.get('/sixthtone/news', lazyloadRouteHandler('./routes/sixthtone/news'));
|
|
@@ -1894,7 +1894,7 @@ router.get('/keyakizaka46/news', lazyloadRouteHandler('./routes/keyakizaka46/new
|
|
|
1894
1894
|
router.get('/hinatazaka46/news', lazyloadRouteHandler('./routes/hinatazaka46/news'));
|
|
1895
1895
|
router.get('/keyakizaka46/blog', lazyloadRouteHandler('./routes/keyakizaka46/blog'));
|
|
1896
1896
|
router.get('/hinatazaka46/blog', lazyloadRouteHandler('./routes/hinatazaka46/blog'));
|
|
1897
|
-
router.get('/sakurazaka46/blog', lazyloadRouteHandler('./routes/sakurazaka46/blog'));
|
|
1897
|
+
// router.get('/sakurazaka46/blog', lazyloadRouteHandler('./routes/sakurazaka46/blog'));
|
|
1898
1898
|
|
|
1899
1899
|
// 酷安
|
|
1900
1900
|
router.get('/coolapk/tuwen/:type?', lazyloadRouteHandler('./routes/coolapk/tuwen'));
|
|
@@ -2265,8 +2265,8 @@ router.get('/transferwise/pair/:source/:target', lazyloadRouteHandler('./routes/
|
|
|
2265
2265
|
// chocolatey
|
|
2266
2266
|
router.get('/chocolatey/software/:name?', lazyloadRouteHandler('./routes/chocolatey/software'));
|
|
2267
2267
|
|
|
2268
|
-
// Nyaa
|
|
2269
|
-
router.get('/nyaa/search/:query?', lazyloadRouteHandler('./routes/nyaa/search'));
|
|
2268
|
+
// Nyaa migrated to v2
|
|
2269
|
+
// router.get('/nyaa/search/:query?', lazyloadRouteHandler('./routes/nyaa/search'));
|
|
2270
2270
|
|
|
2271
2271
|
// 片源网 migrated to v2
|
|
2272
2272
|
// router.get('/pianyuan/index/:media?', lazyloadRouteHandler('./routes/pianyuan/app'));
|
|
@@ -2492,11 +2492,11 @@ router.get('/wolley/user/:id', lazyloadRouteHandler('./routes/wolley/user'));
|
|
|
2492
2492
|
router.get('/wolley/host/:host', lazyloadRouteHandler('./routes/wolley/host'));
|
|
2493
2493
|
|
|
2494
2494
|
// 西安交大
|
|
2495
|
-
router.get('/xjtu/gs/tzgg', lazyloadRouteHandler('./routes/universities/xjtu/gs/tzgg'));
|
|
2496
|
-
router.get('/xjtu/dean/:subpath+', lazyloadRouteHandler('./routes/universities/xjtu/dean'));
|
|
2497
|
-
router.get('/xjtu/international/:subpath+', lazyloadRouteHandler('./routes/universities/xjtu/international'));
|
|
2498
|
-
router.get('/xjtu/job/:subpath?', lazyloadRouteHandler('./routes/universities/xjtu/job'));
|
|
2499
|
-
router.get('/xjtu/ee/:id?', lazyloadRouteHandler('./routes/universities/xjtu/ee'));
|
|
2495
|
+
// router.get('/xjtu/gs/tzgg', lazyloadRouteHandler('./routes/universities/xjtu/gs/tzgg'));
|
|
2496
|
+
// router.get('/xjtu/dean/:subpath+', lazyloadRouteHandler('./routes/universities/xjtu/dean'));
|
|
2497
|
+
// router.get('/xjtu/international/:subpath+', lazyloadRouteHandler('./routes/universities/xjtu/international'));
|
|
2498
|
+
// router.get('/xjtu/job/:subpath?', lazyloadRouteHandler('./routes/universities/xjtu/job'));
|
|
2499
|
+
// router.get('/xjtu/ee/:id?', lazyloadRouteHandler('./routes/universities/xjtu/ee'));
|
|
2500
2500
|
|
|
2501
2501
|
// booksource
|
|
2502
2502
|
router.get('/booksource', lazyloadRouteHandler('./routes/booksource/index'));
|
|
@@ -2863,7 +2863,7 @@ router.get('/law/jctd', lazyloadRouteHandler('./routes/law/jctd'));
|
|
|
2863
2863
|
router.get('/samsungmembers/latest', lazyloadRouteHandler('./routes/samsungmembers/latest'));
|
|
2864
2864
|
|
|
2865
2865
|
// 东莞教研网
|
|
2866
|
-
router.get('/dgjyw/:type', lazyloadRouteHandler('./routes/dgjyw/index'));
|
|
2866
|
+
// router.get('/dgjyw/:type', lazyloadRouteHandler('./routes/dgjyw/index'));
|
|
2867
2867
|
|
|
2868
2868
|
// 中国信息通信研究院
|
|
2869
2869
|
router.get('/gov/caict/bps', lazyloadRouteHandler('./routes/gov/caict/bps'));
|
|
@@ -3034,10 +3034,10 @@ router.get('/jlu/oa', lazyloadRouteHandler('./routes/universities/jlu/oa'));
|
|
|
3034
3034
|
router.get('/hfut/tzgg', lazyloadRouteHandler('./routes/universities/hfut/tzgg'));
|
|
3035
3035
|
|
|
3036
3036
|
// Darwin Awards
|
|
3037
|
-
router.get('/darwinawards/all', lazyloadRouteHandler('./routes/darwinawards/articles'));
|
|
3037
|
+
// router.get('/darwinawards/all', lazyloadRouteHandler('./routes/darwinawards/articles'));
|
|
3038
3038
|
|
|
3039
3039
|
// 四川职业技术学院
|
|
3040
|
-
router.get('/scvtc/xygg', lazyloadRouteHandler('./routes/universities/scvtc/xygg'));
|
|
3040
|
+
// router.get('/scvtc/xygg', lazyloadRouteHandler('./routes/universities/scvtc/xygg'));
|
|
3041
3041
|
|
|
3042
3042
|
// 华南理工大学土木与交通学院
|
|
3043
3043
|
router.get('/scut/scet/notice', lazyloadRouteHandler('./routes/universities/scut/scet/notice'));
|
|
@@ -2,7 +2,7 @@ const got = require('@/utils/got');
|
|
|
2
2
|
const cheerio = require('cheerio');
|
|
3
3
|
|
|
4
4
|
module.exports = async (ctx) => {
|
|
5
|
-
const rootUrl = 'https://www.
|
|
5
|
+
const rootUrl = 'https://www.agemys.com';
|
|
6
6
|
const currentUrl = `${rootUrl}/update`;
|
|
7
7
|
const response = await got({
|
|
8
8
|
method: 'get',
|
|
@@ -1,40 +1,18 @@
|
|
|
1
1
|
const cheerio = require('cheerio');
|
|
2
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
3
|
+
const dayjs = require('dayjs');
|
|
2
4
|
|
|
3
5
|
module.exports = async (ctx) => {
|
|
4
6
|
const baseIndexUrl = 'https://www.sice.uestc.edu.cn/index.htm';
|
|
5
7
|
const host = 'https://www.sice.uestc.edu.cn/';
|
|
6
|
-
const browser = await require('@/utils/puppeteer')();
|
|
8
|
+
const browser = await require('@/utils/puppeteer')({ stealth: true });
|
|
7
9
|
const page = await browser.newPage();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// 在每个新页面打开前执行以下脚本
|
|
12
|
-
const newProto = navigator.__proto__;
|
|
13
|
-
delete newProto.webdriver; // 删除navigator.webdriver字段
|
|
14
|
-
navigator.__proto__ = newProto;
|
|
15
|
-
window.chrome = {}; // 添加window.chrome字段,为增加真实性还需向内部填充一些值
|
|
16
|
-
window.chrome.app = { InstallState: 'hehe', RunningState: 'haha', getDetails: 'xixi', getIsInstalled: 'ohno' };
|
|
17
|
-
window.chrome.csi = function () {};
|
|
18
|
-
window.chrome.loadTimes = function () {};
|
|
19
|
-
window.chrome.runtime = function () {};
|
|
20
|
-
Object.defineProperty(navigator, 'userAgent', {
|
|
21
|
-
// userAgent在无头模式下有headless字样,所以需覆写
|
|
22
|
-
get: () => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36',
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(navigator, 'plugins', {
|
|
25
|
-
// 伪装真实的插件信息
|
|
26
|
-
get: () => [{ description: 'Portable Document Format', filename: 'internal-pdf-viewer', length: 1, name: 'Chrome PDF Plugin' }],
|
|
27
|
-
});
|
|
28
|
-
Object.defineProperty(navigator, 'languages', {
|
|
29
|
-
// 添加语言
|
|
30
|
-
get: () => ['zh-CN', 'zh', 'en'],
|
|
31
|
-
});
|
|
32
|
-
const originalQuery = window.navigator.permissions.query; // notification伪装
|
|
33
|
-
window.navigator.permissions.query = (parameters) => (parameters.name === 'notifications' ? Promise.resolve({ state: Notification.permission }) : originalQuery(parameters));
|
|
10
|
+
await page.setRequestInterception(true);
|
|
11
|
+
page.on('request', (request) => {
|
|
12
|
+
request.resourceType() === 'document' || request.resourceType() === 'script' ? request.continue() : request.abort();
|
|
34
13
|
});
|
|
35
|
-
|
|
36
14
|
await page.goto(baseIndexUrl, {
|
|
37
|
-
waitUntil: '
|
|
15
|
+
waitUntil: 'networkidle2',
|
|
38
16
|
});
|
|
39
17
|
const content = await page.content();
|
|
40
18
|
await browser.close();
|
|
@@ -43,14 +21,15 @@ module.exports = async (ctx) => {
|
|
|
43
21
|
const out = $('.notice p')
|
|
44
22
|
.map((index, item) => {
|
|
45
23
|
item = $(item);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
24
|
+
const now = dayjs();
|
|
25
|
+
let date = dayjs(now.year() + '-' + item.find('a.date').text());
|
|
26
|
+
if (now < date) {
|
|
27
|
+
date = dayjs(now.year() - 1 + '-' + item.find('a.date').text());
|
|
49
28
|
}
|
|
50
29
|
return {
|
|
51
30
|
title: item.find('a[href]').text(),
|
|
52
31
|
link: host + item.find('a[href]').attr('href'),
|
|
53
|
-
pubDate: date,
|
|
32
|
+
pubDate: parseDate(date),
|
|
54
33
|
};
|
|
55
34
|
})
|
|
56
35
|
.get();
|
package/lib/utils/wechat-mp.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* There are at least three folders which are relevant with WeChat MP (Official Account Platform / Media Platform):
|
|
5
5
|
* lib/v2/wechat
|
|
6
|
+
* lib/v2/gov/npma
|
|
6
7
|
* lib/v2/gzh360
|
|
7
8
|
* lib/v2/pku/nsd/gd
|
|
8
9
|
* lib/v2/sdu/cs
|
|
@@ -104,6 +105,14 @@ const fixArticleContent = (html, skipImg = false) => {
|
|
|
104
105
|
}
|
|
105
106
|
});
|
|
106
107
|
|
|
108
|
+
// add breaks in code section
|
|
109
|
+
$('code').each((_, code) => {
|
|
110
|
+
$('<br>').insertAfter(code);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// clear line index tags in code section
|
|
114
|
+
$('.code-snippet__line-index').remove();
|
|
115
|
+
|
|
107
116
|
// fix single picture article
|
|
108
117
|
// example: https://mp.weixin.qq.com/s/4p5YmYuASiQSYFiy7KqydQ
|
|
109
118
|
$('script').each((_, script) => {
|
|
@@ -186,7 +195,6 @@ const fetchArticle = async (ctx, url, bypassHostCheck = false) => {
|
|
|
186
195
|
let summary = $('meta[name=description]').attr('content');
|
|
187
196
|
summary = summary !== title ? summary : '';
|
|
188
197
|
let description = fixArticleContent($('#js_content'));
|
|
189
|
-
|
|
190
198
|
// No article get or article is too short, try the original url
|
|
191
199
|
const originalUrl = detectOriginalArticleUrl($);
|
|
192
200
|
if (originalUrl) {
|
|
@@ -211,7 +219,6 @@ const fetchArticle = async (ctx, url, bypassHostCheck = false) => {
|
|
|
211
219
|
|
|
212
220
|
let mpName = $('.profile_nickname').first().text();
|
|
213
221
|
mpName = mpName && mpName.trim();
|
|
214
|
-
|
|
215
222
|
return { title, author, description, summary, pubDate, mpName, link: url };
|
|
216
223
|
});
|
|
217
224
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const got = require('@/utils/got');
|
|
2
|
+
const cheerio = require('cheerio');
|
|
3
|
+
const { parseDate } = require('@/utils/parse-date');
|
|
4
|
+
const CryptoJS = require('crypto-js');
|
|
5
|
+
|
|
6
|
+
const shortcuts = {
|
|
7
|
+
'/information': '/information/web_news',
|
|
8
|
+
'/information/latest': '/information/web_news',
|
|
9
|
+
'/information/recommend': '/information/web_recommend',
|
|
10
|
+
'/information/life': '/information/happy_life',
|
|
11
|
+
'/information/estate': '/information/real_estate',
|
|
12
|
+
'/information/workplace': '/information/web_zhichang',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
module.exports = async (ctx) => {
|
|
16
|
+
const path = ctx.path.replace(/^\/news(?!flashes)/, '/information').replace(/\/search\/article/, '/search/articles');
|
|
17
|
+
|
|
18
|
+
const rootUrl = 'https://www.36kr.com';
|
|
19
|
+
const currentUrl = `${rootUrl}${shortcuts.hasOwnProperty(path) ? shortcuts[path] : path}`;
|
|
20
|
+
|
|
21
|
+
const response = await got({
|
|
22
|
+
method: 'get',
|
|
23
|
+
url: currentUrl,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const $ = cheerio.load(response.data);
|
|
27
|
+
|
|
28
|
+
const data = JSON.parse(response.data.match(/"itemList":(\[.*?\])/)[1]);
|
|
29
|
+
|
|
30
|
+
let items = data.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 30).map((item) => {
|
|
31
|
+
item = item.templateMaterial ?? item;
|
|
32
|
+
return {
|
|
33
|
+
title: item.widgetTitle.replace(/<\/?em>/g, ''),
|
|
34
|
+
author: item.author,
|
|
35
|
+
pubDate: parseDate(item.publishTime),
|
|
36
|
+
link: `${rootUrl}/${path === '/newsflashes' ? 'newsflashes' : 'p'}/${item.itemId}`,
|
|
37
|
+
description: item.widgetContent ?? item.content,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (!/^\/(search|newsflashes)/.test(path)) {
|
|
42
|
+
items = await Promise.all(
|
|
43
|
+
items.map((item) =>
|
|
44
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
45
|
+
const detailResponse = await got({
|
|
46
|
+
method: 'get',
|
|
47
|
+
url: item.link,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const key = CryptoJS.enc.Utf8.parse('efabccee-b754-4c');
|
|
51
|
+
const cipherText = detailResponse.data.match(/{"state":"(.*)","isEncrypt":true}/)[1];
|
|
52
|
+
|
|
53
|
+
const content = JSON.parse(
|
|
54
|
+
CryptoJS.AES.decrypt(cipherText, key, {
|
|
55
|
+
mode: CryptoJS.mode.ECB,
|
|
56
|
+
padding: CryptoJS.pad.Pkcs7,
|
|
57
|
+
})
|
|
58
|
+
.toString(CryptoJS.enc.Utf8)
|
|
59
|
+
.toString()
|
|
60
|
+
).articleDetail.articleDetailData.data;
|
|
61
|
+
|
|
62
|
+
item.description = content.widgetContent;
|
|
63
|
+
|
|
64
|
+
return item;
|
|
65
|
+
})
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ctx.state.data = {
|
|
71
|
+
title: `36氪 - ${$('title').text().split('_')[0]}`,
|
|
72
|
+
link: currentUrl,
|
|
73
|
+
item: items,
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
'/
|
|
3
|
-
'/
|
|
4
|
-
'/newsflashes': ['hillerliao'],
|
|
5
|
-
'/search/
|
|
6
|
-
'/
|
|
2
|
+
'/information/:category?': ['nczitzk'],
|
|
3
|
+
'/motif/:id': ['nczitzk'],
|
|
4
|
+
'/newsflashes': ['hillerliao', 'nczitzk'],
|
|
5
|
+
'/search/articles/:keyword': ['xyqfer', 'kt286', 'nczitzk'],
|
|
6
|
+
'/search/newsflashes/:keyword': ['nczitzk'],
|
|
7
|
+
'/topics/:id': ['nczitzk'],
|
|
8
|
+
'/user/:id': ['nczitzk'],
|
|
7
9
|
};
|
package/lib/v2/36kr/radar.js
CHANGED
|
@@ -1,36 +1,48 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
'36kr.com': {
|
|
3
|
-
_name: '
|
|
3
|
+
_name: '36氪',
|
|
4
4
|
'.': [
|
|
5
5
|
{
|
|
6
6
|
title: '资讯',
|
|
7
|
-
docs: 'https://docs.rsshub.app/new-media.html#_36kr',
|
|
8
|
-
source: '/',
|
|
9
|
-
target: '/36kr/
|
|
7
|
+
docs: 'https://docs.rsshub.app/new-media.html#_36kr-zi-xun',
|
|
8
|
+
source: ['/information/:category', '/'],
|
|
9
|
+
target: '/36kr/information/:category',
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
title: '快讯',
|
|
13
|
-
docs: 'https://docs.rsshub.app/new-media.html#_36kr',
|
|
14
|
-
source: '/',
|
|
13
|
+
docs: 'https://docs.rsshub.app/new-media.html#_36kr-kuai-xun',
|
|
14
|
+
source: ['/newsflashes', '/'],
|
|
15
15
|
target: '/36kr/newsflashes',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
title: '用户文章',
|
|
19
|
-
docs: 'https://docs.rsshub.app/new-media.html#_36kr',
|
|
20
|
-
source: '/user/:
|
|
21
|
-
target: '/36kr/user/:
|
|
19
|
+
docs: 'https://docs.rsshub.app/new-media.html#_36kr-yong-hu-wen-zhang',
|
|
20
|
+
source: ['/user/:id', '/'],
|
|
21
|
+
target: '/36kr/user/:id',
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
title: '主题文章',
|
|
25
|
-
docs: 'https://docs.rsshub.app/new-media.html#_36kr',
|
|
26
|
-
source: '/motif/:
|
|
27
|
-
target: '/36kr/motif/:
|
|
25
|
+
docs: 'https://docs.rsshub.app/new-media.html#_36kr-zhu-ti-wen-zhang',
|
|
26
|
+
source: ['/motif/:id', '/'],
|
|
27
|
+
target: '/36kr/motif/:id',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: '专题文章',
|
|
31
|
+
docs: 'https://docs.rsshub.app/new-media.html#_36kr-zhuan-ti-wen-zhang',
|
|
32
|
+
source: ['/topics/:id', '/'],
|
|
33
|
+
target: '/36kr/topics/:id',
|
|
28
34
|
},
|
|
29
35
|
{
|
|
30
36
|
title: '搜索文章',
|
|
31
|
-
docs: 'https://docs.rsshub.app/new-media.html#_36kr',
|
|
32
|
-
source: '/search/articles/:keyword',
|
|
33
|
-
target: '/36kr/search/
|
|
37
|
+
docs: 'https://docs.rsshub.app/new-media.html#_36kr-sou-suo-wen-zhang',
|
|
38
|
+
source: ['/search/articles/:keyword', '/'],
|
|
39
|
+
target: '/36kr/search/articles/:keyword',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: '搜索快讯',
|
|
43
|
+
docs: 'https://docs.rsshub.app/new-media.html#_36kr-sou-suo-kuai-xun',
|
|
44
|
+
source: ['/search/newsflashes/:keyword', '/'],
|
|
45
|
+
target: '/36kr/search/newsflashes/:keyword',
|
|
34
46
|
},
|
|
35
47
|
],
|
|
36
48
|
},
|
package/lib/v2/36kr/router.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
module.exports = (router) => {
|
|
2
|
-
router.get(
|
|
3
|
-
router.get('/news/:category?', require('./news'));
|
|
4
|
-
router.get('/newsflashes', require('./newsflashes'));
|
|
5
|
-
router.get('/search/article/:keyword', require('./search/article'));
|
|
6
|
-
router.get('/user/:uid', require('./user'));
|
|
2
|
+
router.get(/([\w-/]+)?/, require('./index'));
|
|
7
3
|
};
|