From ab2a46a8cc5ec2f866a3ec168a6ef27da5891b21 Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Thu, 8 Oct 2020 22:05:09 +0800 Subject: [PATCH 01/40] =?UTF-8?q?feat:=20add=20=E5=AE=88=E6=9C=9B=E5=85=88?= =?UTF-8?q?=E9=94=8B=E8=A1=A5=E4=B8=81=E8=AF=B4=E6=98=8E=20(#5769)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henry Wang --- docs/other.md | 6 ++++++ lib/router.js | 3 +++ lib/routes/ow/patch.js | 23 +++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 lib/routes/ow/patch.js diff --git a/docs/other.md b/docs/other.md index 2f1de25e7e..59c373ec62 100644 --- a/docs/other.md +++ b/docs/other.md @@ -848,3 +848,9 @@ type 为 all 时,category 参数不支持 cost 和 free ### はてな匿名ダイアリー - 人気記事アーカイブ + +## 守望先锋 + +### 补丁说明 + + diff --git a/lib/router.js b/lib/router.js index 7a6ffc2f8d..c7304a9ec5 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3257,6 +3257,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); // CGTN router.get('/cgtn/top', require('./routes/cgtn/top')); +// 守望先锋 +router.get('/ow/patch', require('./routes/ow/patch')); + // MM范 router.get('/95mm/tab/:tab?', require('./routes/95mm/tab')); router.get('/95mm/tag/:tag', require('./routes/95mm/tag')); diff --git a/lib/routes/ow/patch.js b/lib/routes/ow/patch.js new file mode 100644 index 0000000000..3e5f027ae0 --- /dev/null +++ b/lib/routes/ow/patch.js @@ -0,0 +1,23 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const rootUrl = 'https://ow.blizzard.cn'; + const currentUrl = `${rootUrl}/action/article/patch?p=1&pageSize=10`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const items = response.data.data.list.map((item) => ({ + title: item.description, + link: `${rootUrl}/article/news/${item.articleId}`, + description: item.content, + pubDate: new Date(item.publishTime).toUTCString(), + })); + + ctx.state.data = { + title: '《守望先锋》补丁说明', + link: `${rootUrl}/game/patch-notes`, + item: items, + }; +}; From b25294a97f3feff4acbae3e0a40df7aed6021e51 Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Thu, 8 Oct 2020 22:05:54 +0800 Subject: [PATCH 02/40] =?UTF-8?q?feat:=20add=20=E5=8D=8E=E4=B8=BA=E5=BF=83?= =?UTF-8?q?=E5=A3=B0=E7=A4=BE=E5=8C=BA=E5=8D=8E=E4=B8=BA=E5=AE=B6=E4=BA=8B?= =?UTF-8?q?=20(#5777)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henry Wang --- docs/bbs.md | 20 ++++++++++ lib/router.js | 3 ++ lib/routes/huawei/xinsheng/index.js | 62 +++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 lib/routes/huawei/xinsheng/index.js diff --git a/docs/bbs.md b/docs/bbs.md index 718394c7f7..9a685895d2 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -429,6 +429,26 @@ pageClass: routes +## 华为心声社区 + +### 华为家事 + + + +分区 ID + +| 全部帖子 | 公司文件 | 管理思考 | 产品改进 | 版务公告 | +| -------- | -------- | -------- | -------- | -------- | +| | 155 | 415 | 427 | 419 | + +排序方式 + +| 最新发帖 | 最新回复 | 最多回复 | 最多点击 | +| -------- | -------- | ---------- | --------- | +| cTime | rTime | replycount | viewcount | + + + ## 一亩三分地 ### 主题帖 diff --git a/lib/router.js b/lib/router.js index c7304a9ec5..5eed4c74b1 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3257,6 +3257,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); // CGTN router.get('/cgtn/top', require('./routes/cgtn/top')); +// 华为心声社区 +router.get('/huawei/xinsheng/:caty?/:order?/:keyword?', require('./routes/huawei/xinsheng/index')); + // 守望先锋 router.get('/ow/patch', require('./routes/ow/patch')); diff --git a/lib/routes/huawei/xinsheng/index.js b/lib/routes/huawei/xinsheng/index.js new file mode 100644 index 0000000000..794f5d8036 --- /dev/null +++ b/lib/routes/huawei/xinsheng/index.js @@ -0,0 +1,62 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + ctx.params.order = ctx.params.order || ''; + ctx.params.keyword = ctx.params.keyword || ''; + ctx.params.caty = ctx.params.caty || ''; + + const rootUrl = `http://xinsheng.huawei.com/cn/index.php?app=forum&mod=List&class=461&order=${ctx.params.order}&search=${ctx.params.keyword}&cate=${ctx.params.caty}`; + const response = await got({ + method: 'get', + url: rootUrl, + }); + const $ = cheerio.load(response.data); + + $('a[linktag="__subject_link__"]').remove(); + + const list = $('.bbs_list ul li .font_box .title p font a') + .slice(0, 15) + .map((_, item) => { + item = $(item); + return { + title: item.attr('title'), + link: item.attr('href'), + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + item.description = content('.bbs_info_right_text').eq(0).html(); + item.pubDate = new Date(content('span.fl').eq(0).text().trim() + ' GMT+8').toUTCString(); + item.author = content('.bbs_info_user_ a').eq(1).text(); + + return item; + }) + ) + ); + + let title; + + $('.bbs_list_box_title_wz ul li').each(function () { + if ($(this).hasClass('on')) { + title = $(this).text(); + return; + } + }); + + ctx.state.data = { + title: `${title} - 华为家事 - 心声社区`, + link: rootUrl, + item: items, + }; +}; From 5606d4389fd87ee73c77e727e59b3e0c7446f0cc Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 8 Oct 2020 14:08:05 +0000 Subject: [PATCH 03/40] style: auto format --- docs/bbs.md | 40 ++++++++++++++++++++-------------------- docs/other.md | 12 ++++++------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/bbs.md b/docs/bbs.md index 9a685895d2..7658adf744 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -248,6 +248,26 @@ pageClass: routes +## 华为心声社区 + +### 华为家事 + + + +分区 ID + +| 全部帖子 | 公司文件 | 管理思考 | 产品改进 | 版务公告 | +| -------- | -------- | -------- | -------- | -------- | +| | 155 | 415 | 427 | 419 | + +排序方式 + +| 最新发帖 | 最新回复 | 最多回复 | 最多点击 | +| -------- | -------- | ---------- | --------- | +| cTime | rTime | replycount | viewcount | + + + ## 看雪 ### 论坛 @@ -429,26 +449,6 @@ pageClass: routes -## 华为心声社区 - -### 华为家事 - - - -分区 ID - -| 全部帖子 | 公司文件 | 管理思考 | 产品改进 | 版务公告 | -| -------- | -------- | -------- | -------- | -------- | -| | 155 | 415 | 427 | 419 | - -排序方式 - -| 最新发帖 | 最新回复 | 最多回复 | 最多点击 | -| -------- | -------- | ---------- | --------- | -| cTime | rTime | replycount | viewcount | - - - ## 一亩三分地 ### 主题帖 diff --git a/docs/other.md b/docs/other.md index 59c373ec62..2eace247d8 100644 --- a/docs/other.md +++ b/docs/other.md @@ -625,6 +625,12 @@ type 为 all 时,category 参数不支持 cost 和 free +## 守望先锋 + +### 补丁说明 + + + ## 四川省科学技术厅 ### 四川省科学技术厅 - 公示公告 @@ -848,9 +854,3 @@ type 为 all 时,category 参数不支持 cost 和 free ### はてな匿名ダイアリー - 人気記事アーカイブ - -## 守望先锋 - -### 补丁说明 - - From 1c1de6c09d53f578bf336533827c4e2c4774c05b Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Thu, 8 Oct 2020 22:10:00 +0800 Subject: [PATCH 04/40] =?UTF-8?q?feat:=20add=20=E5=8F=B0=E6=B9=BE=E4=B8=AD?= =?UTF-8?q?=E5=A4=AE=E9=80=9A=E8=AE=AF=E7=A4=BE=20(#5815)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henry Wang --- docs/traditional-media.md | 12 ++++++++++ lib/router.js | 3 +++ lib/routes/cna/index.js | 49 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 lib/routes/cna/index.js diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 88971d963a..c7f924ea38 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -571,6 +571,18 @@ category 对应的关键词有 +## 台湾中央通讯社 + +### 分类 + + + +| 即時 | 政治 | 國際 | 兩岸 | 產經 | 證券 | 科技 | 生活 | 社會 | 地方 | 文化 | 運動 | 娛樂 | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| aall | aipl | aopl | acn | aie | asc | ait | ahel | asoc | aloc | acul | aspt | amov | + + + ## 网易新闻专栏 ### 栏目 diff --git a/lib/router.js b/lib/router.js index 5eed4c74b1..53165c7326 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3257,6 +3257,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); // CGTN router.get('/cgtn/top', require('./routes/cgtn/top')); +// 台湾中央通讯社 +router.get('/cna/:id?', require('./routes/cna/index')); + // 华为心声社区 router.get('/huawei/xinsheng/:caty?/:order?/:keyword?', require('./routes/huawei/xinsheng/index')); diff --git a/lib/routes/cna/index.js b/lib/routes/cna/index.js new file mode 100644 index 0000000000..52f9743718 --- /dev/null +++ b/lib/routes/cna/index.js @@ -0,0 +1,49 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + ctx.params.id = ctx.params.id || 'aall'; + + const rootUrl = `https://www.cna.com.tw/list/${ctx.params.id}.aspx`; + const response = await got({ + method: 'get', + url: rootUrl, + }); + + const $ = cheerio.load(response.data); + const list = $('#jsMainList li a div h2') + .slice(0, 10) + .map((_, item) => { + item = $(item); + return { + title: item.text(), + link: item.parents('a').attr('href'), + pubDate: new Date(item.next().text() + ' GMT+8').toUTCString(), + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + const topImage = content('.fullPic').html(); + + item.description = (topImage === null ? '' : topImage) + content('.paragraph').eq(0).html(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: rootUrl, + item: items, + }; +}; From eb0ec1525f3f8b7c5d7015d5555bb6b950061100 Mon Sep 17 00:00:00 2001 From: Laam Pui Date: Thu, 8 Oct 2020 22:11:44 +0800 Subject: [PATCH 05/40] feat: add route of 'zsnews.cn' (#5818) --- docs/traditional-media.md | 12 ++++++++++++ lib/router.js | 3 +++ lib/routes/zsnews/index.js | 18 ++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 lib/routes/zsnews/index.js diff --git a/docs/traditional-media.md b/docs/traditional-media.md index c7f924ea38..071f371ca6 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -791,6 +791,18 @@ category 对应的关键词有 +## 中山网 + +### 中山网新闻 + + + +| 35 | 36 | 37 | 38 | 39 | +| ---- | ---- | ---- | ---- | ---- | +| 本地 | 镇区 | 热点 | 社会 | 综合 | + + + ## 中時電子報 ### 新聞 diff --git a/lib/router.js b/lib/router.js index 53165c7326..7f4a630cdc 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3163,6 +3163,9 @@ router.get('/shiep/:type', require('./routes/universities/shiep/index')); router.get('/fjnews/:city/:limit', require('./routes/fjnews/fznews')); router.get('/fjnews/jjnews', require('./routes/fjnews/jjnews')); +// 中山网新闻 +router.get('/zsnews/index/:cateid', require('./routes/zsnews/index')); + // 孔夫子旧书网 router.get('/kongfz/people/:id', require('./routes/kongfz/people')); router.get('/kongfz/shop/:id/:cat?', require('./routes/kongfz/shop')); diff --git a/lib/routes/zsnews/index.js b/lib/routes/zsnews/index.js new file mode 100644 index 0000000000..be0c2d49a4 --- /dev/null +++ b/lib/routes/zsnews/index.js @@ -0,0 +1,18 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + ctx.params.cateid = ctx.params.cateid || '35'; + + const response = await got.get(`http://www.zsnews.cn/api/mobile/getlist.html?cateid=${ctx.params.cateid}`); + + ctx.state.data = { + title: '中山新闻', + link: 'https://www.zsnews.cn/', + item: response.data.map((item) => ({ + guid: item.id, + title: item.title, + description: item.title, + link: item.url, + })), + }; +}; From 6d34e0e532b4b4039c3ec6ace9af2f0aff12b7c1 Mon Sep 17 00:00:00 2001 From: hoilc Date: Thu, 8 Oct 2020 22:15:19 +0800 Subject: [PATCH 06/40] fix: adjust lolnews default timezone (#5824) --- lib/routes/lol/newsindex.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/lol/newsindex.js b/lib/routes/lol/newsindex.js index 439b6f64d6..dbd17755c9 100644 --- a/lib/routes/lol/newsindex.js +++ b/lib/routes/lol/newsindex.js @@ -88,7 +88,7 @@ module.exports = async (ctx) => { return list.map((item) => ({ title: `【${typeName}】` + item.sTitle, link: getUrl(item.sRedirectURL, item.iDocID, item.sVID), - pubDate: new Date(`${item.sCreated} GMT`).toUTCString(), + pubDate: new Date(`${item.sCreated} UTC+8`).toUTCString(), guid: item.iDocID, })); } From 676f3fbb4ea501214947a8665ef3b9176c083e4c Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Thu, 8 Oct 2020 22:16:05 +0800 Subject: [PATCH 07/40] feat: add abc news (#5776) Co-authored-by: codefactor-io Co-authored-by: Henry Wang --- docs/en/traditional-media.md | 14 ++++++ docs/traditional-media.md | 14 ++++++ lib/router.js | 3 ++ lib/routes/abc/index.js | 86 ++++++++++++++++++++++++++++++++++++ 4 files changed, 117 insertions(+) create mode 100644 lib/routes/abc/index.js diff --git a/docs/en/traditional-media.md b/docs/en/traditional-media.md index b8bf38347b..b4edd549bc 100644 --- a/docs/en/traditional-media.md +++ b/docs/en/traditional-media.md @@ -4,6 +4,20 @@ pageClass: routes # News +## ABC News + +### Site + + + +Site + +| Just In | Politics | World | Business | Analysis | Sport | Science | Health | Arts | Fact Check | 中文新闻 | Berita Bahasa Indonesia | Tok Pisin | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | +| justin | politics | world | business | analysis-and-opinion | sport | science | health | arts-culture | factcheck | chinese | indonesian | tok-pisin | + + + ## AP News ### Topics diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 071f371ca6..9bac16da18 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -10,6 +10,20 @@ pageClass: routes +## ABC News + +### 子站 + + + +子站 + +| Just In | Politics | World | Business | Analysis | Sport | Science | Health | Arts | Fact Check | 中文新闻 | Berita Bahasa Indonesia | Tok Pisin | +| ------- | -------- | ----- | -------- | -------------------- | ----- | ------- | ------ | ------------ | ---------- | -------- | ----------------------- | --------- | +| justin | politics | world | business | analysis-and-opinion | sport | science | health | arts-culture | factcheck | chinese | indonesian | tok-pisin | + + + ## AP News ### 话题 diff --git a/lib/router.js b/lib/router.js index 7f4a630cdc..cc4d681f31 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3260,6 +3260,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); // CGTN router.get('/cgtn/top', require('./routes/cgtn/top')); +// ABC News +router.get('/abc/:site?', require('./routes/abc/index.js')); + // 台湾中央通讯社 router.get('/cna/:id?', require('./routes/cna/index')); diff --git a/lib/routes/abc/index.js b/lib/routes/abc/index.js new file mode 100644 index 0000000000..727dbd839c --- /dev/null +++ b/lib/routes/abc/index.js @@ -0,0 +1,86 @@ +const url = require('url'); +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + ctx.params.site = ctx.params.site || ''; + + const rootUrl = 'https://mobile.abc.net.au'; + const currentUrl = `${rootUrl}/news/${ctx.params.site}`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + const $ = cheerio.load(response.data); + + $('._3zQMR, .ticker').remove(); + + const list = $('h3') + .slice(0, 10) + .map((_, item) => { + item = $(item); + return { + title: item.text(), + link: url.resolve(rootUrl, item.parents('a').attr('href') || item.find('a').attr('href')), + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + content('.modal-content').remove(); + + content('img').each(function () { + content(this).attr('src', content(this).attr('data-src')); + }); + + let coverImage, contentBody; + if (content('div[data-component="FeatureMedia"]').html() !== null) { + coverImage = content('div[data-component="FeatureMedia"]').html(); + } else { + coverImage = content('.view-hero-media').html(); + } + if (content('#body').html() !== null) { + contentBody = content('#body').html(); + } else { + contentBody = content('.article-text').html(); + } + + const authorsArray = []; + const authorsMatch = detailResponse.data.match(/author":(.*),"dateModified/); + if (authorsMatch === null) { + authorsArray.push(content('meta[name="DCTERMS.contributor"]').attr('content')); + } else { + const authors = JSON.parse(authorsMatch[1]); + try { + for (const author of authors) { + authorsArray.push(author.name); + } + } catch (e) { + authorsArray.push(authors.name); + } + } + + item.description = coverImage + contentBody; + item.pubDate = new Date(content('meta[property="article:published_time"]').attr('content')).toUTCString(); + item.author = authorsArray.join(', '); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: currentUrl, + item: items, + }; +}; From bb3f9cde6b31d438485ae80941e5789706a31772 Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Thu, 8 Oct 2020 22:17:14 +0800 Subject: [PATCH 08/40] feat: add anki changes (#5799) Co-authored-by: Henry Wang --- docs/en/program-update.md | 6 ++++++ docs/program-update.md | 6 ++++++ lib/router.js | 3 +++ lib/routes/anki/changes.js | 39 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 lib/routes/anki/changes.js diff --git a/docs/en/program-update.md b/docs/en/program-update.md index bf9ae400d6..d5040fd7d4 100644 --- a/docs/en/program-update.md +++ b/docs/en/program-update.md @@ -4,6 +4,12 @@ pageClass: routes # Application Updates +## Anki + +### Changes + + + ## Apkpure ### Versions diff --git a/docs/program-update.md b/docs/program-update.md index 039a93b559..1fef997e80 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -14,6 +14,12 @@ pageClass: routes +## Anki + +### Changes + + + ## Apkpure ### Versions diff --git a/lib/router.js b/lib/router.js index cc4d681f31..1fb3dfab72 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3260,6 +3260,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); // CGTN router.get('/cgtn/top', require('./routes/cgtn/top')); +// Anki +router.get('/anki/changes', require('./routes/anki/changes')); + // ABC News router.get('/abc/:site?', require('./routes/abc/index.js')); diff --git a/lib/routes/anki/changes.js b/lib/routes/anki/changes.js new file mode 100644 index 0000000000..cf6564b40d --- /dev/null +++ b/lib/routes/anki/changes.js @@ -0,0 +1,39 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const md = require('markdown-it')({ + html: true, +}); + +module.exports = async (ctx) => { + const rootUrl = 'https://changes.ankiweb.net'; + const currentUrl = `${rootUrl}/README.md`; + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const html = md.render(response.data.replace(/# Changes in/g, '## Changes in').replace(/### Changes in/g, '## Changes in')); + const $ = cheerio.load(html.replace(/

/g, '

')); + + const items = $('div') + .slice(0, 20) + .map((_, item) => { + item = $(item); + const h2 = item.find('h2'); + const match = item.find('p').text().match('Released (.*).'); + h2.remove(); + return { + title: h2.text(), + description: item.html(), + link: `${rootUrl}/#/?id=changes-in-${h2.text().toLowerCase().split(' ').join('-').replace(/\./g, '')}`, + pubDate: match ? new Date(match[1].split(',')[0] + ' GMT+8').toUTCString() : '', + }; + }) + .get(); + + ctx.state.data = { + title: 'Changes - Anki', + link: rootUrl, + item: items, + }; +}; From 35f37a6d627e11765b572ee5c8013afef19c4fb4 Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Thu, 8 Oct 2020 22:17:45 +0800 Subject: [PATCH 09/40] =?UTF-8?q?feat:=20add=20iCity=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=8A=A8=E6=80=81=20(#5796)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henry Wang --- docs/social-media.md | 6 ++++++ lib/router.js | 3 +++ lib/routes/icity/index.js | 30 ++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 lib/routes/icity/index.js diff --git a/docs/social-media.md b/docs/social-media.md index 12444685d6..efd07a304f 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -298,6 +298,12 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性 +## iCity + +### 用户动态 + + + ## Keep ### 运动日记 diff --git a/lib/router.js b/lib/router.js index 1fb3dfab72..0409e35230 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3260,6 +3260,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); // CGTN router.get('/cgtn/top', require('./routes/cgtn/top')); +// iCity +router.get('/icity/:id', require('./routes/icity/index')); + // Anki router.get('/anki/changes', require('./routes/anki/changes')); diff --git a/lib/routes/icity/index.js b/lib/routes/icity/index.js new file mode 100644 index 0000000000..db87c45fab --- /dev/null +++ b/lib/routes/icity/index.js @@ -0,0 +1,30 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const rootUrl = `https://icity.ly/u/${ctx.params.id}`; + const response = await got({ + method: 'get', + url: rootUrl, + }); + + const $ = cheerio.load(response.data); + const items = $('li.diary') + .map((_, item) => { + item = $(item); + return { + link: rootUrl, + title: item.prev('li.day-cut').text(), + description: item.find('div.line').html(), + pubDate: new Date(item.find('time.hours').attr('datetime')).toUTCString(), + }; + }) + .get(); + + ctx.state.data = { + title: $('title').text(), + link: rootUrl, + item: items, + description: $('div.bio').text(), + }; +}; From 271e2750e23e841176581907645db697b1b5b46b Mon Sep 17 00:00:00 2001 From: Arracc <33948217+Arracc@users.noreply.github.com> Date: Fri, 9 Oct 2020 04:32:14 +0800 Subject: [PATCH 10/40] =?UTF-8?q?fix:=20=E8=AA=AD=E5=A3=B2=E6=96=B0?= =?UTF-8?q?=E8=81=9E,=20add=20title=20tag=20(#5825)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/traditional-media.md | 2 ++ lib/router.js | 2 +- lib/routes/yomiuri/news.js | 24 +++++++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 9bac16da18..67dfe4faa6 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -259,6 +259,8 @@ Category 列表: +无料全文,综合页添加分类标签,可用于过滤。 + | 総合 | 社会 | 政治 | 経済 | スポーツ | 国際 | 科学・IT | 選挙・世論調査 | エンタメ・文化 | 囲碁・将棋 | ライフ | 地域 | 社説 | | ---- | -------- | -------- | ------- | -------- | ----- | ---------- | -------------- | -------------- | ---------- | ------ | ----- | --------- | | news | national | politics | economy | sports | world | science | election | culture | igoshougi | life | local | editorial | diff --git a/lib/router.js b/lib/router.js index 0409e35230..9bd69676dd 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3314,7 +3314,7 @@ router.get('/nobelprize/:caty?', require('./routes/nobelprize/index')); router.get('/gov/taiwan/mnd', require('./routes/gov/taiwan/mnd')); // 読売新聞 -router.get('/yomiuri/:category?', require('./routes/yomiuri/news')); +router.get('/yomiuri/:category', require('./routes/yomiuri/news')); // 巴哈姆特 // GNN新闻 diff --git a/lib/routes/yomiuri/news.js b/lib/routes/yomiuri/news.js index 80c2b755e9..e61dcabc96 100644 --- a/lib/routes/yomiuri/news.js +++ b/lib/routes/yomiuri/news.js @@ -32,8 +32,30 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); return $('div.p-main-contents').html(); }); + let tag = ''; + if (category_name === '総合') { + const tag_table = { + news: '総合', + national: '社会', + politics: '政治', + economy: '経済', + sports: 'スポーツ', + world: '国際', + science: '科学・IT', + election: '選挙・世論調査', + culture: 'エンタメ・文化', + igoshougi: '囲碁・将棋', + life: 'ライフ', + local: '地域', + editorial: '社説', + medical: '医療・健康', + }; + const tag_value = tag_table[link.split('/')[3]]; + tag = tag_value ? tag_value : 'その他'; + tag = '[' + tag + '] '; + } return { - title: item.find('a').text(), + title: tag + item.find('a').text(), description, link, }; From 09ca4c000ff2ccc19469c9fe263dc66ba619c41e Mon Sep 17 00:00:00 2001 From: prnake Date: Sat, 10 Oct 2020 03:57:04 +0800 Subject: [PATCH 11/40] fix: coolapk line wrap (#5829) --- lib/routes/coolapk/utils.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/routes/coolapk/utils.js b/lib/routes/coolapk/utils.js index 0de2776e3d..a9fe67348c 100644 --- a/lib/routes/coolapk/utils.js +++ b/lib/routes/coolapk/utils.js @@ -61,8 +61,7 @@ const parseDongtai = async (item, ctx) => { url: itemUrl, headers: getHeaders(), }); - - const message = `

` + result.data.data.message + `

`; + const message = `

` + result.data.data.message.split('\n').join('
') + `

`; const picArr = item.picArr.filter((i) => i).map((i) => ``); // 若无图片,item.picArr=[""] return message + picArr.join(''); }); From 0c0bbd40099eceec7e344593dc5ef1b27c64bd59 Mon Sep 17 00:00:00 2001 From: prnake Date: Sat, 10 Oct 2020 03:57:27 +0800 Subject: [PATCH 12/40] fix: btbyr (#5833) --- lib/config.js | 2 +- lib/routes/universities/bupt/funbox.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/config.js b/lib/config.js index f5caf3b5d9..5b875cc0cc 100644 --- a/lib/config.js +++ b/lib/config.js @@ -144,7 +144,7 @@ const calculateValue = () => { bearertoken: envs.INITIUM_BEARER_TOKEN, }, btbyr: { - host: envs.BTBYR_HOST || 'https://bt.byr.cn/', + host: envs.BTBYR_HOST, cookies: envs.BTBYR_COOKIE, }, mastodon: { diff --git a/lib/routes/universities/bupt/funbox.js b/lib/routes/universities/bupt/funbox.js index 9057c2b49c..f0facf769d 100644 --- a/lib/routes/universities/bupt/funbox.js +++ b/lib/routes/universities/bupt/funbox.js @@ -4,7 +4,7 @@ const cheerio = require('cheerio'); module.exports = async (ctx) => { const cookie = config.btbyr.cookies; - const url = config.btbyr.host; + const url = config.btbyr.host || 'https://bt.byr.cn/'; const response = await got({ method: 'get', url: url + `log.php?action=funbox`, @@ -24,6 +24,7 @@ module.exports = async (ctx) => { .find('tr > td.rowfollow') .eq(2) .html() + .replace(/https:\/\/bt.byr.cn\//g, url) .replace(/onclick=.*findPosition\(this\)\[1\]-58\);"/g, '') .replace(/.thumb.jpg/g, ''), link: url + `log.php?action=funbox`, From 2246c5a5e372dabe07ddd40ea71f3f06014f4576 Mon Sep 17 00:00:00 2001 From: prnake Date: Sat, 10 Oct 2020 03:58:14 +0800 Subject: [PATCH 13/40] fix: zhihu (#5834) --- docs/social-media.md | 2 +- lib/routes/zhihu/answers.js | 96 ++++++++++++++++------------------ lib/routes/zhihu/pin/people.js | 4 +- 3 files changed, 48 insertions(+), 54 deletions(-) diff --git a/docs/social-media.md b/docs/social-media.md index efd07a304f..298c4fa69b 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -934,7 +934,7 @@ rule ### 用户回答 - + ### 用户文章 diff --git a/lib/routes/zhihu/answers.js b/lib/routes/zhihu/answers.js index c0a10ea29f..019090d5a5 100644 --- a/lib/routes/zhihu/answers.js +++ b/lib/routes/zhihu/answers.js @@ -1,68 +1,62 @@ const got = require('@/utils/got'); const utils = require('./utils'); -const crypto = require('crypto'); -const jsencrypt = require('./execlib/jsencrypt'); module.exports = async (ctx) => { const id = ctx.params.id; - - const d_c0 = await getDC0FromCookies(id); - - const zst81 = - '3_2.0ae3TnRUTEvOOUCNMTQnTSHUZo02p-HNMZBO8YD_q2Xtuo_Y0K6P0E6uy-LS9-hp1DufI-we8gGHPgJO1xuPZ0GxCTJHR7820XM20cLRGDJXfgGCBxupMuD_Ic4cpr4w0mRPO7HoY70SfquPmz93mhDQyiqV9ebO1hwOYiiR0ELYuUrxmtDomqU7ynXtOnAoTh_PhRDSTF82VVh29ZhFL1bUYbLgszUc04wFMCrLf9ucOA9HYMGVmzDwyJG2_tJSC4CeTveg11UY9qcX0DhoY2eS1u9efxCVqxGYMhrxyqh2pwucY8bSBwge0Vbx8fBtYWuVMcqumUqSBchLCzJLOErpL3hepEgHfyuYBZrx9oBo1o7NY7CL_fh90Vqkwq9COGMVYzc9BnugLJCw9-GXmShgO0h3KHU2YsQx0zqxY8DNmuUwOMwt1oMOOQvN_iBg8ZqVBtbo_rDwVQvw1JUNmZcN_wBSBAD3KwqN83rO0QTLsWwYC'; - const zse83 = '3_2.0'; - - const path = `/api/v4/members/${id}/answers?include=data%5B*%5D.is_normal%2Cadmin_closed_comment%2Creward_info%2Cis_collapsed%2Cannotation_action%2Cannotation_detail%2Ccollapse_reason%2Ccollapsed_by%2Csuggest_edit%2Ccomment_count%2Ccan_comment%2Ccontent%2Ceditable_content%2Cvoteup_count%2Creshipment_settings%2Ccomment_permission%2Cmark_infos%2Ccreated_time%2Cupdated_time%2Creview_info%2Cexcerpt%2Cis_labeled%2Clabel_info%2Crelationship.is_authorized%2Cvoting%2Cis_author%2Cis_thanked%2Cis_nothelp%2Cis_recognized%3Bdata%5B*%5D.author.badge%5B%3F(type%3Dbest_answerer)%5D.topics%3Bdata%5B*%5D.question.has_publishing_draft%2Crelationship&offset=0&limit=20&sort_by=created`; - const currenURI = `https://www.zhihu.com/people/${id}/answers`; - - const tmp = [zse83, path, currenURI, d_c0, zst81].join('+'); - const md5 = crypto.createHash('md5'); - const signature = jsencrypt(md5.update(tmp).digest('hex')); - - const xzseHeaders = { - 'x-zse-83': zse83, - 'x-zse-86': '1.0_' + signature, - 'x-zst-81': zst81, + const headers = { + 'User-Agent': 'ZhihuHybrid com.zhihu.android/Futureve/6.59.0 Mozilla/5.0 (Linux; Android 10; GM1900 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/85.0.4183.127 Mobile Safari/537.36', + Referer: `https://www.zhihu.com/people/${id}/answers`, }; const response = await got({ method: 'get', - url: `https://www.zhihu.com${path}`, - headers: { - ...utils.header, - ...xzseHeaders, - Referer: `https://www.zhihu.com/people/${id}/answers`, - cookie: `d_c0=${d_c0}`, - }, + url: `https://api.zhihu.com/people/${id}/answers?order_by=created&offset=0&limit=10`, + headers: headers, }); const data = response.data.data; + let name = data[0].author.name; + + if (name === '知乎用户') { + const info = await got({ + method: 'get', + url: `https://www.zhihu.com/api/v4/members/${id}/activities?limit=1`, + headers: { + ...utils.header, + Referer: `https://www.zhihu.com/people/${id}/activities`, + Authorization: 'oauth c3cef7c66a1843f8b3a9e6a1e3160e20', // hard-coded in js + }, + }); + name = info.data.data[0].actor.name; + } + + const items = await Promise.all( + data.map(async (item) => { + let description; + const link = `https://www.zhihu.com/question/${item.question.id}/answer/${item.id}`; + const title = item.question.title; + try { + const detail = await got({ + method: 'get', + url: `https://api.zhihu.com/appview/api/v4/answers/${item.id}?include=content&is_appview=true`, + headers: headers, + }); + description = utils.ProcessImage(detail.data.content); + } catch (e) { + description = `${title}`; + } + return { + title: title, + description: description, + pubDate: new Date(item.created_time * 1000).toUTCString(), + link: link, + }; + }) + ); ctx.state.data = { - title: `${data[0].author.name}的知乎回答`, + title: `${name}的知乎回答`, link: `https://www.zhihu.com/people/${id}/answers`, - description: data[0].author.headline || data[0].author.description, - item: data.map((item) => ({ - title: item.question.title, - description: utils.ProcessImage(item.content), - pubDate: new Date(item.created_time * 1000).toUTCString(), - link: `https://www.zhihu.com/question/${item.question.id}/answer/${item.id}`, - })), + item: items, }; }; - -async function getDC0FromCookies(id) { - const url = `https://www.zhihu.com/people/${id}`; - const response = await got({ - method: 'get', - url, - headers: { - ...utils.header, - }, - }); - - const targetCookies = (response.headers['set-cookie'] || []).filter((c) => /d_c0=([^;]+)/.test(c)); - const matchResult = (targetCookies[0] || '').match(new RegExp('d_c0=([^;]+)')); - - return matchResult[1] || ''; -} diff --git a/lib/routes/zhihu/pin/people.js b/lib/routes/zhihu/pin/people.js index ee44bbc16b..e36d9cb8be 100644 --- a/lib/routes/zhihu/pin/people.js +++ b/lib/routes/zhihu/pin/people.js @@ -8,11 +8,11 @@ module.exports = async (ctx) => { data: { data }, } = await got({ method: 'get', - url: `https://www.zhihu.com/api/v4/members/${id}/pins?offset=0&limit=20&includes=data%5B*%5D.upvoted_followees%2Cadmin_closed_comment`, + url: `https://api.zhihu.com/pins/${id}/moments?limit=10&offset=0`, }); ctx.state.data = { - title: `${data[0].author.name}的知乎想法`, + title: `${data[0].target.author.name}的知乎想法`, link: `https://www.zhihu.com/people/${id}/pins`, item: generateData(data), }; From e8b4980d46c00d448a31f16871ca3d9e7d0902fb Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Sat, 10 Oct 2020 04:34:36 +0800 Subject: [PATCH 14/40] feat: add behance user appreciations (#5835) --- docs/design.md | 2 +- docs/en/design.md | 2 +- lib/router.js | 2 +- lib/routes/behance/index.js | 24 +++++++++++++++++------- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/docs/design.md b/docs/design.md index 5b35b64762..6e49e3637d 100644 --- a/docs/design.md +++ b/docs/design.md @@ -20,7 +20,7 @@ pageClass: routes ### User Works - + Behance 用户主页 URL 获取用户名,如 的用户名为 `mishapetrick`。 diff --git a/docs/en/design.md b/docs/en/design.md index 7f96898568..ad871e6eb7 100644 --- a/docs/en/design.md +++ b/docs/en/design.md @@ -20,7 +20,7 @@ Some tags are rarely used: `Script`, `direction`, `production`, `design-concep ### User Works - + Behance user's profile URL, like the username will be `mishapetrick`。 diff --git a/lib/router.js b/lib/router.js index 9bd69676dd..8201ef675e 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3069,7 +3069,7 @@ router.get('/touhougarakuta/:language/:type', require('./routes/touhougarakuta') router.get('/liequtv/room/:id', require('./routes/liequtv/room')); // Behance -router.get('/behance/:user', require('./routes/behance/index')); +router.get('/behance/:user/:type?', require('./routes/behance/index')); // furstar.jp router.get('/furstar/characters/:lang?', require('./routes/furstar/index')); diff --git a/lib/routes/behance/index.js b/lib/routes/behance/index.js index 13c8262526..0f3806e1e3 100644 --- a/lib/routes/behance/index.js +++ b/lib/routes/behance/index.js @@ -4,9 +4,11 @@ const dayjs = require('dayjs'); module.exports = async (ctx) => { const user = ctx.params.user || ''; + const type = ctx.params.type || 'projects'; + const response = await got({ method: 'get', - url: `https://www.behance.net/${user}/projects`, // 接口只获取12个项目 + url: `https://www.behance.net/${user}/${type}`, // 接口只获取12个项目 headers: { 'X-Requested-With': 'XMLHttpRequest', }, @@ -15,6 +17,9 @@ module.exports = async (ctx) => { const list = data.profile.activeSection.work.projects; const articledata = await Promise.all( list.map(async (item) => { + if (type !== 'projects') { + item = item.project; + } const url = `${item.url}?ilo0=1`; const cache = await ctx.cache.get(url); if (cache) { @@ -38,11 +43,16 @@ module.exports = async (ctx) => { ctx.state.data = { title: `${data.profile.owner.first_name} ${data.profile.owner.last_name}'s Work`, link: `${data.profile.owner.url}`, - item: list.map((item, index) => ({ - title: `${item.name}`, - description: `${articledata[index].content}`, - link: `${item.url}`, - pubDate: dayjs.unix(item.published_on).format(), - })), + item: list.map((item, index) => { + if (type !== 'projects') { + item = item.project; + } + return { + title: `${item.name}`, + description: `${articledata[index].content}`, + link: `${item.url}`, + pubDate: dayjs.unix(item.published_on).format(), + }; + }), }; }; From ad6135b0d25c19074acb59920f0456532e59909a Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Sat, 10 Oct 2020 04:40:22 +0800 Subject: [PATCH 15/40] =?UTF-8?q?feat:=20add=20=E5=B7=B4=E5=93=88=E5=A7=86?= =?UTF-8?q?=E7=89=B9=E9=9B=BB=E7=8E=A9=E8=B3=87=E8=A8=8A=E7=AB=99=E7=86=B1?= =?UTF-8?q?=E9=96=80=E6=8E=A8=E8=96=A6=20(#5826)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henry Wang --- docs/bbs.md | 6 +++++ lib/router.js | 3 +++ lib/routes/gamer/hot.js | 49 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 lib/routes/gamer/hot.js diff --git a/docs/bbs.md b/docs/bbs.md index 7658adf744..ea5e48ad09 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -178,6 +178,12 @@ pageClass: routes +## 巴哈姆特電玩資訊站 + +### 熱門推薦 + + + ## 才符 ### 用户动态 diff --git a/lib/router.js b/lib/router.js index 8201ef675e..d2b1461966 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3260,6 +3260,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); // CGTN router.get('/cgtn/top', require('./routes/cgtn/top')); +// 巴哈姆特電玩資訊站 +router.get('/gamer/hot/:bsn', require('./routes/gamer/hot')); + // iCity router.get('/icity/:id', require('./routes/icity/index')); diff --git a/lib/routes/gamer/hot.js b/lib/routes/gamer/hot.js new file mode 100644 index 0000000000..55be88194e --- /dev/null +++ b/lib/routes/gamer/hot.js @@ -0,0 +1,49 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const rootUrl = `https://forum.gamer.com.tw/A.php?bsn=${ctx.params.bsn}`; + const response = await got({ + method: 'get', + url: rootUrl, + }); + + const $ = cheerio.load(response.data); + const list = $('div.FM-abox2A a.FM-abox2B') + .slice(0, 10) + .map((_, item) => { + item = $(item); + return { + link: `https:${item.attr('href')}`, + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + }); + const content = cheerio.load(detailResponse.data); + + content('div.c-post__body__buttonbar').remove(); + + item.title = content('.c-post__header__title').text(); + item.description = content('div.c-post__body').html(); + item.author = `${content('a.username').eq(0).text()} (${content('a.userid').eq(0).text()})`; + item.pubDate = new Date(content('a.edittime').eq(0).attr('data-mtime') + ' GMT+8').toUTCString(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: $('title').text(), + link: rootUrl, + item: items, + }; +}; From fed0404c3bba07952c9b1fb2eec818aa1763ac14 Mon Sep 17 00:00:00 2001 From: Ethan Shen Date: Sat, 10 Oct 2020 04:45:17 +0800 Subject: [PATCH 16/40] feat: add Academy of Management journals (#5807) Co-authored-by: Henry Wang --- docs/en/journal.md | 31 +++++++++++ docs/journal.md | 21 +++++++- lib/router.js | 3 ++ lib/routes/aom/journal.js | 108 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 lib/routes/aom/journal.js diff --git a/docs/en/journal.md b/docs/en/journal.md index 9c2d379e7d..16ea6b799c 100644 --- a/docs/en/journal.md +++ b/docs/en/journal.md @@ -4,6 +4,37 @@ pageClass: routes # Scientific Journal +## arXiv + +### Search Keyword + + + +See [arXiv API User Manual](https://arxiv.org/help/api/user-manual) to find out all query statements. + +Fill in parameter `query` with content after `http://export.arxiv.org/api/query?`. + + + +## Academy of Management + +### Journal + + + +| Id | Title | +| --------- | ------------------------------------------ | +| annals | Academy of Management Annals | +| amd | Academy of Management Discoveries | +| amgblproc | Academy of Management Global Proceedings | +| amj | Academy of Management Journal | +| amle | Academy of Management Learning & Education | +| amp | Academy of Management Perspectives | +| amproc | Academy of Management Proceedings | +| amr | Academy of Management Review | + + + ## Cell Journal diff --git a/docs/journal.md b/docs/journal.md index 9aee5bb0e5..a8d070ae34 100644 --- a/docs/journal.md +++ b/docs/journal.md @@ -16,6 +16,25 @@ pageClass: routes +## Academy of Management + +### Journal + + + +| Id | 名称 | +| --------- | ------------------------------------------ | +| annals | Academy of Management Annals | +| amd | Academy of Management Discoveries | +| amgblproc | Academy of Management Global Proceedings | +| amj | Academy of Management Journal | +| amle | Academy of Management Learning & Education | +| amp | Academy of Management Perspectives | +| amproc | Academy of Management Proceedings | +| amr | Academy of Management Review | + + + ## Cell ### 主刊 @@ -123,7 +142,7 @@ pageClass: routes ### 最新文章(可筛选领域) - + - 通过 `/pnas/` + “领域名称” 来获取对应 “领域” 的最新文章(Latest Research)。 若参数置空(`/pnas`)或为 latest(`/pnas/latest`),则默认获取全部文章。 diff --git a/lib/router.js b/lib/router.js index d2b1461966..e2ee2c7e5b 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3260,6 +3260,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index')); // CGTN router.get('/cgtn/top', require('./routes/cgtn/top')); +// Academy of Management +router.get('/aom/journal/:id', require('./routes/aom/journal')); + // 巴哈姆特電玩資訊站 router.get('/gamer/hot/:bsn', require('./routes/gamer/hot')); diff --git a/lib/routes/aom/journal.js b/lib/routes/aom/journal.js new file mode 100644 index 0000000000..2ba5a6e077 --- /dev/null +++ b/lib/routes/aom/journal.js @@ -0,0 +1,108 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +const rootUrl = 'https://journals.aom.org'; + +const config = { + annals: { + title: 'Academy of Management Annals', + link: `${rootUrl}/journal/annals`, + }, + amd: { + title: 'Academy of Management Discoveries', + link: `${rootUrl}/journal/amd`, + }, + amgblproc: { + title: 'Academy of Management Global Proceedings', + link: `${rootUrl}/toc/amgblproc/current`, + }, + amj: { + title: 'Academy of Management Journal', + link: `${rootUrl}/journal/amj`, + }, + amle: { + title: 'Academy of Management Learning & Education', + link: `${rootUrl}/journal/amle`, + }, + amp: { + title: 'Academy of Management Perspectives', + link: `${rootUrl}/journal/amp`, + }, + amproc: { + title: 'Academy of Management Proceedings', + link: `${rootUrl}/toc/amproc/current`, + }, + amr: { + title: 'Academy of Management Review', + link: `${rootUrl}/toc/amr/0`, + }, +}; + +module.exports = async (ctx) => { + const cfg = config[ctx.params.id]; + if (!cfg) { + throw Error('Bad id. See docs'); + } + + const currentUrl = cfg.link; + + const firstResponse = await got({ + method: 'get', + url: rootUrl, + }); + + const headers = { + cookie: `JSESSIONID=${firstResponse.headers['set-cookie'].join(' ').match(/JSESSIONID=(\S+);/)[1]}`, + }; + + const response = await got({ + method: 'get', + url: currentUrl, + headers, + }); + const $ = cheerio.load(response.data); + + $('div[data-widget-def="topContentActionWidget"]').eq(2).remove(); + $('div[data-widget-def="topContentActionWidget"]').eq(1).remove(); + + const list = $('h5') + .not('.border-top') + .map((_, item) => { + item = $(item); + const a = item.parent().get(0).tagName === 'a' ? item.parent() : item.find('a'); + return { + title: a.attr('title'), + link: `${rootUrl}${a.attr('href')}`, + }; + }) + .get(); + + const items = await Promise.all( + list.map( + async (item) => + await ctx.cache.tryGet(item.link, async () => { + const detailResponse = await got({ + method: 'get', + url: item.link, + headers, + }); + const content = cheerio.load(detailResponse.data); + + content('.author-info').remove(); + + item.author = content('.loa-accordion').text(); + item.doi = content('meta[name="dc.Identifier"]').attr('content'); + item.description = content('.abstractInFull').html(); + item.pubDate = new Date(content('meta[name="dc.Date"]').attr('content')).toUTCString(); + + return item; + }) + ) + ); + + ctx.state.data = { + title: cfg.title, + link: currentUrl, + item: items, + }; +}; From ede67825b00d72ac13b9939e9f8f9f6b41c402fe Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 9 Oct 2020 20:47:07 +0000 Subject: [PATCH 17/40] style: auto format --- docs/en/journal.md | 24 ++++++++++++------------ docs/journal.md | 24 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/en/journal.md b/docs/en/journal.md index 16ea6b799c..a4027b1c87 100644 --- a/docs/en/journal.md +++ b/docs/en/journal.md @@ -4,18 +4,6 @@ pageClass: routes # Scientific Journal -## arXiv - -### Search Keyword - - - -See [arXiv API User Manual](https://arxiv.org/help/api/user-manual) to find out all query statements. - -Fill in parameter `query` with content after `http://export.arxiv.org/api/query?`. - - - ## Academy of Management ### Journal @@ -35,6 +23,18 @@ Fill in parameter `query` with content after `http://export.arxiv.org/api/query? +## arXiv + +### Search Keyword + + + +See [arXiv API User Manual](https://arxiv.org/help/api/user-manual) to find out all query statements. + +Fill in parameter `query` with content after `http://export.arxiv.org/api/query?`. + + + ## Cell Journal diff --git a/docs/journal.md b/docs/journal.md index a8d070ae34..e6afbbc349 100644 --- a/docs/journal.md +++ b/docs/journal.md @@ -4,18 +4,6 @@ pageClass: routes # 科学期刊 -## arXiv - -### 搜索关键字 - - - -参见 [arXiv API 用户手册](https://arxiv.org/help/api/user-manual) 查看所有查询参数。 - -路由中的参数 query 处填写 `http://export.arxiv.org/api/query?` 后的内容。 - - - ## Academy of Management ### Journal @@ -35,6 +23,18 @@ pageClass: routes +## arXiv + +### 搜索关键字 + + + +参见 [arXiv API 用户手册](https://arxiv.org/help/api/user-manual) 查看所有查询参数。 + +路由中的参数 query 处填写 `http://export.arxiv.org/api/query?` 后的内容。 + + + ## Cell ### 主刊 From 19a219e0762d9cbcb15bdd7cbc6969a270a87f66 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 9 Oct 2020 21:53:53 +0100 Subject: [PATCH 18/40] feat: add a default pubDate close #5812 --- lib/middleware/template.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/middleware/template.js b/lib/middleware/template.js index 01568c2a3f..69ae580e7d 100644 --- a/lib/middleware/template.js +++ b/lib/middleware/template.js @@ -44,6 +44,10 @@ module.exports = async (ctx, next) => { } } + if (!item.pubDate) { + item.pubDate = new Date().toISOString(); + } + if (item.enclosure_length) { const itunes_duration = Math.floor(item.enclosure_length / 3600) + ':' + (Math.floor((item.enclosure_length % 3600) / 60) / 100).toFixed(2).slice(-2) + ':' + (((item.enclosure_length % 3600) % 60) / 100).toFixed(2).slice(-2); From c6562336879aa3c53d43b97bb3727883c4ce498d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2020 20:57:21 +0000 Subject: [PATCH 19/40] chore(deps-dev): bump remark-frontmatter from 2.0.0 to 3.0.0 Bumps [remark-frontmatter](https://github.com/remarkjs/remark-frontmatter) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/remarkjs/remark-frontmatter/releases) - [Commits](https://github.com/remarkjs/remark-frontmatter/compare/2.0.0...3.0.0) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ccb1a0f8ac..c150500559 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "prettier-check": "2.0.0", "pretty-quick": "3.0.2", "remark": "12.0.1", - "remark-frontmatter": "2.0.0", + "remark-frontmatter": "3.0.0", "remark-pangu": "2.1.1", "remark-preset-prettier": "0.4.0", "staged-git-files": "1.2.0", diff --git a/yarn.lock b/yarn.lock index 005d422ca4..ca43e08857 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5290,7 +5290,7 @@ fast-text-encoding@^1.0.0: resolved "https://registry.yarnpkg.com/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz#3e5ce8293409cfaa7177a71b9ca84e1b1e6f25ef" integrity sha512-R9bHCvweUxxwkDwhjav5vxpFvdPGlVngtqmx4pIZfSUhM/Q4NiIUHB456BAf+Q1Nwu3HEZYONtu+Rya+af4jiQ== -fault@^1.0.1: +fault@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/fault/-/fault-1.0.4.tgz#eafcfc0a6d214fc94601e170df29954a4f842f13" integrity sha512-CJ0HCB5tL5fYTEA7ToAq5+kTwd++Borf1/bifxd9iT70QcXr4MRrO3Llf8Ifs70q+SJcGHFtnIE/Nw6giCtECA== @@ -8222,6 +8222,13 @@ mdast-util-compact@^2.0.0: dependencies: unist-util-visit "^2.0.0" +mdast-util-frontmatter@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/mdast-util-frontmatter/-/mdast-util-frontmatter-0.2.0.tgz#8bd5cd55e236c03e204a036f7372ebe9e6748240" + integrity sha512-FHKL4w4S5fdt1KjJCwB0178WJ0evnyyQr5kXTM3wrOVpytD0hrkvd+AOOjU9Td8onOejCkmZ+HQRT3CZ3coHHQ== + dependencies: + micromark-extension-frontmatter "^0.2.0" + mdn-data@~1.1.0: version "1.1.4" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" @@ -8281,6 +8288,13 @@ methods@1.1.2, methods@^1.1.2, methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= +micromark-extension-frontmatter@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/micromark-extension-frontmatter/-/micromark-extension-frontmatter-0.2.2.tgz#61b8e92e9213e1d3c13f5a59e7862f5ca98dfa53" + integrity sha512-q6nPLFCMTLtfsctAuS0Xh4vaolxSFUWUWR6PZSrXXiRy+SANGllpcqdXFv2z07l0Xz/6Hl40hK0ffNCJPH2n1A== + dependencies: + fault "^1.0.0" + micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -10443,12 +10457,13 @@ relateurl@0.2.x: resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= -remark-frontmatter@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/remark-frontmatter/-/remark-frontmatter-2.0.0.tgz#c9b8539c27cd23b1672c7e0fcbd5795eeedb4dc1" - integrity sha512-uNOQt4tO14qBFWXenF0MLC4cqo3dv8qiHPGyjCl1rwOT0LomSHpcElbjjVh5CwzElInB38HD8aSRVugKQjeyHA== +remark-frontmatter@3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/remark-frontmatter/-/remark-frontmatter-3.0.0.tgz#ca5d996361765c859bd944505f377d6b186a6ec6" + integrity sha512-mSuDd3svCHs+2PyO29h7iijIZx4plX0fheacJcAoYAASfgzgVIcXGYSq9GFyYocFLftQs8IOmmkgtOovs6d4oA== dependencies: - fault "^1.0.1" + mdast-util-frontmatter "^0.2.0" + micromark-extension-frontmatter "^0.2.0" remark-pangu@2.1.1: version "2.1.1" From 090123dad883157f32e13048194d69b19f4a694e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 9 Oct 2020 21:07:45 +0000 Subject: [PATCH 20/40] chore(deps): bump query-string from 6.13.4 to 6.13.5 Bumps [query-string](https://github.com/sindresorhus/query-string) from 6.13.4 to 6.13.5. - [Release notes](https://github.com/sindresorhus/query-string/releases) - [Commits](https://github.com/sindresorhus/query-string/compare/v6.13.4...v6.13.5) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ccb1a0f8ac..18950a63ee 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "pidusage": "2.0.21", "plist": "3.0.1", "puppeteer": "5.3.1", - "query-string": "6.13.4", + "query-string": "6.13.5", "redis": "3.0.2", "require-all": "3.0.0", "rss-parser": "3.9.0", diff --git a/yarn.lock b/yarn.lock index 005d422ca4..05e66a45e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10157,10 +10157,10 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -query-string@6.13.4, query-string@^6.2.0: - version "6.13.4" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.4.tgz#b35a9a3bd4955bce55f94feb0e819b3d0be6f66f" - integrity sha512-E2NPIeJoBEJGQNy3ib1k/Z/OkDBUKIo8IV2ZVwbKfoa65IS9unqWWUlLcbfU70Da0qNoxUZZA8CfKUjKLE641Q== +query-string@6.13.5, query-string@^6.2.0: + version "6.13.5" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.5.tgz#99e95e2fb7021db90a6f373f990c0c814b3812d8" + integrity sha512-svk3xg9qHR39P3JlHuD7g3nRnyay5mHbrPctEBDUxUkHRifPHXJDhBUycdCC0NBjXoDf44Gb+IsOZL1Uwn8M/Q== dependencies: decode-uri-component "^0.2.0" split-on-first "^1.0.0" From 82ca7b448a8c0c06d0ed20a68895a30f80751b73 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 9 Oct 2020 21:09:21 +0000 Subject: [PATCH 21/40] style: auto format --- docs/README.md | 6 +++--- docs/anime.md | 6 +++--- docs/bbs.md | 6 +++--- docs/blog.md | 6 +++--- docs/design.md | 6 +++--- docs/finance.md | 6 +++--- docs/forecast.md | 6 +++--- docs/game.md | 6 +++--- docs/government.md | 6 +++--- docs/install/README.md | 6 +++--- docs/joinus/README.md | 6 +++--- docs/journal.md | 6 +++--- docs/live.md | 6 +++--- docs/multimedia.md | 6 +++--- docs/new-media.md | 6 +++--- docs/other.md | 6 +++--- docs/picture.md | 6 +++--- docs/program-update.md | 6 +++--- docs/programming.md | 6 +++--- docs/reading.md | 6 +++--- docs/shopping.md | 6 +++--- docs/social-media.md | 6 +++--- docs/study.md | 6 +++--- docs/support/README.md | 6 +++--- docs/traditional-media.md | 6 +++--- docs/travel.md | 6 +++--- docs/university.md | 6 +++--- 27 files changed, 81 insertions(+), 81 deletions(-) diff --git a/docs/README.md b/docs/README.md index fc1ae2b226..d933e885e8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ ---- -sidebarDepth: 0 ---- +* * * + +## sidebarDepth: 0 # 介绍 diff --git a/docs/anime.md b/docs/anime.md index 4398ddcfcb..be6e6db1ee 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 二次元 diff --git a/docs/bbs.md b/docs/bbs.md index ea5e48ad09..4abf000c07 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 论坛 diff --git a/docs/blog.md b/docs/blog.md index b804287ac0..b645ffb13d 100644 --- a/docs/blog.md +++ b/docs/blog.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 博客 diff --git a/docs/design.md b/docs/design.md index 6e49e3637d..1c93b993bf 100644 --- a/docs/design.md +++ b/docs/design.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 设计 diff --git a/docs/finance.md b/docs/finance.md index 49653029eb..1cbd45f6dd 100644 --- a/docs/finance.md +++ b/docs/finance.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 金融 diff --git a/docs/forecast.md b/docs/forecast.md index 684fb280a9..5b8be7723d 100644 --- a/docs/forecast.md +++ b/docs/forecast.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 预报预警 diff --git a/docs/game.md b/docs/game.md index 6db10bcbce..0a8c719d98 100644 --- a/docs/game.md +++ b/docs/game.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 游戏 diff --git a/docs/government.md b/docs/government.md index 39315111bd..6a46ab5644 100644 --- a/docs/government.md +++ b/docs/government.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 政务消息 diff --git a/docs/install/README.md b/docs/install/README.md index 0adcbab068..0466aed0a5 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -1,6 +1,6 @@ ---- -sidebar: auto ---- +* * * + +## sidebar: auto # 部署 diff --git a/docs/joinus/README.md b/docs/joinus/README.md index 9851b5752b..1b0d368f26 100644 --- a/docs/joinus/README.md +++ b/docs/joinus/README.md @@ -1,6 +1,6 @@ ---- -sidebar: auto ---- +* * * + +## sidebar: auto # 参与我们 diff --git a/docs/journal.md b/docs/journal.md index e6afbbc349..5d8707c612 100644 --- a/docs/journal.md +++ b/docs/journal.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 科学期刊 diff --git a/docs/live.md b/docs/live.md index 137deefb7d..c1850f591e 100644 --- a/docs/live.md +++ b/docs/live.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 直播 diff --git a/docs/multimedia.md b/docs/multimedia.md index f2d128e227..10c67361a4 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 音视频 diff --git a/docs/new-media.md b/docs/new-media.md index 28629a097c..606391ca67 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 新媒体 diff --git a/docs/other.md b/docs/other.md index 2eace247d8..e8e954657e 100644 --- a/docs/other.md +++ b/docs/other.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 其他 diff --git a/docs/picture.md b/docs/picture.md index 193edec984..ae5f92f3f5 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 图片 diff --git a/docs/program-update.md b/docs/program-update.md index 1fef997e80..a32c59a3ec 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 程序更新 diff --git a/docs/programming.md b/docs/programming.md index 05fcd403af..6fa07ee459 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 编程 diff --git a/docs/reading.md b/docs/reading.md index 8224cb60ff..8c735a9dd9 100644 --- a/docs/reading.md +++ b/docs/reading.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 阅读 diff --git a/docs/shopping.md b/docs/shopping.md index c30c555921..5640a4e825 100644 --- a/docs/shopping.md +++ b/docs/shopping.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 购物 diff --git a/docs/social-media.md b/docs/social-media.md index 298c4fa69b..475440fa12 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 社交媒体 diff --git a/docs/study.md b/docs/study.md index e0d445527a..9b2baf1145 100644 --- a/docs/study.md +++ b/docs/study.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 学习 diff --git a/docs/support/README.md b/docs/support/README.md index b36237ebfd..03fd491652 100644 --- a/docs/support/README.md +++ b/docs/support/README.md @@ -1,6 +1,6 @@ ---- -sidebar: auto ---- +* * * + +## sidebar: auto # 支持 RSSHub diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 67dfe4faa6..59184b659c 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 传统媒体 diff --git a/docs/travel.md b/docs/travel.md index 1fe24de187..a4b3696497 100644 --- a/docs/travel.md +++ b/docs/travel.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 出行旅游 diff --git a/docs/university.md b/docs/university.md index 265cc69f8f..fee0a20860 100644 --- a/docs/university.md +++ b/docs/university.md @@ -1,6 +1,6 @@ ---- -pageClass: routes ---- +* * * + +## pageClass: routes # 大学通知 From c7934464f2669e09c17f36cac1947885c758c94f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 9 Oct 2020 21:21:46 +0000 Subject: [PATCH 22/40] style: auto format --- docs/anime.md | 8 ++++---- docs/bbs.md | 8 ++++---- docs/blog.md | 8 ++++---- docs/design.md | 8 ++++---- docs/finance.md | 8 ++++---- docs/forecast.md | 8 ++++---- docs/game.md | 8 ++++---- docs/journal.md | 8 ++++---- docs/multimedia.md | 8 ++++---- docs/new-media.md | 8 ++++---- docs/other.md | 8 ++++---- docs/picture.md | 8 ++++---- docs/program-update.md | 8 ++++---- docs/programming.md | 8 ++++---- docs/reading.md | 8 ++++---- docs/shopping.md | 8 ++++---- docs/social-media.md | 8 ++++---- docs/study.md | 8 ++++---- docs/traditional-media.md | 8 ++++---- docs/travel.md | 8 ++++---- docs/university.md | 8 ++++---- 21 files changed, 84 insertions(+), 84 deletions(-) diff --git a/docs/anime.md b/docs/anime.md index be6e6db1ee..ee31db8448 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 二次元 - ## 005.tv ### 二次元资讯 @@ -176,6 +172,10 @@ +## pageClass: routes + +# 二次元 + ## say 花火 ### 文章 diff --git a/docs/bbs.md b/docs/bbs.md index 4abf000c07..817c384660 100644 --- a/docs/bbs.md +++ b/docs/bbs.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 论坛 - ## A 岛匿名版 ### 串 @@ -118,6 +114,10 @@ +## pageClass: routes + +# 论坛 + ## Quicker ### 讨论区 diff --git a/docs/blog.md b/docs/blog.md index b645ffb13d..eb893abc9d 100644 --- a/docs/blog.md +++ b/docs/blog.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 博客 - ## archdaily ### 首页 @@ -64,6 +60,10 @@ +## pageClass: routes + +# 博客 + ## Paul Graham 博客 通过提取文章全文,提供比官方源更佳的阅读体验。 diff --git a/docs/design.md b/docs/design.md index 1c93b993bf..e628f8b73a 100644 --- a/docs/design.md +++ b/docs/design.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 设计 - ## Axis Studios ### Work type @@ -106,6 +102,10 @@ Behance 用户主页 URL 获取用户名,如 +## pageClass: routes + +# 设计 + ## UI 中国 ### 推荐文章 diff --git a/docs/finance.md b/docs/finance.md index 1cbd45f6dd..83834d722a 100644 --- a/docs/finance.md +++ b/docs/finance.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 金融 - ## CFD ### 每周股指派息调整 (GBP) @@ -16,6 +12,10 @@ +## pageClass: routes + +# 金融 + ## WEEX 华尔街见闻旗下全球投资线上品牌 ### 资讯 diff --git a/docs/forecast.md b/docs/forecast.md index 5b8be7723d..6207ac3c7a 100644 --- a/docs/forecast.md +++ b/docs/forecast.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 预报预警 - ## Outage.Report ### Report @@ -14,6 +10,10 @@ +## pageClass: routes + +# 预报预警 + ## 地震速报 ### 中国地震局 diff --git a/docs/game.md b/docs/game.md index 0a8c719d98..4831494c90 100644 --- a/docs/game.md +++ b/docs/game.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 游戏 - ## 3DMGame ### 新闻中心 @@ -134,6 +130,10 @@ +## pageClass: routes + +# 游戏 + ## PlayStation ### PlayStation Store 游戏列表 diff --git a/docs/journal.md b/docs/journal.md index 5d8707c612..297c9f478e 100644 --- a/docs/journal.md +++ b/docs/journal.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 科学期刊 - ## Academy of Management ### Journal @@ -138,6 +134,10 @@ +## pageClass: routes + +# 科学期刊 + ## PNAS ### 最新文章(可筛选领域) diff --git a/docs/multimedia.md b/docs/multimedia.md index 10c67361a4..9e1054002c 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 音视频 - ## 2048 核基地 ### 论坛更新 @@ -379,6 +375,10 @@ +## pageClass: routes + +# 音视频 + ## PornHub ### 分类 diff --git a/docs/new-media.md b/docs/new-media.md index 606391ca67..e78aefadb6 100644 --- a/docs/new-media.md +++ b/docs/new-media.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 新媒体 - ## 199IT ### 首页更新 @@ -322,6 +318,10 @@ Tag +## pageClass: routes + +# 新媒体 + ## PMCAFF ### 今日推荐 / 精选 diff --git a/docs/other.md b/docs/other.md index e8e954657e..8a85d40d66 100644 --- a/docs/other.md +++ b/docs/other.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 其他 - ## acwifi 路由器交流 ### 新闻 @@ -157,6 +153,10 @@ +## pageClass: routes + +# 其他 + ## Parcel Tracking ### Hermes UK diff --git a/docs/picture.md b/docs/picture.md index ae5f92f3f5..275cdd69fc 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 图片 - ## 1X ### Photos @@ -174,6 +170,10 @@ +## pageClass: routes + +# 图片 + ## Porn Image XXX ### 最新图片 diff --git a/docs/program-update.md b/docs/program-update.md index a32c59a3ec..6f8464db00 100644 --- a/docs/program-update.md +++ b/docs/program-update.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 程序更新 - ## AMD ### 显卡驱动更新 @@ -196,6 +192,10 @@ +## pageClass: routes + +# 程序更新 + ## PlayStation ### PlayStation 4 系统更新纪录 diff --git a/docs/programming.md b/docs/programming.md index 6fa07ee459..e0e64a7415 100644 --- a/docs/programming.md +++ b/docs/programming.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 编程 - ## AI 研习社 ### 首页 @@ -296,6 +292,10 @@ GitHub 官方也提供了一些 RSS: +## pageClass: routes + +# 编程 + ## project-zero issues ### issues diff --git a/docs/reading.md b/docs/reading.md index 8c735a9dd9..fe14b83f63 100644 --- a/docs/reading.md +++ b/docs/reading.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 阅读 - ## All Poetry ### Poems @@ -16,6 +12,10 @@ +## pageClass: routes + +# 阅读 + ## UU 看书 ### 小说更新 diff --git a/docs/shopping.md b/docs/shopping.md index 5640a4e825..f07f3f1e88 100644 --- a/docs/shopping.md +++ b/docs/shopping.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 购物 - ## Alter 中国 ### 新闻 @@ -80,6 +76,10 @@ For instance, in +## pageClass: routes + +# 购物 + ## Westore ### 新品 diff --git a/docs/social-media.md b/docs/social-media.md index 475440fa12..541ef9b824 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 社交媒体 - ## 755 ### 用户时间线 @@ -355,6 +351,10 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性 +## pageClass: routes + +# 社交媒体 + ## piapro ### 用户最新作品 diff --git a/docs/study.md b/docs/study.md index 9b2baf1145..291ea7e5a7 100644 --- a/docs/study.md +++ b/docs/study.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 学习 - ## 51VOA 美国之音 ### 频道 @@ -102,6 +98,10 @@ | wsk | 全国外语水平考试 (WSK) | | mets | 医护英语水平考试 (METS) | +## pageClass: routes + +# 学习 + ## X-MOL 平台 ### 新闻 diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 59184b659c..13544b8e08 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 传统媒体 - ## 21 财经 ### 频道 @@ -125,6 +121,10 @@ +## pageClass: routes + +# 传统媒体 + ## Solidot ### 最新消息 diff --git a/docs/travel.md b/docs/travel.md index a4b3696497..8fbd651a88 100644 --- a/docs/travel.md +++ b/docs/travel.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 出行旅游 - ## 12306 ### 最新动态 @@ -51,6 +47,10 @@ IATA 国际航空运输协会机场代码,参见[维基百科 国际航空运 +## pageClass: routes + +# 出行旅游 + ## 飞客茶馆 ### 优惠信息 diff --git a/docs/university.md b/docs/university.md index fee0a20860..7e43290d4a 100644 --- a/docs/university.md +++ b/docs/university.md @@ -1,9 +1,5 @@ * * * -## pageClass: routes - -# 大学通知 - ## MIT ### MIT graduateadmissions's all blogs @@ -18,6 +14,10 @@ +## pageClass: routes + +# 大学通知 + ## Polimi ### News From c83aa45ec0fc14ce97143134c45bbc9d5b21d951 Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Fri, 9 Oct 2020 23:11:39 +0100 Subject: [PATCH 23/40] =?UTF-8?q?fix:=20BBC=20=E4=B8=AD=E6=96=87=E7=BD=91?= =?UTF-8?q?=E5=9B=BE=E7=89=87=20(#5837)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #5780 --- lib/routes/bbc/utils.js | 42 ++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/lib/routes/bbc/utils.js b/lib/routes/bbc/utils.js index 8b3122d7d7..8d472fc73c 100644 --- a/lib/routes/bbc/utils.js +++ b/lib/routes/bbc/utils.js @@ -1,26 +1,34 @@ -const ProcessImage = ($, e, c) => { +const cheerio = require('cheerio'); +const ProcessImage = ($, e, c, noscript = false) => { const img = $(e).find(c); if (img.length > 0) { let message; + // special handling for img wrapped in