rsshub 1.0.0-master.e6f0cc8 → 1.0.0-master.e6f9689
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/middleware/parameter.js +10 -4
- package/lib/radar-rules.js +49 -83
- package/lib/router.js +23 -23
- 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/78dm/index.js +74 -0
- package/lib/v2/78dm/maintainer.js +5 -0
- package/lib/v2/78dm/radar.js +37 -0
- package/lib/v2/78dm/router.js +3 -0
- package/lib/v2/78dm/templates/image.art +1 -0
- 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/acs/journal.js +73 -0
- package/lib/v2/acs/maintainer.js +3 -0
- package/lib/v2/acs/radar.js +13 -0
- package/lib/v2/acs/router.js +3 -0
- package/lib/v2/acs/templates/description.art +2 -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/android/maintainer.js +3 -0
- package/lib/v2/android/platform-tools-releases.js +47 -0
- package/lib/v2/android/radar.js +13 -0
- package/lib/v2/android/router.js +3 -0
- package/lib/v2/asus/gpu-tweak.js +31 -0
- package/lib/v2/asus/maintainer.js +1 -0
- package/lib/v2/asus/radar.js +12 -1
- package/lib/v2/asus/router.js +1 -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/brave/latest.js +38 -0
- package/lib/v2/brave/maintainer.js +3 -0
- package/lib/v2/brave/radar.js +13 -0
- package/lib/v2/brave/router.js +3 -0
- 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/cmde/index.js +44 -0
- package/lib/v2/cmde/maintainer.js +3 -0
- package/lib/v2/cmde/radar.js +13 -0
- package/lib/v2/cmde/router.js +3 -0
- package/lib/v2/cpuid/news.js +30 -0
- package/lib/v2/cpuid/radar.js +13 -0
- package/lib/v2/cpuid/router.js +3 -0
- package/lib/v2/csu/cse.js +9 -1
- package/lib/v2/csu/mail.js +43 -0
- package/lib/v2/csu/radar.js +8 -0
- package/lib/v2/csu/router.js +1 -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/diskanalyzer/maintainer.js +3 -0
- package/lib/v2/diskanalyzer/radar.js +13 -0
- package/lib/v2/diskanalyzer/router.js +3 -0
- package/lib/v2/diskanalyzer/whats-new.js +49 -0
- package/lib/v2/douyin/hashtag.js +2 -0
- package/lib/v2/douyin/maintainer.js +2 -0
- package/lib/{routes → v2}/dsndsht23/index.js +40 -46
- package/lib/v2/dsndsht23/maintainer.js +7 -0
- package/lib/v2/dsndsht23/radar.js +19 -0
- package/lib/v2/dsndsht23/router.js +7 -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/fosshub/index.js +49 -0
- package/lib/v2/fosshub/maintainer.js +3 -0
- package/lib/v2/fosshub/radar.js +13 -0
- package/lib/v2/fosshub/router.js +3 -0
- package/lib/v2/fosshub/templates/description.art +20 -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/maintainer.js +6 -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/radar.js +83 -2
- package/lib/v2/gov/router.js +6 -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/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/hupu/index.js +16 -8
- package/lib/v2/ifi-audio/download.js +34 -0
- package/lib/v2/ifi-audio/maintainer.js +3 -0
- package/lib/v2/ifi-audio/router.js +3 -0
- package/lib/v2/imagemagick/changelog.js +46 -0
- package/lib/v2/imagemagick/maintainer.js +3 -0
- package/lib/v2/imagemagick/radar.js +13 -0
- package/lib/v2/imagemagick/router.js +3 -0
- package/lib/v2/leetcode/dailyquestion-en.js +116 -0
- package/lib/v2/leetcode/maintainer.js +3 -0
- package/lib/v2/leetcode/router.js +3 -0
- package/lib/v2/leetcode/templates/question-description.art +6 -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/ncepu/maintainer.js +3 -0
- package/lib/v2/ncepu/master/masterinfo.js +78 -0
- package/lib/v2/ncepu/radar.js +25 -0
- package/lib/v2/ncepu/router.js +3 -0
- package/lib/v2/neatdownloadmanager/download.js +50 -0
- package/lib/v2/neatdownloadmanager/maintainer.js +3 -0
- package/lib/v2/neatdownloadmanager/radar.js +13 -0
- package/lib/v2/neatdownloadmanager/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/{routes → v2}/nga/forum.js +8 -9
- package/lib/v2/nga/maintainer.js +4 -0
- package/lib/{routes → v2}/nga/post.js +16 -15
- package/lib/v2/nga/radar.js +56 -0
- package/lib/v2/nga/router.js +4 -0
- package/lib/v2/nju/admission.js +41 -0
- package/lib/v2/nju/hqjt.js +39 -0
- package/lib/v2/nju/jjc.js +42 -0
- package/lib/v2/nju/maintainer.js +5 -2
- package/lib/v2/nju/radar.js +34 -10
- package/lib/v2/nju/router.js +5 -2
- package/lib/v2/nju/zcc.js +6 -8
- package/lib/v2/nyaa/main.js +57 -0
- package/lib/v2/nyaa/maintainer.js +6 -0
- package/lib/v2/nyaa/radar.js +49 -0
- package/lib/v2/nyaa/router.js +7 -0
- package/lib/v2/nytimes/daily_briefing_chinese.js +3 -22
- package/lib/v2/nytimes/templates/image.art +0 -1
- package/lib/v2/oo-software/changelog.js +40 -0
- package/lib/v2/oo-software/maintainer.js +3 -0
- package/lib/v2/oo-software/radar.js +13 -0
- package/lib/v2/oo-software/router.js +3 -0
- 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/penguin-random-house/articles.js +27 -0
- package/lib/v2/penguin-random-house/maintainer.js +4 -0
- package/lib/v2/penguin-random-house/radar.js +19 -0
- package/lib/v2/penguin-random-house/router.js +4 -0
- package/lib/v2/penguin-random-house/templates/articleHeader.art +5 -0
- package/lib/v2/penguin-random-house/templates/book.art +4 -0
- package/lib/v2/penguin-random-house/thereaddown.js +27 -0
- package/lib/v2/penguin-random-house/utils.js +119 -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/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/postman/maintainer.js +3 -0
- package/lib/v2/postman/radar.js +13 -0
- package/lib/v2/postman/release-notes.js +27 -0
- package/lib/v2/postman/router.js +3 -0
- 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/putty/changes.js +36 -0
- package/lib/v2/putty/maintainer.js +3 -0
- package/lib/v2/putty/radar.js +13 -0
- package/lib/v2/putty/router.js +3 -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/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/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 +6 -0
- package/lib/v2/tju/news/index.js +135 -0
- package/lib/v2/tju/oaa/index.js +112 -0
- package/lib/v2/tju/radar.js +97 -0
- package/lib/v2/tju/router.js +6 -0
- package/lib/v2/tju/yzb/index.js +121 -0
- package/lib/v2/tradingview/blog.js +60 -0
- package/lib/v2/tradingview/maintainer.js +3 -0
- package/lib/v2/tradingview/radar.js +13 -0
- package/lib/v2/tradingview/router.js +3 -0
- package/lib/v2/tradingview/templates/description.art +4 -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/twreporter/fetch_article.js +1 -1
- package/lib/v2/u3c3/maintainer.js +1 -1
- package/lib/v2/vlive/maintainer.js +3 -0
- package/lib/v2/vmware/flings.js +59 -0
- package/lib/v2/vmware/maintainer.js +3 -0
- package/lib/v2/vmware/radar.js +13 -0
- package/lib/v2/vmware/router.js +3 -0
- package/lib/v2/wdc/download.js +37 -0
- package/lib/v2/wdc/maintainer.js +3 -0
- package/lib/v2/wdc/radar.js +13 -0
- package/lib/v2/wdc/router.js +3 -0
- package/lib/v2/xjtu/2yuan/news.js +61 -0
- package/lib/v2/xjtu/maintainer.js +1 -0
- package/lib/v2/xjtu/radar.js +8 -0
- package/lib/v2/xjtu/router.js +1 -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/youzhiyouxing/materials.js +5 -5
- 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/nyaa/search.js +0 -31
- package/lib/routes/sakurazaka46/blog.js +0 -38
- package/lib/routes/universities/tjpyu/ooa.js +0 -73
- 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/csu/fetch_article.js +0 -12
- 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
|
@@ -179,26 +179,30 @@ module.exports = async (ctx, next) => {
|
|
|
179
179
|
const title = item.title || '';
|
|
180
180
|
const description = item.description || title;
|
|
181
181
|
const author = item.author || '';
|
|
182
|
-
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)));
|
|
183
185
|
return isFilter;
|
|
184
186
|
});
|
|
185
187
|
}
|
|
186
188
|
|
|
187
|
-
// 启用filter参数时,无效filter_title/description/author
|
|
188
|
-
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)) {
|
|
189
191
|
ctx.state.data.item = ctx.state.data.item.filter((item) => {
|
|
190
192
|
const title = item.title || '';
|
|
191
193
|
const description = item.description || title;
|
|
192
194
|
const author = item.author || '';
|
|
195
|
+
const category = item.category || [];
|
|
193
196
|
let isFilter = true;
|
|
194
197
|
ctx.query.filter_title && (isFilter = title.match(makeRegex(ctx.query.filter_title)));
|
|
195
198
|
ctx.query.filter_description && (isFilter = isFilter && description.match(makeRegex(ctx.query.filter_description)));
|
|
196
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))));
|
|
197
201
|
return isFilter;
|
|
198
202
|
});
|
|
199
203
|
}
|
|
200
204
|
|
|
201
|
-
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) {
|
|
202
206
|
if (ctx.query.filterout) {
|
|
203
207
|
ctx.query.filterout_title = ctx.query.filterout;
|
|
204
208
|
ctx.query.filterout_description = ctx.query.filterout;
|
|
@@ -207,10 +211,12 @@ module.exports = async (ctx, next) => {
|
|
|
207
211
|
const title = item.title;
|
|
208
212
|
const description = item.description || title;
|
|
209
213
|
const author = item.author || '';
|
|
214
|
+
const category = item.category || [];
|
|
210
215
|
let isFilter = true;
|
|
211
216
|
ctx.query.filterout_title && (isFilter = !title.match(makeRegex(ctx.query.filterout_title)));
|
|
212
217
|
ctx.query.filterout_description && (isFilter = isFilter && !description.match(makeRegex(ctx.query.filterout_description)));
|
|
213
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))));
|
|
214
220
|
return isFilter;
|
|
215
221
|
});
|
|
216
222
|
}
|
package/lib/radar-rules.js
CHANGED
|
@@ -369,23 +369,6 @@ module.exports = {
|
|
|
369
369
|
},
|
|
370
370
|
],
|
|
371
371
|
},
|
|
372
|
-
'nga.cn': {
|
|
373
|
-
_name: 'NGA',
|
|
374
|
-
bbs: [
|
|
375
|
-
{
|
|
376
|
-
title: '分区帖子',
|
|
377
|
-
docs: 'https://docs.rsshub.app/bbs.html#nga',
|
|
378
|
-
source: '/thread.php',
|
|
379
|
-
target: (params, url) => new URL(url).searchParams.get('fid') && `/nga/forum/${new URL(url).searchParams.get('fid')}`,
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
title: '帖子',
|
|
383
|
-
docs: 'https://docs.rsshub.app/bbs.html#nga',
|
|
384
|
-
source: '/read.php',
|
|
385
|
-
target: (params, url) => new URL(url).searchParams.get('tid') && `/nga/post/${new URL(url).searchParams.get('tid')}`,
|
|
386
|
-
},
|
|
387
|
-
],
|
|
388
|
-
},
|
|
389
372
|
'playstation.com': {
|
|
390
373
|
_name: 'PlayStation',
|
|
391
374
|
store: [
|
|
@@ -1089,35 +1072,35 @@ module.exports = {
|
|
|
1089
1072
|
},
|
|
1090
1073
|
],
|
|
1091
1074
|
},
|
|
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
|
-
},
|
|
1075
|
+
// 'nsfc.gov.cn': {
|
|
1076
|
+
// _name: '国家自然科学基金委员会',
|
|
1077
|
+
// www: [
|
|
1078
|
+
// {
|
|
1079
|
+
// title: '基金要闻',
|
|
1080
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1081
|
+
// source: '/*',
|
|
1082
|
+
// target: '/nsfc/news/jjyw',
|
|
1083
|
+
// },
|
|
1084
|
+
// {
|
|
1085
|
+
// title: '通知公告',
|
|
1086
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1087
|
+
// source: '/*',
|
|
1088
|
+
// target: '/nsfc/news/tzgg',
|
|
1089
|
+
// },
|
|
1090
|
+
// {
|
|
1091
|
+
// title: '资助成果',
|
|
1092
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1093
|
+
// source: '/*',
|
|
1094
|
+
// target: '/nsfc/news/zzcg',
|
|
1095
|
+
// },
|
|
1096
|
+
// {
|
|
1097
|
+
// title: '科普快讯',
|
|
1098
|
+
// docs: 'https://docs.rsshub.app/other.html#guo-jia-zi-ran-ke-xue-ji-jin-wei-yuan-hui',
|
|
1099
|
+
// source: '/*',
|
|
1100
|
+
// target: '/nsfc/news/kpkx',
|
|
1101
|
+
// },
|
|
1102
|
+
// ],
|
|
1103
|
+
// },
|
|
1121
1104
|
'japanpost.jp': {
|
|
1122
1105
|
_name: '日本郵便',
|
|
1123
1106
|
'trackings.post': [
|
|
@@ -1164,26 +1147,26 @@ module.exports = {
|
|
|
1164
1147
|
},
|
|
1165
1148
|
],
|
|
1166
1149
|
},
|
|
1167
|
-
'biquge5200.com': {
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
},
|
|
1177
|
-
'biquge.info': {
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
},
|
|
1150
|
+
// 'biquge5200.com': {
|
|
1151
|
+
// www: [
|
|
1152
|
+
// {
|
|
1153
|
+
// title: 'biquge5200.com',
|
|
1154
|
+
// docs: 'https://docs.rsshub.app/reading.html#bi-qu-ge-biquge5200-com',
|
|
1155
|
+
// source: '/:id',
|
|
1156
|
+
// target: '/novel/biquge/:id',
|
|
1157
|
+
// },
|
|
1158
|
+
// ],
|
|
1159
|
+
// },
|
|
1160
|
+
// 'biquge.info': {
|
|
1161
|
+
// www: [
|
|
1162
|
+
// {
|
|
1163
|
+
// title: 'biquge.info',
|
|
1164
|
+
// docs: 'https://docs.rsshub.app/reading.html#bi-qu-ge-biquge-info',
|
|
1165
|
+
// source: '/:id',
|
|
1166
|
+
// target: '/novel/biqugeinfo/:id',
|
|
1167
|
+
// },
|
|
1168
|
+
// ],
|
|
1169
|
+
// },
|
|
1187
1170
|
'matters.news': {
|
|
1188
1171
|
_name: 'Matters',
|
|
1189
1172
|
'.': [
|
|
@@ -1610,23 +1593,6 @@ module.exports = {
|
|
|
1610
1593
|
},
|
|
1611
1594
|
],
|
|
1612
1595
|
},
|
|
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
1596
|
'jjmhw.cc': {
|
|
1631
1597
|
_name: '漫小肆',
|
|
1632
1598
|
www: [
|
package/lib/router.js
CHANGED
|
@@ -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'));
|
|
@@ -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'));
|
|
@@ -1060,9 +1060,9 @@ router.get('/coolbuy/newest', lazyloadRouteHandler('./routes/coolbuy/newest'));
|
|
|
1060
1060
|
router.get('/miniflux/subscription/:parameters?', lazyloadRouteHandler('./routes/miniflux/get_feeds'));
|
|
1061
1061
|
router.get('/miniflux/:feeds/:parameters?', lazyloadRouteHandler('./routes/miniflux/get_entries'));
|
|
1062
1062
|
|
|
1063
|
-
// NGA
|
|
1064
|
-
router.get('/nga/forum/:fid/:recommend?', lazyloadRouteHandler('./routes/nga/forum'));
|
|
1065
|
-
router.get('/nga/post/:tid', lazyloadRouteHandler('./routes/nga/post'));
|
|
1063
|
+
// NGA migrated to v2
|
|
1064
|
+
// router.get('/nga/forum/:fid/:recommend?', lazyloadRouteHandler('./routes/nga/forum'));
|
|
1065
|
+
// router.get('/nga/post/:tid', lazyloadRouteHandler('./routes/nga/post'));
|
|
1066
1066
|
|
|
1067
1067
|
// Nautilus
|
|
1068
1068
|
router.get('/nautilus/topic/:tid', lazyloadRouteHandler('./routes/nautilus/topics'));
|
|
@@ -1639,11 +1639,11 @@ router.get('/enclavebooks/user/:uid', lazyloadRouteHandler('./routes/enclavebook
|
|
|
1639
1639
|
router.get('/enclavebooks/collection/:uid', lazyloadRouteHandler('./routes/enclavebooks/collection.js'));
|
|
1640
1640
|
|
|
1641
1641
|
// 色花堂
|
|
1642
|
-
router.get('/dsndsht23/picture/:subforumid', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1643
|
-
router.get('/dsndsht23/bt/:subforumid?', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1644
|
-
router.get('/dsndsht23/:subforumid?/:type?', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1645
|
-
router.get('/dsndsht23/:subforumid?', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1646
|
-
router.get('/dsndsht23', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1642
|
+
// router.get('/dsndsht23/picture/:subforumid', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1643
|
+
// router.get('/dsndsht23/bt/:subforumid?', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1644
|
+
// router.get('/dsndsht23/:subforumid?/:type?', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1645
|
+
// router.get('/dsndsht23/:subforumid?', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1646
|
+
// router.get('/dsndsht23', lazyloadRouteHandler('./routes/dsndsht23/index'));
|
|
1647
1647
|
|
|
1648
1648
|
// 数英网最新文章
|
|
1649
1649
|
router.get('/digitaling/index', lazyloadRouteHandler('./routes/digitaling/index'));
|
|
@@ -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'));
|
|
@@ -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'));
|
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
|
};
|
|
@@ -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 { art } = require('@/utils/render');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
|
|
8
|
+
module.exports = async (ctx) => {
|
|
9
|
+
const rootUrl = 'https://www.78dm.net';
|
|
10
|
+
const currentUrl = `${rootUrl}${ctx.path === '/' ? '/news' : /\/[0-9]+$/.test(ctx.path) ? `${ctx.path}.html` : ctx.path}`;
|
|
11
|
+
|
|
12
|
+
const response = await got({
|
|
13
|
+
method: 'get',
|
|
14
|
+
url: currentUrl,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const $ = cheerio.load(response.data);
|
|
18
|
+
|
|
19
|
+
let items = $('.card-title')
|
|
20
|
+
.slice(0, ctx.query.limit ? parseInt(ctx.query.limit) : 30)
|
|
21
|
+
.toArray()
|
|
22
|
+
.map((item) => {
|
|
23
|
+
item = $(item);
|
|
24
|
+
|
|
25
|
+
const link = item.attr('href');
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
title: item.text(),
|
|
29
|
+
link: /^\/\//.test(link) ? `https:${link}` : link,
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
items = await Promise.all(
|
|
34
|
+
items.map((item) =>
|
|
35
|
+
ctx.cache.tryGet(item.link, async () => {
|
|
36
|
+
const detailResponse = await got({
|
|
37
|
+
method: 'get',
|
|
38
|
+
url: item.link,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const content = cheerio.load(detailResponse.data);
|
|
42
|
+
|
|
43
|
+
content('.tag, .level').remove();
|
|
44
|
+
content('.lazy').each(function () {
|
|
45
|
+
content(this).replaceWith(
|
|
46
|
+
art(path.join(__dirname, 'templates/image.art'), {
|
|
47
|
+
image: content(this).attr('data-src'),
|
|
48
|
+
})
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
item.author = content('.push-username').first().text().split('楼主')[0];
|
|
53
|
+
item.pubDate = timezone(
|
|
54
|
+
parseDate(
|
|
55
|
+
content('.push-time')
|
|
56
|
+
.first()
|
|
57
|
+
.text()
|
|
58
|
+
.match(/(\d{4}-\d{2}-\d{2} \d{2}:\d{2})/)[1]
|
|
59
|
+
),
|
|
60
|
+
+8
|
|
61
|
+
);
|
|
62
|
+
item.description = content('.image-text-content').first().html();
|
|
63
|
+
|
|
64
|
+
return item;
|
|
65
|
+
})
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
ctx.state.data = {
|
|
70
|
+
title: `78动漫 - ${$('title').text().split('_')[0]} - ${$('.actived').first().text()}`,
|
|
71
|
+
link: currentUrl,
|
|
72
|
+
item: items,
|
|
73
|
+
};
|
|
74
|
+
};
|