From 1f59667cb0a5869dc97b77f9299151fdf2e3dd64 Mon Sep 17 00:00:00 2001 From: Ray Wong Date: Tue, 5 Mar 2019 12:06:44 +0800 Subject: [PATCH 01/43] fix failed route: universities/hust/ rel: issues/1680 1. fix /hust/auto/notice/:type? & /hust/auto/new 2. add /hust/aia/notice/:type? & /hust/aia/new --- docs/README.md | 4 +-- lib/router.js | 2 ++ lib/routes/universities/hust/aia/news.js | 34 ++++++++++++++++++ lib/routes/universities/hust/aia/notice.js | 39 +++++++++++++++++++++ lib/routes/universities/hust/auto/news.js | 8 ++--- lib/routes/universities/hust/auto/notice.js | 8 ++--- 6 files changed, 85 insertions(+), 10 deletions(-) mode change 100644 => 100755 docs/README.md mode change 100644 => 100755 lib/router.js create mode 100755 lib/routes/universities/hust/aia/news.js create mode 100755 lib/routes/universities/hust/aia/notice.js mode change 100644 => 100755 lib/routes/universities/hust/auto/news.js mode change 100644 => 100755 lib/routes/universities/hust/auto/notice.js diff --git a/docs/README.md b/docs/README.md old mode 100644 new mode 100755 index dd52ebc7c4be1c..5011050ef2159f --- a/docs/README.md +++ b/docs/README.md @@ -1827,7 +1827,7 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet ### 华中科技大学 - + | 最新 | 行政 | 人事 | 科研 | 讲座 | 本科生 | 研究生 | 学工 | | ---- | ---- | ---- | ---- | ---- | ------ | ------ | ---- | @@ -1835,7 +1835,7 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet - + ### 山东大学 diff --git a/lib/router.js b/lib/router.js old mode 100644 new mode 100755 index 9e5ffb8cb6cf0b..f0a9ffdf349705 --- a/lib/router.js +++ b/lib/router.js @@ -667,6 +667,8 @@ router.get('/kmust/job/jobfairs', require('./routes/universities/kmust/job/jobfa // 华中科技大学 router.get('/hust/auto/notice/:type?', require('./routes/universities/hust/auto/notice')); router.get('/hust/auto/news/', require('./routes/universities/hust/auto/news')); +router.get('/hust/aia/news/', require('./routes/universities/hust/aia/news')); +router.get('/hust/aia/notice/:type?', require('./routes/universities/hust/aia/notice')); // 山东大学 router.get('/sdu/grad/academic', require('./routes/universities/sdu/grad/academic')); diff --git a/lib/routes/universities/hust/aia/news.js b/lib/routes/universities/hust/aia/news.js new file mode 100755 index 00000000000000..eaeaafa80219e8 --- /dev/null +++ b/lib/routes/universities/hust/aia/news.js @@ -0,0 +1,34 @@ +const axios = require('../../../../utils/axios'); +const cheerio = require('cheerio'); +const url = require('url').resolve; + +module.exports = async (ctx) => { + const link = 'http://aia.hust.edu.cn/yxxw.htm'; + const response = await axios.get(link); + const $ = cheerio.load(response.data); + const list = $('.N02_list li dl'); + + ctx.state.data = { + title: '华科人工智能和自动化学院新闻', + link: link, + description: '华科人工智能和自动化学院新闻', + item: + list && + list + .map((index, item) => { + item = $(item); + const day = item.find('.N02_list_Icon i').text(); + item.find('.N02_list_Icon') + .find('i') + .remove(); + const year_month = item.find('.N02_list_Icon').text(); + return { + title: item.find('h4 a').text(), + description: item.find('dd p').text() || '华科人工智能和自动化学院新闻', + pubDate: new Date(year_month + ' ' + day).toUTCString(), + link: url(link, item.find('h4 a').attr('href')), + }; + }) + .get(), + }; +}; diff --git a/lib/routes/universities/hust/aia/notice.js b/lib/routes/universities/hust/aia/notice.js new file mode 100755 index 00000000000000..dbdaef71da7cd8 --- /dev/null +++ b/lib/routes/universities/hust/aia/notice.js @@ -0,0 +1,39 @@ +const axios = require('../../../../utils/axios'); +const cheerio = require('cheerio'); +const url = require('url').resolve; + +const typelist = ['最新', '行政', '人事', '科研', '讲座', '本科生', '研究生', '学工']; + +module.exports = async (ctx) => { + const type = parseInt(ctx.params.type) || 0; + const link = 'http://aia.hust.edu.cn/'; + const response = await axios.get(link); + const $ = cheerio.load(response.data); + const list = $('.m_content .m_con') + .eq(type) + .find('.N02_list_dl'); + + ctx.state.data = { + title: `华科人工智能和自动化学院${typelist[type]}通知`, + link: link, + description: `华科人工智能和自动化学院${typelist[type]}通知`, + item: + list && + list + .map((index, item) => { + item = $(item); + const day = item.find('.N02_list_Icon i').text(); + item.find('.N02_list_Icon') + .find('i') + .remove(); + const year_month = item.find('.N02_list_Icon').text(); + return { + title: item.find('h4 a').text(), + description: item.find('dd p').text() || `华科人工智能和自动化学院${typelist[type]}通知`, + pubDate: new Date(year_month + ' ' + day).toUTCString(), + link: url(link, item.find('h4 a').attr('href')), + }; + }) + .get(), + }; +}; diff --git a/lib/routes/universities/hust/auto/news.js b/lib/routes/universities/hust/auto/news.js old mode 100644 new mode 100755 index b243deaab7c9fc..eaeaafa80219e8 --- a/lib/routes/universities/hust/auto/news.js +++ b/lib/routes/universities/hust/auto/news.js @@ -3,15 +3,15 @@ const cheerio = require('cheerio'); const url = require('url').resolve; module.exports = async (ctx) => { - const link = 'http://auto.hust.edu.cn/yxxw.htm'; + const link = 'http://aia.hust.edu.cn/yxxw.htm'; const response = await axios.get(link); const $ = cheerio.load(response.data); const list = $('.N02_list li dl'); ctx.state.data = { - title: '华科自动化学院新闻', + title: '华科人工智能和自动化学院新闻', link: link, - description: '华科自动化学院新闻', + description: '华科人工智能和自动化学院新闻', item: list && list @@ -24,7 +24,7 @@ module.exports = async (ctx) => { const year_month = item.find('.N02_list_Icon').text(); return { title: item.find('h4 a').text(), - description: item.find('dd p').text() || '华科自动化学院新闻', + description: item.find('dd p').text() || '华科人工智能和自动化学院新闻', pubDate: new Date(year_month + ' ' + day).toUTCString(), link: url(link, item.find('h4 a').attr('href')), }; diff --git a/lib/routes/universities/hust/auto/notice.js b/lib/routes/universities/hust/auto/notice.js old mode 100644 new mode 100755 index f6ab93ab83b8e6..dbdaef71da7cd8 --- a/lib/routes/universities/hust/auto/notice.js +++ b/lib/routes/universities/hust/auto/notice.js @@ -6,7 +6,7 @@ const typelist = ['最新', '行政', '人事', '科研', '讲座', '本科生', module.exports = async (ctx) => { const type = parseInt(ctx.params.type) || 0; - const link = 'http://auto.hust.edu.cn/'; + const link = 'http://aia.hust.edu.cn/'; const response = await axios.get(link); const $ = cheerio.load(response.data); const list = $('.m_content .m_con') @@ -14,9 +14,9 @@ module.exports = async (ctx) => { .find('.N02_list_dl'); ctx.state.data = { - title: `华科自动化学院${typelist[type]}通知`, + title: `华科人工智能和自动化学院${typelist[type]}通知`, link: link, - description: `华科自动化学院${typelist[type]}通知`, + description: `华科人工智能和自动化学院${typelist[type]}通知`, item: list && list @@ -29,7 +29,7 @@ module.exports = async (ctx) => { const year_month = item.find('.N02_list_Icon').text(); return { title: item.find('h4 a').text(), - description: item.find('dd p').text() || `华科自动化学院${typelist[type]}通知`, + description: item.find('dd p').text() || `华科人工智能和自动化学院${typelist[type]}通知`, pubDate: new Date(year_month + ' ' + day).toUTCString(), link: url(link, item.find('h4 a').attr('href')), }; From 9adee55fe265918b24373087e55beb53699bb6bd Mon Sep 17 00:00:00 2001 From: Ray Wong Date: Tue, 5 Mar 2019 15:36:19 +0800 Subject: [PATCH 02/43] delete duplicate router --- lib/router.js | 4 +-- lib/routes/universities/hust/auto/news.js | 34 ------------------ lib/routes/universities/hust/auto/notice.js | 39 --------------------- 3 files changed, 2 insertions(+), 75 deletions(-) delete mode 100755 lib/routes/universities/hust/auto/news.js delete mode 100755 lib/routes/universities/hust/auto/notice.js diff --git a/lib/router.js b/lib/router.js index f0a9ffdf349705..2839d1aedf64f1 100755 --- a/lib/router.js +++ b/lib/router.js @@ -665,8 +665,8 @@ router.get('/kmust/job/careers/:type?', require('./routes/universities/kmust/job router.get('/kmust/job/jobfairs', require('./routes/universities/kmust/job/jobfairs')); // 华中科技大学 -router.get('/hust/auto/notice/:type?', require('./routes/universities/hust/auto/notice')); -router.get('/hust/auto/news/', require('./routes/universities/hust/auto/news')); +router.get('/hust/auto/notice/:type?', require('./routes/universities/hust/aia/notice')); +router.get('/hust/auto/news/', require('./routes/universities/hust/aia/news')); router.get('/hust/aia/news/', require('./routes/universities/hust/aia/news')); router.get('/hust/aia/notice/:type?', require('./routes/universities/hust/aia/notice')); diff --git a/lib/routes/universities/hust/auto/news.js b/lib/routes/universities/hust/auto/news.js deleted file mode 100755 index eaeaafa80219e8..00000000000000 --- a/lib/routes/universities/hust/auto/news.js +++ /dev/null @@ -1,34 +0,0 @@ -const axios = require('../../../../utils/axios'); -const cheerio = require('cheerio'); -const url = require('url').resolve; - -module.exports = async (ctx) => { - const link = 'http://aia.hust.edu.cn/yxxw.htm'; - const response = await axios.get(link); - const $ = cheerio.load(response.data); - const list = $('.N02_list li dl'); - - ctx.state.data = { - title: '华科人工智能和自动化学院新闻', - link: link, - description: '华科人工智能和自动化学院新闻', - item: - list && - list - .map((index, item) => { - item = $(item); - const day = item.find('.N02_list_Icon i').text(); - item.find('.N02_list_Icon') - .find('i') - .remove(); - const year_month = item.find('.N02_list_Icon').text(); - return { - title: item.find('h4 a').text(), - description: item.find('dd p').text() || '华科人工智能和自动化学院新闻', - pubDate: new Date(year_month + ' ' + day).toUTCString(), - link: url(link, item.find('h4 a').attr('href')), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/universities/hust/auto/notice.js b/lib/routes/universities/hust/auto/notice.js deleted file mode 100755 index dbdaef71da7cd8..00000000000000 --- a/lib/routes/universities/hust/auto/notice.js +++ /dev/null @@ -1,39 +0,0 @@ -const axios = require('../../../../utils/axios'); -const cheerio = require('cheerio'); -const url = require('url').resolve; - -const typelist = ['最新', '行政', '人事', '科研', '讲座', '本科生', '研究生', '学工']; - -module.exports = async (ctx) => { - const type = parseInt(ctx.params.type) || 0; - const link = 'http://aia.hust.edu.cn/'; - const response = await axios.get(link); - const $ = cheerio.load(response.data); - const list = $('.m_content .m_con') - .eq(type) - .find('.N02_list_dl'); - - ctx.state.data = { - title: `华科人工智能和自动化学院${typelist[type]}通知`, - link: link, - description: `华科人工智能和自动化学院${typelist[type]}通知`, - item: - list && - list - .map((index, item) => { - item = $(item); - const day = item.find('.N02_list_Icon i').text(); - item.find('.N02_list_Icon') - .find('i') - .remove(); - const year_month = item.find('.N02_list_Icon').text(); - return { - title: item.find('h4 a').text(), - description: item.find('dd p').text() || `华科人工智能和自动化学院${typelist[type]}通知`, - pubDate: new Date(year_month + ' ' + day).toUTCString(), - link: url(link, item.find('h4 a').attr('href')), - }; - }) - .get(), - }; -}; From 3d63f935b34e7c1911ff3f4833ddef2d47ccc366 Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Fri, 8 Mar 2019 03:06:27 +0000 Subject: [PATCH 03/43] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87?= =?UTF-8?q?=E6=A1=A3=20(#1700)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻车地点:@yuyang0 #1671 --- docs/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/README.md b/docs/README.md index 1454d5e94edbd7..d9eb17b9938ae9 100644 --- a/docs/README.md +++ b/docs/README.md @@ -616,6 +616,8 @@ RSSHub 提供下列 API 接口: | ------------ | ---- | -------- | | announcement | news | research | + + ### 龙腾网 From 6775a28011696bf57d29cd7b8a339127496882ac Mon Sep 17 00:00:00 2001 From: Carl Li Date: Fri, 8 Mar 2019 11:17:18 +0800 Subject: [PATCH 04/43] =?UTF-8?q?=E7=89=9B=E5=AE=A2=E7=BD=91=E5=85=A8?= =?UTF-8?q?=E6=96=87=E9=93=BE=E6=8E=A5=20=E7=A7=BB=E9=99=A4=E9=9A=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BD=8D=E7=BD=AE=E5=8F=98=E5=8C=96=E7=9A=84?= =?UTF-8?q?param=20(#1702)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修改牛客网帖子内容(description)解析方案 * 牛客网全文链接 删除随位置变化的param * fix pretty issue 3 --- lib/routes/nowcoder/discuss.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/routes/nowcoder/discuss.js b/lib/routes/nowcoder/discuss.js index ccb500dde13533..f3a6d4ef1eb0dc 100644 --- a/lib/routes/nowcoder/discuss.js +++ b/lib/routes/nowcoder/discuss.js @@ -26,7 +26,9 @@ module.exports = async (ctx) => { .replace('\n', ' '), link: $(this) .find('div.discuss-main.clearfix a') - .attr('href'), + .attr('href') + .match(/^\/discuss\/[0-9]*/gm) + .toString(), }; return info; }) From 66afb56c34ff02b270aebef10caa4ff91d918b58 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Fri, 8 Mar 2019 11:17:35 +0800 Subject: [PATCH 05/43] chore(deps): update dependency jest to v24.3.1 (#1703) --- package.json | 2 +- yarn.lock | 803 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 507 insertions(+), 298 deletions(-) diff --git a/package.json b/package.json index 9d5a8c53edd5b0..1c3ef6219c6f99 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "eslint": "5.15.1", "eslint-config-prettier": "4.1.0", "eslint-plugin-prettier": "3.0.1", - "jest": "24.1.0", + "jest": "24.3.1", "lint-staged": "8.1.5", "mockdate": "2.0.2", "nodemon": "1.18.10", diff --git a/yarn.lock b/yarn.lock index 5d3b3c52b2c770..95eff51c1af415 100644 --- a/yarn.lock +++ b/yarn.lock @@ -305,6 +305,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.1.tgz#8f4ffd45f779e6132780835ffa7a215fa0b2d181" integrity sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA== +"@babel/parser@^7.1.0": + version "7.3.4" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.4.tgz#a43357e4bbf4b92a437fb9e465c192848287f27c" + integrity sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ== + "@babel/plugin-proposal-async-generator-functions@7.0.0-beta.47": version "7.0.0-beta.47" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.0.0-beta.47.tgz#571142284708c5ad4ec904d9aa705461a010be53" @@ -859,6 +864,151 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@cnakazawa/watch@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" + integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@jest/console@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.3.0.tgz#7bd920d250988ba0bf1352c4493a48e1cb97671e" + integrity sha512-NaCty/OOei6rSDcbPdMiCbYCI0KGFGPgGO6B09lwWt5QTxnkuhKYET9El5u5z1GAcSxkQmSMtM63e24YabCWqA== + dependencies: + "@jest/source-map" "^24.3.0" + "@types/node" "*" + chalk "^2.0.1" + slash "^2.0.0" + +"@jest/core@^24.3.1": + version "24.3.1" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.3.1.tgz#9811596d9fcc6dbb3d4062c67e4c4867bc061585" + integrity sha512-orucOIBKfXgm1IJirtPT0ToprqDVGYKUNJKNc9a6v1Lww6qLPq+xj5OfxyhpJb2rWOgzEkATW1bfZzg3oqV70w== + dependencies: + "@jest/console" "^24.3.0" + "@jest/reporters" "^24.3.1" + "@jest/test-result" "^24.3.0" + "@jest/transform" "^24.3.1" + "@jest/types" "^24.3.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-changed-files "^24.3.0" + jest-config "^24.3.1" + jest-haste-map "^24.3.1" + jest-message-util "^24.3.0" + jest-regex-util "^24.3.0" + jest-resolve-dependencies "^24.3.1" + jest-runner "^24.3.1" + jest-runtime "^24.3.1" + jest-snapshot "^24.3.1" + jest-util "^24.3.0" + jest-validate "^24.3.1" + jest-watcher "^24.3.0" + micromatch "^3.1.10" + p-each-series "^1.0.0" + pirates "^4.0.1" + realpath-native "^1.1.0" + rimraf "^2.5.4" + strip-ansi "^5.0.0" + +"@jest/environment@^24.3.1": + version "24.3.1" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.3.1.tgz#1fbda3ec8fb8ffbaee665d314da91d662227e11e" + integrity sha512-M8bqEkQqPwZVhMMFMqqCnzqIZtuM5vDMfFQ9ZvnEfRT+2T1zTA4UAOH/V4HagEi6S3BCd/mdxFdYmPgXf7GKCA== + dependencies: + "@jest/fake-timers" "^24.3.0" + "@jest/transform" "^24.3.1" + "@jest/types" "^24.3.0" + "@types/node" "*" + jest-mock "^24.3.0" + +"@jest/fake-timers@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.3.0.tgz#0a7f8b877b78780c3fa5c3f8683cc0aaf9488331" + integrity sha512-rHwVI17dGMHxHzfAhnZ04+wFznjFfZ246QugeBnbiYr7/bDosPD2P1qeNjWnJUUcfl0HpS6kkr+OB/mqSJxQFg== + dependencies: + "@jest/types" "^24.3.0" + "@types/node" "*" + jest-message-util "^24.3.0" + jest-mock "^24.3.0" + +"@jest/reporters@^24.3.1": + version "24.3.1" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.3.1.tgz#68e4abc8d4233acd0dd87287f3bd270d81066248" + integrity sha512-jEIDJcvk20ReUW1Iqb+prlAcFV+kfFhQ/01poCq8X9As7/l/2y1GqVwJ3+6SaPTZuCXh0d0LVDy86zDAa8zlVA== + dependencies: + "@jest/environment" "^24.3.1" + "@jest/test-result" "^24.3.0" + "@jest/transform" "^24.3.1" + "@jest/types" "^24.3.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + istanbul-api "^2.1.1" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-source-maps "^3.0.1" + jest-haste-map "^24.3.1" + jest-resolve "^24.3.1" + jest-runtime "^24.3.1" + jest-util "^24.3.0" + jest-worker "^24.3.1" + node-notifier "^5.2.1" + slash "^2.0.0" + source-map "^0.6.0" + string-length "^2.0.0" + +"@jest/source-map@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" + integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.1.15" + source-map "^0.6.0" + +"@jest/test-result@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.3.0.tgz#4c0b1c9716212111920f7cf8c4329c69bc81924a" + integrity sha512-j7UZ49T8C4CVipEY99nLttnczVTtLyVzFfN20OiBVn7awOs0U3endXSTq7ouPrLR5y4YjI5GDcbcvDUjgeamzg== + dependencies: + "@jest/console" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/istanbul-lib-coverage" "^1.1.0" + +"@jest/transform@^24.3.1": + version "24.3.1" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.3.1.tgz#ce9e1329eb5e640f493bcd5c8eb9970770959bfc" + integrity sha512-PpjylI5goT4Si69+qUjEeHuKjex0LjjrqJzrMYzlOZn/+SCumGKuGC0UQFeEPThyGsFvWH1Q4gj0R66eOHnIpw== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^24.3.0" + babel-plugin-istanbul "^5.1.0" + chalk "^2.0.1" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.15" + jest-haste-map "^24.3.1" + jest-regex-util "^24.3.0" + jest-util "^24.3.0" + micromatch "^3.1.10" + realpath-native "^1.1.0" + slash "^2.0.0" + source-map "^0.6.1" + write-file-atomic "2.4.1" + +"@jest/types@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.3.0.tgz#3f6e117e47248a9a6b5f1357ec645bd364f7ad23" + integrity sha512-VoO1F5tU2n/93QN/zaZ7Q8SeV/Rj+9JJOgbvKbBwy4lenvmdj1iDaQEPXGTKrO6OSvDeb2drTFipZJYxgo6kIQ== + dependencies: + "@types/istanbul-lib-coverage" "^1.1.0" + "@types/yargs" "^12.0.9" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -897,11 +1047,59 @@ "@shellscape/koa-send" "^4.1.0" debug "^2.6.8" +"@types/babel__core@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51" + integrity sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.0.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" + integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/istanbul-lib-coverage@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#2cc2ca41051498382b43157c8227fea60363f94a" + integrity sha512-ohkhb9LehJy+PA40rDtGAji61NCgdtKLAlFoYp4cnuuQEswwdK3vz9SOIkkyc3wrk8dzjphQApNs56yyXLStaQ== + "@types/node@*": version "10.12.19" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.19.tgz#ca1018c26be01f07e66ac7fefbeb6407e4490c61" integrity sha512-2NVovndCjJQj6fUUn9jCgpP4WSqr+u1SoUZMZyJkhGeBFsm6dE46l31S7lPUYt9uQ28XI+ibrJA1f5XyH5HNtA== +"@types/stack-utils@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" + integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== + +"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": + version "12.0.9" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.9.tgz#693e76a52f61a2f1e7fb48c0eef167b95ea4ffd0" + integrity sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA== + "@vue/babel-preset-app@3.0.0-beta.11": version "3.0.0-beta.11" resolved "https://registry.yarnpkg.com/@vue/babel-preset-app/-/babel-preset-app-3.0.0-beta.11.tgz#c8b889aa73464050f9cd3f9dc621951d85c24508" @@ -1566,13 +1764,16 @@ babel-helper-vue-jsx-merge-props@^2.0.3: resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6" integrity sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg== -babel-jest@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.1.0.tgz#441e23ef75ded3bd547e300ac3194cef87b55190" - integrity sha512-MLcagnVrO9ybQGLEfZUqnOzv36iQzU7Bj4elm39vCukumLVSfoX+tRy3/jW7lUKc7XdpRmB/jech6L/UCsSZjw== +babel-jest@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.3.1.tgz#168468a37e90426520c5293da4f55e1a512063b0" + integrity sha512-6KaXyUevY0KAxD5Ba+EBhyfwvc+R2f7JV7BpBZ5T8yJGgj0M1hYDfRhDq35oD5MzprMf/ggT81nEuLtMyxfDIg== dependencies: + "@jest/transform" "^24.3.1" + "@jest/types" "^24.3.0" + "@types/babel__core" "^7.1.0" babel-plugin-istanbul "^5.1.0" - babel-preset-jest "^24.1.0" + babel-preset-jest "^24.3.0" chalk "^2.4.2" slash "^2.0.0" @@ -1602,10 +1803,12 @@ babel-plugin-istanbul@^5.1.0: istanbul-lib-instrument "^3.0.0" test-exclude "^5.0.0" -babel-plugin-jest-hoist@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.1.0.tgz#dfecc491fb15e2668abbd690a697a8fd1411a7f8" - integrity sha512-gljYrZz8w1b6fJzKcsfKsipSru2DU2DmQ39aB6nV3xQ0DDv3zpIzKGortA5gknrhNnPN8DweaEgrnZdmbGmhnw== +babel-plugin-jest-hoist@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.3.0.tgz#f2e82952946f6e40bb0a75d266a3790d854c8b5b" + integrity sha512-nWh4N1mVH55Tzhx2isvUN5ebM5CDUvIpXPZYMRazQughie/EqGnbR+czzoQlhUmJG9pPJmYDRhvocotb2THl1w== + dependencies: + "@types/babel__traverse" "^7.0.6" babel-plugin-syntax-dynamic-import@^6.18.0: version "6.18.0" @@ -1632,13 +1835,13 @@ babel-plugin-transform-vue-jsx@^4.0.1: dependencies: esutils "^2.0.2" -babel-preset-jest@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.1.0.tgz#83bc564fdcd4903641af65ec63f2f5de6b04132e" - integrity sha512-FfNLDxFWsNX9lUmtwY7NheGlANnagvxq8LZdl5PKnVG3umP+S/g0XbVBfwtA4Ai3Ri/IMkWabBz3Tyk9wdspcw== +babel-preset-jest@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.3.0.tgz#db88497e18869f15b24d9c0e547d8e0ab950796d" + integrity sha512-VGTV2QYBa/Kn3WCOKdfS31j9qomaXSgJqi65B6o05/1GsJyj9LVhSljM9ro4S+IBGj/ENhNBuH9bpqzztKAQSw== dependencies: "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^24.1.0" + babel-plugin-jest-hoist "^24.3.0" babel-runtime@^6.26.0: version "6.26.0" @@ -3065,10 +3268,10 @@ diagnostics@^1.1.1: enabled "1.0.x" kuler "1.0.x" -diff-sequences@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.0.0.tgz#cdf8e27ed20d8b8d3caccb4e0c0d8fe31a173013" - integrity sha512-46OkIuVGBBnrC0soO/4LHu5LHGHx0uhP65OVz8XOrAJpqiCB2aVIuESvjI1F9oqebuvY8lekS1pt6TN7vt7qsw== +diff-sequences@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" + integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== diffie-hellman@^5.0.0: version "5.0.3" @@ -3574,12 +3777,10 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" -exec-sh@^0.2.0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.2.tgz#2a5e7ffcbd7d0ba2755bdecb16e5a427dfbdec36" - integrity sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw== - dependencies: - merge "^1.2.0" +exec-sh@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" + integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== execa@^0.6.0: version "0.6.3" @@ -3670,16 +3871,17 @@ expand-template@^2.0.3: resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== -expect@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.1.0.tgz#88e73301c4c785cde5f16da130ab407bdaf8c0f2" - integrity sha512-lVcAPhaYkQcIyMS+F8RVwzbm1jro20IG8OkvxQ6f1JfqhVZyyudCwYogQ7wnktlf14iF3ii7ArIUO/mqvrW9Gw== +expect@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.3.1.tgz#7c42507da231a91a8099d065bc8dc9322dc85fc0" + integrity sha512-xnmobSlaqhg4FKqjb5REk4AobQzFMJoctDdREKfSGqrtzRfCWYbfqt3WmikAvQz/J8mCNQhORgYdEjPMJbMQPQ== dependencies: + "@jest/types" "^24.3.0" ansi-styles "^3.2.0" - jest-get-type "^24.0.0" - jest-matcher-utils "^24.0.0" - jest-message-util "^24.0.0" - jest-regex-util "^24.0.0" + jest-get-type "^24.3.0" + jest-matcher-utils "^24.3.1" + jest-message-util "^24.3.0" + jest-regex-util "^24.3.0" extend-shallow@^2.0.1: version "2.0.1" @@ -4073,7 +4275,7 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@^1.2.2, fsevents@^1.2.3, fsevents@^1.2.7: +fsevents@^1.2.2, fsevents@^1.2.7: version "1.2.7" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== @@ -4400,10 +4602,10 @@ gtoken@^2.3.2: mime "^2.2.0" pify "^4.0.0" -handlebars@^4.0.11: - version "4.0.12" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.12.tgz#2c15c8a96d46da5e266700518ba8cb8d919d5bc5" - integrity sha512-RhmTekP+FZL+XNhwS1Wf+bTTZpdLougwt5pcgA1tuz6Jcx0fpH/7z0qd71RKnZHBCxIRBHfBOnio4gViPemNzA== +handlebars@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.0.tgz#0d6a6f34ff1f63cecec8423aa4169827bf787c3a" + integrity sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w== dependencies: async "^2.5.0" optimist "^0.6.1" @@ -5227,10 +5429,10 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-api@^2.0.8: - version "2.1.0" - resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-2.1.0.tgz#37ab0c2c3e83065462f5254b94749d6157846c4e" - integrity sha512-+Ygg4t1StoiNlBGc6x0f8q/Bv26FbZqP/+jegzfNpU7Q8o+4ZRoJxJPhBkgE/UonpAjtxnE4zCZIyJX+MwLRMQ== +istanbul-api@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-2.1.1.tgz#194b773f6d9cbc99a9258446848b0f988951c4d0" + integrity sha512-kVmYrehiwyeBAk/wE71tW6emzLiHGjYIiDrc8sfyty4F8M02/lrgXSm+R1kXysmF20zArvmZXjlE/mg24TVPJw== dependencies: async "^2.6.1" compare-versions "^3.2.1" @@ -5240,7 +5442,7 @@ istanbul-api@^2.0.8: istanbul-lib-instrument "^3.1.0" istanbul-lib-report "^2.0.4" istanbul-lib-source-maps "^3.0.2" - istanbul-reports "^2.1.0" + istanbul-reports "^2.1.1" js-yaml "^3.12.0" make-dir "^1.3.0" minimatch "^3.0.4" @@ -5309,346 +5511,361 @@ istanbul-lib-source-maps@^3.0.1, istanbul-lib-source-maps@^3.0.2: rimraf "^2.6.2" source-map "^0.6.1" -istanbul-reports@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.1.0.tgz#87b8b55cd1901ba1748964c98ddd8900ce306d59" - integrity sha512-azQdSX+dtTtkQEfqq20ICxWi6eOHXyHIgMFw1VOOVi8iIPWeCWRgCyFh/CsBKIhcgskMI8ExXmU7rjXTRCIJ+A== +istanbul-reports@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.1.1.tgz#72ef16b4ecb9a4a7bd0e2001e00f95d1eec8afa9" + integrity sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw== dependencies: - handlebars "^4.0.11" + handlebars "^4.1.0" javascript-stringify@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-1.6.0.tgz#142d111f3a6e3dae8f4a9afd77d45855b5a9cce3" integrity sha1-FC0RHzpuPa6PSpr9d9RYVbWpzOM= -jest-changed-files@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.0.0.tgz#c02c09a8cc9ca93f513166bc773741bd39898ff7" - integrity sha512-nnuU510R9U+UX0WNb5XFEcsrMqriSiRLeO9KWDFgPrpToaQm60prfQYpxsXigdClpvNot5bekDY440x9dNGnsQ== +jest-changed-files@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.3.0.tgz#7050ae29aaf1d59437c80f21d5b3cd354e88a499" + integrity sha512-fTq0YAUR6644fgsqLC7Zi2gXA/bAplMRvfXQdutmkwgrCKK6upkj+sgXqsUfUZRm15CVr3YSojr/GRNn71IMvg== dependencies: + "@jest/types" "^24.3.0" execa "^1.0.0" throat "^4.0.0" -jest-cli@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.1.0.tgz#f7cc98995f36e7210cce3cbb12974cbf60940843" - integrity sha512-U/iyWPwOI0T1CIxVLtk/2uviOTJ/OiSWJSe8qt6X1VkbbgP+nrtLJlmT9lPBe4lK78VNFJtrJ7pttcNv/s7yCw== +jest-cli@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.3.1.tgz#52e4ae5f11044b41e06ca39fc7a7302fbbcb1661" + integrity sha512-HdwMgigvDQdlWX7gwM2QMkJJRqSk7tTYKq7kVplblK28RarqquJMWV/lOCN8CukuG9u3DZTeXpCDXR7kpGfB3w== dependencies: - ansi-escapes "^3.0.0" + "@jest/core" "^24.3.1" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" chalk "^2.0.1" exit "^0.1.2" - glob "^7.1.2" - graceful-fs "^4.1.15" import-local "^2.0.0" is-ci "^2.0.0" - istanbul-api "^2.0.8" - istanbul-lib-coverage "^2.0.2" - istanbul-lib-instrument "^3.0.1" - istanbul-lib-source-maps "^3.0.1" - jest-changed-files "^24.0.0" - jest-config "^24.1.0" - jest-environment-jsdom "^24.0.0" - jest-get-type "^24.0.0" - jest-haste-map "^24.0.0" - jest-message-util "^24.0.0" - jest-regex-util "^24.0.0" - jest-resolve-dependencies "^24.1.0" - jest-runner "^24.1.0" - jest-runtime "^24.1.0" - jest-snapshot "^24.1.0" - jest-util "^24.0.0" - jest-validate "^24.0.0" - jest-watcher "^24.0.0" - jest-worker "^24.0.0" - micromatch "^3.1.10" - node-notifier "^5.2.1" - p-each-series "^1.0.0" - pirates "^4.0.0" + jest-config "^24.3.1" + jest-util "^24.3.0" + jest-validate "^24.3.1" prompts "^2.0.1" - realpath-native "^1.0.0" - rimraf "^2.5.4" - slash "^2.0.0" - string-length "^2.0.0" - strip-ansi "^5.0.0" - which "^1.2.12" + realpath-native "^1.1.0" yargs "^12.0.2" -jest-config@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.1.0.tgz#6ea6881cfdd299bc86cc144ee36d937c97c3850c" - integrity sha512-FbbRzRqtFC6eGjG5VwsbW4E5dW3zqJKLWYiZWhB0/4E5fgsMw8GODLbGSrY5t17kKOtCWb/Z7nsIThRoDpuVyg== +jest-config@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.3.1.tgz#271aff2d3aeabf1ff92512024eeca3323cd31a07" + integrity sha512-ujHQywsM//vKFvJwEC02KNZgKAGOzGz1bFPezmTQtuj8XdfsAVq8p6N/dw4yodXV11gSf6TJ075i4ehM+mKatA== dependencies: "@babel/core" "^7.1.0" - babel-jest "^24.1.0" + "@jest/types" "^24.3.0" + babel-jest "^24.3.1" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^24.0.0" - jest-environment-node "^24.0.0" - jest-get-type "^24.0.0" - jest-jasmine2 "^24.1.0" - jest-regex-util "^24.0.0" - jest-resolve "^24.1.0" - jest-util "^24.0.0" - jest-validate "^24.0.0" + jest-environment-jsdom "^24.3.1" + jest-environment-node "^24.3.1" + jest-get-type "^24.3.0" + jest-jasmine2 "^24.3.1" + jest-regex-util "^24.3.0" + jest-resolve "^24.3.1" + jest-util "^24.3.0" + jest-validate "^24.3.1" micromatch "^3.1.10" - pretty-format "^24.0.0" - realpath-native "^1.0.2" + pretty-format "^24.3.1" + realpath-native "^1.1.0" -jest-diff@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.0.0.tgz#a3e5f573dbac482f7d9513ac9cfa21644d3d6b34" - integrity sha512-XY5wMpRaTsuMoU+1/B2zQSKQ9RdE9gsLkGydx3nvApeyPijLA8GtEvIcPwISRCer+VDf9W1mStTYYq6fPt8ryA== +jest-diff@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.3.1.tgz#87952e5ea1548567da91df398fa7bf7977d3f96a" + integrity sha512-YRVzDguyzShP3Pb9wP/ykBkV7Z+O4wltrMZ2P4LBtNxrHNpxwI2DECrpD9XevxWubRy5jcE8sSkxyX3bS7W+rA== dependencies: chalk "^2.0.1" - diff-sequences "^24.0.0" - jest-get-type "^24.0.0" - pretty-format "^24.0.0" + diff-sequences "^24.3.0" + jest-get-type "^24.3.0" + pretty-format "^24.3.1" -jest-docblock@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.0.0.tgz#54d77a188743e37f62181a91a01eb9222289f94e" - integrity sha512-KfAKZ4SN7CFOZpWg4i7g7MSlY0M+mq7K0aMqENaG2vHuhC9fc3vkpU/iNN9sOus7v3h3Y48uEjqz3+Gdn2iptA== +jest-docblock@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" + integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== dependencies: detect-newline "^2.1.0" -jest-each@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.0.0.tgz#10987a06b21c7ffbfb7706c89d24c52ed864be55" - integrity sha512-gFcbY4Cu55yxExXMkjrnLXov3bWO3dbPAW7HXb31h/DNWdNc/6X8MtxGff8nh3/MjkF9DpVqnj0KsPKuPK0cpA== +jest-each@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.3.1.tgz#ed8fe8b9f92a835a6625ca8c7ee06bc904440316" + integrity sha512-GTi+nxDaWwSgOPLiiqb/p4LURy0mv3usoqsA2eoTYSmRsLgjgZ6VUyRpUBH5JY9EMBx33suNFXk0iyUm29WRpw== dependencies: + "@jest/types" "^24.3.0" chalk "^2.0.1" - jest-get-type "^24.0.0" - jest-util "^24.0.0" - pretty-format "^24.0.0" - -jest-environment-jsdom@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.0.0.tgz#5affa0654d6e44cd798003daa1a8701dbd6e4d11" - integrity sha512-1YNp7xtxajTRaxbylDc2pWvFnfDTH5BJJGyVzyGAKNt/lEULohwEV9zFqTgG4bXRcq7xzdd+sGFws+LxThXXOw== - dependencies: - jest-mock "^24.0.0" - jest-util "^24.0.0" + jest-get-type "^24.3.0" + jest-util "^24.3.0" + pretty-format "^24.3.1" + +jest-environment-jsdom@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.3.1.tgz#49826bcf12fb3e38895f1e2aaeb52bde603cc2e4" + integrity sha512-rz2OSYJiQerDqWDwjisqRwhVNpwkqFXdtyMzEuJ47Ip9NRpRQ+qy7/+zFujPUy/Z+zjWRO5seHLB/dOD4VpEVg== + dependencies: + "@jest/environment" "^24.3.1" + "@jest/fake-timers" "^24.3.0" + "@jest/types" "^24.3.0" + jest-mock "^24.3.0" + jest-util "^24.3.0" jsdom "^11.5.1" -jest-environment-node@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.0.0.tgz#330948980656ed8773ce2e04eb597ed91e3c7190" - integrity sha512-62fOFcaEdU0VLaq8JL90TqwI7hLn0cOKOl8vY2n477vRkCJRojiRRtJVRzzCcgFvs6gqU97DNqX5R0BrBP6Rxg== +jest-environment-node@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.3.1.tgz#333d864c569b27658a96bb3b10e02e7172125415" + integrity sha512-Xy+/yFem/yUs9OkzbcawQT237vwDjBhAVLjac1KYAMYVjGb0Vb/Ovw4g61PunVdrEIpfcXNtRUltM4+9c7lARQ== dependencies: - jest-mock "^24.0.0" - jest-util "^24.0.0" + "@jest/environment" "^24.3.1" + "@jest/fake-timers" "^24.3.0" + "@jest/types" "^24.3.0" + jest-mock "^24.3.0" + jest-util "^24.3.0" -jest-get-type@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.0.0.tgz#36e72930b78e33da59a4f63d44d332188278940b" - integrity sha512-z6/Eyf6s9ZDGz7eOvl+fzpuJmN9i0KyTt1no37/dHu8galssxz5ZEgnc1KaV8R31q1khxyhB4ui/X5ZjjPk77w== +jest-get-type@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.3.0.tgz#582cfd1a4f91b5cdad1d43d2932f816d543c65da" + integrity sha512-HYF6pry72YUlVcvUx3sEpMRwXEWGEPlJ0bSPVnB3b3n++j4phUEoSPcS6GC0pPJ9rpyPSe4cb5muFo6D39cXow== -jest-haste-map@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.0.0.tgz#e9ef51b2c9257384b4d6beb83bd48c65b37b5e6e" - integrity sha512-CcViJyUo41IQqttLxXVdI41YErkzBKbE6cS6dRAploCeutePYfUimWd3C9rQEWhX0YBOQzvNsC0O9nYxK2nnxQ== +jest-haste-map@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.3.1.tgz#b4a66dbe1e6bc45afb9cd19c083bff81cdd535a1" + integrity sha512-OTMQle+astr1lWKi62Ccmk2YWn6OtUoU/8JpJdg8zdsnpFIry/k0S4sQ4nWocdM07PFdvqcthWc78CkCE6sXvA== dependencies: + "@jest/types" "^24.3.0" fb-watchman "^2.0.0" graceful-fs "^4.1.15" invariant "^2.2.4" - jest-serializer "^24.0.0" - jest-util "^24.0.0" - jest-worker "^24.0.0" + jest-serializer "^24.3.0" + jest-util "^24.3.0" + jest-worker "^24.3.1" micromatch "^3.1.10" - sane "^3.0.0" + sane "^4.0.3" -jest-jasmine2@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.1.0.tgz#8377324b967037c440f0a549ee0bbd9912055db6" - integrity sha512-H+o76SdSNyCh9fM5K8upK45YTo/DiFx5w2YAzblQebSQmukDcoVBVeXynyr7DDnxh+0NTHYRCLwJVf3tC518wg== +jest-jasmine2@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.3.1.tgz#127d628d3ac0829bd3c0fccacb87193e543b420b" + integrity sha512-STo6ar1IyPlIPq9jPxDQhM7lC0dAX7KKN0LmCLMlgJeXwX+1XiVdtZDv1a4zyg6qhNdpo1arOBGY0BcovUK7ug== dependencies: "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.3.1" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" chalk "^2.0.1" co "^4.6.0" - expect "^24.1.0" + expect "^24.3.1" is-generator-fn "^2.0.0" - jest-each "^24.0.0" - jest-matcher-utils "^24.0.0" - jest-message-util "^24.0.0" - jest-snapshot "^24.1.0" - jest-util "^24.0.0" - pretty-format "^24.0.0" + jest-each "^24.3.1" + jest-matcher-utils "^24.3.1" + jest-message-util "^24.3.0" + jest-runtime "^24.3.1" + jest-snapshot "^24.3.1" + jest-util "^24.3.0" + pretty-format "^24.3.1" throat "^4.0.0" -jest-leak-detector@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.0.0.tgz#78280119fd05ee98317daee62cddb3aa537a31c6" - integrity sha512-ZYHJYFeibxfsDSKowjDP332pStuiFT2xfc5R67Rjm/l+HFJWJgNIOCOlQGeXLCtyUn3A23+VVDdiCcnB6dTTrg== +jest-leak-detector@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.3.1.tgz#ed89d05ca07e91b2b51dac1f676ab354663aa8da" + integrity sha512-GncRwEtAw/SohdSyY4bk2RE06Ac1dZrtQGZQ2j35hSuN4gAAAKSYMszJS2WDixsAEaFN+GHBHG+d8pjVGklKyw== dependencies: - pretty-format "^24.0.0" + pretty-format "^24.3.1" -jest-matcher-utils@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.0.0.tgz#fc9c41cfc49b2c3ec14e576f53d519c37729d579" - integrity sha512-LQTDmO+aWRz1Tf9HJg+HlPHhDh1E1c65kVwRFo5mwCVp5aQDzlkz4+vCvXhOKFjitV2f0kMdHxnODrXVoi+rlA== +jest-matcher-utils@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.3.1.tgz#025e1cd9c54a5fde68e74b12428775d06d123aa8" + integrity sha512-P5VIsUTJeI0FYvWVMwEHjxK1L83vEkDiKMV0XFPIrT2jzWaWPB2+dPCHkP2ID9z4eUKElaHqynZnJiOdNVHfXQ== dependencies: chalk "^2.0.1" - jest-diff "^24.0.0" - jest-get-type "^24.0.0" - pretty-format "^24.0.0" + jest-diff "^24.3.1" + jest-get-type "^24.3.0" + pretty-format "^24.3.1" -jest-message-util@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.0.0.tgz#a07a141433b2c992dbaec68d4cbfe470ba289619" - integrity sha512-J9ROJIwz/IeC+eV1XSwnRK4oAwPuhmxEyYx1+K5UI+pIYwFZDSrfZaiWTdq0d2xYFw4Xiu+0KQWsdsQpgJMf3Q== +jest-message-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.3.0.tgz#e8f64b63ebc75b1a9c67ee35553752596e70d4a9" + integrity sha512-lXM0YgKYGqN5/eH1NGw4Ix+Pk2I9Y77beyRas7xM24n+XTTK3TbT0VkT3L/qiyS7WkW0YwyxoXnnAaGw4hsEDA== dependencies: "@babel/code-frame" "^7.0.0" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/stack-utils" "^1.0.1" chalk "^2.0.1" micromatch "^3.1.10" slash "^2.0.0" stack-utils "^1.0.1" -jest-mock@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.0.0.tgz#9a4b53e01d66a0e780f7d857462d063e024c617d" - integrity sha512-sQp0Hu5fcf5NZEh1U9eIW2qD0BwJZjb63Yqd98PQJFvf/zzUTBoUAwv/Dc/HFeNHIw1f3hl/48vNn+j3STaI7A== +jest-mock@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.3.0.tgz#95a86b6ad474e3e33227e6dd7c4ff6b07e18d3cb" + integrity sha512-AhAo0qjbVWWGvcbW5nChFjR0ObQImvGtU6DodprNziDOt+pP0CBdht/sYcNIOXeim8083QUi9bC8QdKB8PTK4Q== + dependencies: + "@jest/types" "^24.3.0" -jest-regex-util@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.0.0.tgz#4feee8ec4a358f5bee0a654e94eb26163cb9089a" - integrity sha512-Jv/uOTCuC+PY7WpJl2mpoI+WbY2ut73qwwO9ByJJNwOCwr1qWhEW2Lyi2S9ZewUdJqeVpEBisdEVZSI+Zxo58Q== +jest-regex-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" + integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== -jest-resolve-dependencies@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.1.0.tgz#78f738a2ec59ff4d00751d9da56f176e3f589f6c" - integrity sha512-2VwPsjd3kRPu7qe2cpytAgowCObk5AKeizfXuuiwgm1a9sijJDZe8Kh1sFj6FKvSaNEfCPlBVkZEJa2482m/Uw== +jest-resolve-dependencies@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.3.1.tgz#a22839d611ba529a74594ee274ce2b77d046bea9" + integrity sha512-9JUejNImGnJjbNR/ttnod+zQIWANpsrYMPt18s2tYGK6rP191qFsyEQ2BhAQMdYDRkTmi8At+Co9tL+jTPqdpw== dependencies: - jest-regex-util "^24.0.0" - jest-snapshot "^24.1.0" + "@jest/types" "^24.3.0" + jest-regex-util "^24.3.0" + jest-snapshot "^24.3.1" -jest-resolve@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.1.0.tgz#42ff0169b0ea47bfdbd0c52a0067ca7d022c7688" - integrity sha512-TPiAIVp3TG6zAxH28u/6eogbwrvZjBMWroSLBDkwkHKrqxB/RIdwkWDye4uqPlZIXWIaHtifY3L0/eO5Z0f2wg== +jest-resolve@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.3.1.tgz#103dbd438b59618ea428ec4acbd65c56495ba397" + integrity sha512-N+Q3AcVuKxpn/kjQMxUVLwBk32ZE1diP4MPcHyjVwcKpCUuKrktfRR3Mqe/T2HoD25wyccstaqcPUKIudl41bg== dependencies: + "@jest/types" "^24.3.0" browser-resolve "^1.11.3" chalk "^2.0.1" - realpath-native "^1.0.0" + realpath-native "^1.1.0" -jest-runner@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.1.0.tgz#3686a2bb89ce62800da23d7fdc3da2c32792943b" - integrity sha512-CDGOkT3AIFl16BLL/OdbtYgYvbAprwJ+ExKuLZmGSCSldwsuU2dEGauqkpvd9nphVdAnJUcP12e/EIlnTX0QXg== +jest-runner@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.3.1.tgz#5488566fa60cdb4b00a89c734ad6b54b9561415d" + integrity sha512-Etc9hQ5ruwg+q7DChm+E8qzHHdNTLeUdlo+whPQRSpNSgl0AEgc2r2mT4lxODREqmnHg9A8JHA44pIG4GE0Gzg== dependencies: + "@jest/console" "^24.3.0" + "@jest/environment" "^24.3.1" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" chalk "^2.4.2" exit "^0.1.2" graceful-fs "^4.1.15" - jest-config "^24.1.0" - jest-docblock "^24.0.0" - jest-haste-map "^24.0.0" - jest-jasmine2 "^24.1.0" - jest-leak-detector "^24.0.0" - jest-message-util "^24.0.0" - jest-runtime "^24.1.0" - jest-util "^24.0.0" - jest-worker "^24.0.0" + jest-config "^24.3.1" + jest-docblock "^24.3.0" + jest-haste-map "^24.3.1" + jest-jasmine2 "^24.3.1" + jest-leak-detector "^24.3.1" + jest-message-util "^24.3.0" + jest-resolve "^24.3.1" + jest-runtime "^24.3.1" + jest-util "^24.3.0" + jest-worker "^24.3.1" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.1.0.tgz#7c157a2e776609e8cf552f956a5a19ec9c985214" - integrity sha512-59/BY6OCuTXxGeDhEMU7+N33dpMQyXq7MLK07cNSIY/QYt2QZgJ7Tjx+rykBI0skAoigFl0A5tmT8UdwX92YuQ== - dependencies: - "@babel/core" "^7.1.0" - babel-plugin-istanbul "^5.1.0" +jest-runtime@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.3.1.tgz#2798230b4fbed594b375a13e395278694d4751e2" + integrity sha512-Qz/tJWbZ2naFJ2Kvy1p+RhhRgsPYh4e6wddVRy6aHBr32FTt3Ja33bfV7pkMFWXFbVuAsJMJVdengbvdhWzq4A== + dependencies: + "@jest/console" "^24.3.0" + "@jest/environment" "^24.3.1" + "@jest/source-map" "^24.3.0" + "@jest/transform" "^24.3.1" + "@jest/types" "^24.3.0" + "@types/yargs" "^12.0.2" chalk "^2.0.1" - convert-source-map "^1.4.0" exit "^0.1.2" - fast-json-stable-stringify "^2.0.0" glob "^7.1.3" graceful-fs "^4.1.15" - jest-config "^24.1.0" - jest-haste-map "^24.0.0" - jest-message-util "^24.0.0" - jest-regex-util "^24.0.0" - jest-resolve "^24.1.0" - jest-snapshot "^24.1.0" - jest-util "^24.0.0" - jest-validate "^24.0.0" - micromatch "^3.1.10" - realpath-native "^1.0.0" + jest-config "^24.3.1" + jest-haste-map "^24.3.1" + jest-message-util "^24.3.0" + jest-mock "^24.3.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.3.1" + jest-snapshot "^24.3.1" + jest-util "^24.3.0" + jest-validate "^24.3.1" + realpath-native "^1.1.0" slash "^2.0.0" strip-bom "^3.0.0" - write-file-atomic "2.4.1" yargs "^12.0.2" -jest-serializer@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.0.0.tgz#522c44a332cdd194d8c0531eb06a1ee5afb4256b" - integrity sha512-9FKxQyrFgHtx3ozU+1a8v938ILBE7S8Ko3uiAVjT8Yfi2o91j/fj81jacCQZ/Ihjiff/VsUCXVgQ+iF1XdImOw== +jest-serializer@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.3.0.tgz#074e307300d1451617cf2630d11543ee4f74a1c8" + integrity sha512-RiSpqo2OFbVLJN/PgAOwQIUeHDfss6NBUDTLhjiJM8Bb5rMrwRqHfkaqahIsOf9cXXB5UjcqDCzbQ7AIoMqWkg== -jest-snapshot@^24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.1.0.tgz#85e22f810357aa5994ab61f236617dc2205f2f5b" - integrity sha512-th6TDfFqEmXvuViacU1ikD7xFb7lQsPn2rJl7OEmnfIVpnrx3QNY2t3PE88meeg0u/mQ0nkyvmC05PBqO4USFA== +jest-snapshot@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.3.1.tgz#0f22a86c1b8c87e823f5ad095e82c19d9ed93d72" + integrity sha512-7wbNJWh0sBjmoaexTOWqS7nleTQME7o2W9XKU6CHCxG49Thjct4aVPC/QPNF5NHnvf4M/VDmudIDbwz6noJTRA== dependencies: "@babel/types" "^7.0.0" + "@jest/types" "^24.3.0" chalk "^2.0.1" - jest-diff "^24.0.0" - jest-matcher-utils "^24.0.0" - jest-message-util "^24.0.0" - jest-resolve "^24.1.0" + expect "^24.3.1" + jest-diff "^24.3.1" + jest-matcher-utils "^24.3.1" + jest-message-util "^24.3.0" + jest-resolve "^24.3.1" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^24.0.0" + pretty-format "^24.3.1" semver "^5.5.0" -jest-util@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.0.0.tgz#fd38fcafd6dedbd0af2944d7a227c0d91b68f7d6" - integrity sha512-QxsALc4wguYS7cfjdQSOr5HTkmjzkHgmZvIDkcmPfl1ib8PNV8QUWLwbKefCudWS0PRKioV+VbQ0oCUPC691fQ== +jest-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.3.0.tgz#a549ae9910fedbd4c5912b204bb1bcc122ea0057" + integrity sha512-eKIAC+MTKWZthUUVOwZ3Tc5a0cKMnxalQHr6qZ4kPzKn6k09sKvsmjCygqZ1SxVVfUKoa8Sfn6XDv9uTJ1iXTg== dependencies: + "@jest/console" "^24.3.0" + "@jest/fake-timers" "^24.3.0" + "@jest/source-map" "^24.3.0" + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/node" "*" callsites "^3.0.0" chalk "^2.0.1" graceful-fs "^4.1.15" is-ci "^2.0.0" - jest-message-util "^24.0.0" mkdirp "^0.5.1" slash "^2.0.0" source-map "^0.6.0" -jest-validate@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.0.0.tgz#aa8571a46983a6538328fef20406b4a496b6c020" - integrity sha512-vMrKrTOP4BBFIeOWsjpsDgVXATxCspC9S1gqvbJ3Tnn/b9ACsJmteYeVx9830UMV28Cob1RX55x96Qq3Tfad4g== +jest-validate@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.3.1.tgz#9359eea5a767a3d20b4fa7a5764fd78330ba8312" + integrity sha512-ww3+IPNCOEMi1oKlrHdSnBXetXtdrrdSh0bqLNTVkWglduhORf94RJWd1ko9oEPU2TcEQS5QIPacYziQIUzc4A== dependencies: + "@jest/types" "^24.3.0" camelcase "^5.0.0" chalk "^2.0.1" - jest-get-type "^24.0.0" + jest-get-type "^24.3.0" leven "^2.1.0" - pretty-format "^24.0.0" + pretty-format "^24.3.1" -jest-watcher@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.0.0.tgz#20d44244d10b0b7312410aefd256c1c1eef68890" - integrity sha512-GxkW2QrZ4YxmW1GUWER05McjVDunBlKMFfExu+VsGmXJmpej1saTEKvONdx5RJBlVdpPI5x6E3+EDQSIGgl53g== +jest-watcher@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.3.0.tgz#ee51c6afbe4b35a12fcf1107556db6756d7b9290" + integrity sha512-EpJS/aUG8D3DMuy9XNA4fnkKWy3DQdoWhY92ZUdlETIeEn1xya4Np/96MBSh4II5YvxwKe6JKwbu3Bnzfwa7vA== dependencies: + "@jest/test-result" "^24.3.0" + "@jest/types" "^24.3.0" + "@types/node" "*" + "@types/yargs" "^12.0.9" ansi-escapes "^3.0.0" chalk "^2.0.1" - jest-util "^24.0.0" + jest-util "^24.3.0" string-length "^2.0.0" -jest-worker@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.0.0.tgz#3d3483b077bf04f412f47654a27bba7e947f8b6d" - integrity sha512-s64/OThpfQvoCeHG963MiEZOAAxu8kHsaL/rCMF7lpdzo7vgF0CtPml9hfguOMgykgH/eOm4jFP4ibfHLruytg== +jest-worker@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.3.1.tgz#c1759dd2b1d5541b09a2e5e1bc3288de6c9d8632" + integrity sha512-ZCoAe/iGLzTJvWHrO8fyx3bmEQhpL16SILJmWHKe8joHhyF3z00psF1sCRT54DoHw5GJG0ZpUtGy+ylvwA4haA== dependencies: + "@types/node" "*" merge-stream "^1.0.1" supports-color "^6.1.0" -jest@24.1.0: - version "24.1.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.1.0.tgz#b1e1135caefcf2397950ecf7f90e395fde866fd2" - integrity sha512-+q91L65kypqklvlRFfXfdzUKyngQLOcwGhXQaLmVHv+d09LkNXuBuGxlofTFW42XMzu3giIcChchTsCNUjQ78A== +jest@24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.3.1.tgz#81959de0d57b2df923510f4fafe266712d37dcca" + integrity sha512-SqZguEbYNcZ3r0KUUBN+IkKfyPS1VBbIUiK4Wrc0AiGUR52gJa0fmlWSOCL3x25908QrfoQwkVDu5jCsfXb2ig== dependencies: import-local "^2.0.0" - jest-cli "^24.1.0" + jest-cli "^24.3.1" joi@^11.1.1: version "11.4.0" @@ -6524,11 +6741,6 @@ merge2@^1.2.3: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== -merge@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.1.tgz#38bebf80c3220a8a487b6fcfb3941bb11720c145" - integrity sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ== - methods@^1.0.1, methods@^1.1.1, methods@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -7542,10 +7754,10 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= -pirates@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.0.tgz#850b18781b4ac6ec58a43c9ed9ec5fe6796addbd" - integrity sha512-8t5BsXy1LUIjn3WWOlOuFDuKswhQb/tkak641lvBgmPOBUQHXveORtlMCp6OdPV1dtuTaEahKA8VNz6uLfKBtA== +pirates@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== dependencies: node-modules-regexp "^1.0.0" @@ -7987,13 +8199,15 @@ pretty-error@^2.0.2: renderkid "^2.0.1" utila "~0.4" -pretty-format@^24.0.0: - version "24.0.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.0.0.tgz#cb6599fd73ac088e37ed682f61291e4678f48591" - integrity sha512-LszZaKG665djUcqg5ZQq+XzezHLKrxsA86ZABTozp+oNhkdqa+tG2dX4qa6ERl5c/sRDrAa3lHmwnvKoP+OG/g== +pretty-format@^24.3.1: + version "24.3.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.3.1.tgz#ae4a98e93d73d86913a8a7dd1a7c3c900f8fda59" + integrity sha512-NZGH1NWS6o4i9pvRWLsxIK00JB9pqOUzVrO7yWT6vjI2thdxwvxefBJO6O5T24UAhI8P5dMceZ7x5wphgVI7Mg== dependencies: + "@jest/types" "^24.3.0" ansi-regex "^4.0.0" ansi-styles "^3.2.0" + react-is "^16.8.4" pretty-time@^1.1.0: version "1.1.0" @@ -8226,6 +8440,11 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +react-is@^16.8.4: + version "16.8.4" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.4.tgz#90f336a68c3a29a096a3d648ab80e87ec61482a2" + integrity sha512-PVadd+WaUDOAciICm/J1waJaSvgq+4rHE/K70j0PFqKhkTBsPv/82UGQJNXAngz1fOQLLxI6z1sEDmJDQhCTAA== + read-pkg-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" @@ -8292,10 +8511,10 @@ readdirp@^2.0.0, readdirp@^2.2.1: micromatch "^3.1.10" readable-stream "^2.0.2" -realpath-native@^1.0.0, realpath-native@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.2.tgz#cd51ce089b513b45cf9b1516c82989b51ccc6560" - integrity sha512-+S3zTvVt9yTntFrBpm7TQmQ3tzpCrnA1a/y+3cUHAc9ZR6aIjG0WNLR+Rj79QpJktY+VeW/TQtFlQ1bzsehI8g== +realpath-native@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== dependencies: util.promisify "^1.0.0" @@ -8691,22 +8910,20 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -sane@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/sane/-/sane-3.1.0.tgz#995193b7dc1445ef1fe41ddfca2faf9f111854c6" - integrity sha512-G5GClRRxT1cELXfdAq7UKtUsv8q/ZC5k8lQGmjEm4HcAl3HzBy68iglyNCmw4+0tiXPCBZntslHlRhbnsSws+Q== +sane@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.0.3.tgz#e878c3f19e25cc57fbb734602f48f8a97818b181" + integrity sha512-hSLkC+cPHiBQs7LSyXkotC3UUtyn8C4FMn50TNaacRyvBlI+3ebcxMpqckmTdtXVtel87YS7GXN3UIOj7NiGVQ== dependencies: + "@cnakazawa/watch" "^1.0.3" anymatch "^2.0.0" capture-exit "^1.2.0" - exec-sh "^0.2.0" + exec-sh "^0.3.2" execa "^1.0.0" fb-watchman "^2.0.0" micromatch "^3.1.4" minimist "^1.1.1" walker "~1.0.5" - watch "~0.18.0" - optionalDependencies: - fsevents "^1.2.3" sanitize-html@^1.20.0: version "1.20.0" @@ -10212,14 +10429,6 @@ walker@~1.0.5: dependencies: makeerror "1.0.x" -watch@~0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" - integrity sha1-KAlUdsbffJDJYxOJkMClQj60uYY= - dependencies: - exec-sh "^0.2.0" - minimist "^1.2.0" - watchpack@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" @@ -10423,7 +10632,7 @@ which-pm-runs@^1.0.0: resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= -which@^1.2.10, which@^1.2.12, which@^1.2.9, which@^1.3.0: +which@^1.2.10, which@^1.2.9, which@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== From 41f94cd2a5749089785eb67a51f423c053cd7bcc Mon Sep 17 00:00:00 2001 From: Josiah Wang Date: Fri, 8 Mar 2019 11:18:10 +0800 Subject: [PATCH 06/43] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9F=A5=E4=B9=8E?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98=20&=20?= =?UTF-8?q?=E7=9F=A5=E4=B9=8E=E6=97=A5=E6=8A=A5h2=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=20(#1704)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 知乎的**用户回答**、**专栏**、**问题**、**话题**内容的图片处,实际上是``,在Inoreader中noscript标签会被去掉导致出现两张一模一样的图片,很容易处理掉没用的noscript标签,确保图片的正确显示。 2. **知乎日报**内容去掉形如`

知乎问题标题

`中的h2标签,现在的正则会把``也一并去掉,处理逻辑更为清晰。 --- lib/routes/zhihu/daily.js | 2 +- lib/routes/zhihu/utils.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/routes/zhihu/daily.js b/lib/routes/zhihu/daily.js index 1dd693e08d4ff2..06428094a96f1f 100644 --- a/lib/routes/zhihu/daily.js +++ b/lib/routes/zhihu/daily.js @@ -36,7 +36,7 @@ module.exports = async (ctx) => { Referer: url, }, }); - item.description = utils.ProcessImage(storyDetail.data.body.replace(/
([\s\S]*?)<\/div>/g, '$1').replace(//g, '')); + item.description = utils.ProcessImage(storyDetail.data.body.replace(/
([\s\S]*?)<\/div>/g, '$1').replace(/<\/?h2.*?>/g, '')); ctx.cache.set(key, item.description, 24 * 60 * 60); } diff --git a/lib/routes/zhihu/utils.js b/lib/routes/zhihu/utils.js index c5134439c8b79f..c481ab89d41471 100644 --- a/lib/routes/zhihu/utils.js +++ b/lib/routes/zhihu/utils.js @@ -8,6 +8,8 @@ module.exports = { ProcessImage: function(content) { const $ = cheerio.load(content, { xmlMode: true }); + $('noscript').remove(); + $('img.content_image, img.origin_image, img.content-image, img.data-actualsrc').each((i, e) => { if (e.attribs['data-original']) { $(e).attr({ From a538a9c0d69d0565af0fa86cb9951777779db821 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Fri, 8 Mar 2019 11:23:38 +0800 Subject: [PATCH 07/43] =?UTF-8?q?=E5=AF=B9=E7=94=B5=E5=BD=B1=E5=A4=A9?= =?UTF-8?q?=E5=A0=82=E5=A2=9E=E5=8A=A0=E5=85=A8=E6=96=87=E6=8A=93=E5=8F=96?= =?UTF-8?q?=20(#1697)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit let list = $('.co_content8 table tr').get(); list.splice(0, 1); 原因如下: 页面内含有两个 .co_content8 table 仅第一个 table内 第一个 tr 元素是广告 const list = $('.co_content8 table tr:not(:first-child)').get(); 会丢失第二个table的第一个tr元素 --- lib/routes/dytt/index.js | 57 +++++++++++++++++++++++++++++----------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/lib/routes/dytt/index.js b/lib/routes/dytt/index.js index c89bfd63f42cfb..90b1db94462e83 100644 --- a/lib/routes/dytt/index.js +++ b/lib/routes/dytt/index.js @@ -1,6 +1,24 @@ const axios = require('../../utils/axios'); const cheerio = require('cheerio'); const iconv = require('iconv-lite'); + +async function load(link, ctx) { + const cache = await ctx.cache.get(link); + if (cache) { + return cache; + } + const response = await axios.get(link, { + responseType: 'arraybuffer', + }); + response.data = iconv.decode(response.data, 'gb2312'); + + const $ = cheerio.load(response.data); + + const description = $('div#Zoom').html(); + await ctx.cache.set(link, description, 24 * 60 * 60); + return description; +} + module.exports = async (ctx) => { const response = await axios.get('http://www.dytt8.net', { responseType: 'arraybuffer', @@ -9,25 +27,34 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.co_content8 table tr').get(); + // 页面含有2个.co_content8 table + // 仅第一个table内第一个tr元素是广告连接 + // 去除该广告连接 + list.splice(0, 1); + // const list = $('.co_content8 table tr:not(:first-child)').get(); + const process = await Promise.all( + list.map(async (item) => { + const link = $(item).find('a:nth-of-type(2)'); + const itemUrl = 'http://www.dytt8.net' + link.attr('href'); + const other = await load(itemUrl, ctx); + return { + title: link.text(), + description: other, + pubDate: new Date( + $(item) + .find('font') + .text() + ).toUTCString(), + link: itemUrl, + }; + }) + ); + const data = { title: '电影天堂', link: 'http://www.dytt8.net', description: '电影天堂RSS', - item: list - .map((item) => { - const link = $(item).find('a:nth-of-type(2)'); - return { - title: link.text(), - description: link.text(), - pubDate: new Date( - $(item) - .find('font') - .text() - ).toUTCString(), - link: 'http://www.dytt8.net' + link.attr('href'), - }; - }) - .slice(1), + item: process, }; ctx.state.data = data; From f8990b7cb72ca3c78806f8a0c51f3ee0c7f873eb Mon Sep 17 00:00:00 2001 From: SettingDust Date: Mon, 11 Mar 2019 10:47:09 +0800 Subject: [PATCH 08/43] The cherrio config route (#1699) Use js config too build rss close #349 close #1035 --- docs/README.md | 6 ++ docs/joinus/README.md | 55 +++++++++++++++++ lib/router.js | 4 ++ lib/routes/uraaka-joshi/uraaka-joshi-user.js | 19 ++++++ lib/routes/uraaka-joshi/uraaka-joshi.js | 21 +++++++ lib/utils/common-config.js | 63 ++++++++++++++++++++ lib/utils/date.js | 1 + test/utils/common-config.js | 38 ++++++++++++ 8 files changed, 207 insertions(+) create mode 100644 lib/routes/uraaka-joshi/uraaka-joshi-user.js create mode 100644 lib/routes/uraaka-joshi/uraaka-joshi.js create mode 100644 lib/utils/common-config.js create mode 100644 test/utils/common-config.js diff --git a/docs/README.md b/docs/README.md index 52e3d9c098bc5e..2716eaa55d165e 100755 --- a/docs/README.md +++ b/docs/README.md @@ -3112,3 +3112,9 @@ type 为 all 时,category 参数不支持 cost 和 free ### 决胜网 + +### 裏垢女子まとめ + + + + diff --git a/docs/joinus/README.md b/docs/joinus/README.md index 79f48bfec3d65d..045ad06a637ab0 100644 --- a/docs/joinus/README.md +++ b/docs/joinus/README.md @@ -258,6 +258,61 @@ sidebar: auto // 注:由于此路由只是起到一个新专栏上架提醒的作用,无法访问付费文章,因此没有文章正文 ``` + 4. **使用通用配置型路由** + + 很大一部分网站是可以通过一个配置范式来生成 RSS 的。 + 通用配置即通过 cherrio(**CSS 选择器、jQuery 函数**)读取 json 数据来简便的生成 RSS。 + + 首先我们需要几个数据: + + 1. RSS 来源链接 + 2. 数据来源链接 + 3. RSS 标题(非 item 标题) + + ```js + const buildData = require('../../utils/common-config'); + module.exports = async (ctx) => { + ctx.state.data = await buildData({ + link: RSS来源链接, + url: 数据来源链接, + title: '%title%', //这里使用了变量,形如 **%xxx%** 这样的会被解析为变量,值为 **params** 下的同名值 + params: { + title: RSS标题, + }, + }); + }; + ``` + + 至此,我们的 RSS 还没有任何内容,内容需要由`item`完成,也是核心部分,需要有 CSS 选择器以及 jQuery 的函数知识(请去 W3School 学习) + 下面为一个实例 + 建议在打开[此链接](https://www.uraaka-joshi.com/)的开发者工具之后再阅读以下内容,请善用开发者工具的搜索功能搜寻`$('xxx')`中的内容 + + ```js + const buildData = require('../../utils/common-config'); + + module.exports = async (ctx) => { + const link = `https://www.uraaka-joshi.com/`; + ctx.state.data = await buildData({ + link, + url: link, + title: `%title%`, + params: { + title: '裏垢女子まとめ', + }, + item: { + item: '.content-main .stream .stream-item', + title: `$('.post-account-group').text() + ' - %title%'`, //只支持$().xxx()这样的js语句,也足够使用 + link: `$('.post-account-group').attr('href')`, //.text()代表获取元素的文本,attr()表示获取指定属性 + description: `$('.post .context').html()`, // .html()代表获取元素的html代码 + pubDate: `new Date($('.post-time').attr('datetime')).toUTCString()`, // 日期的格式多种多样,可以尝试使用**/utils/date** + guid: `new Date($('.post-time').attr('datetime')).getTime()`, // guid必须唯一,这是RSS的不同item的标志 + }, + }); + }; + ``` + + 至此我们完成了一个最简单的路由 + --- #### 使用缓存 diff --git a/lib/router.js b/lib/router.js index 77e4482ad33a46..4be7c2d95f20be 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1121,4 +1121,8 @@ router.get('/luogu/daily/:id?', require('./routes/luogu/daily')); // 决胜网 router.get('/juesheng', require('./routes/juesheng')); +// 裏垢女子まとめ +router.get('/uraaka-joshi', require('./routes/uraaka-joshi/uraaka-joshi')); +router.get('/uraaka-joshi/:id', require('./routes/uraaka-joshi/uraaka-joshi-user')); + module.exports = router; diff --git a/lib/routes/uraaka-joshi/uraaka-joshi-user.js b/lib/routes/uraaka-joshi/uraaka-joshi-user.js new file mode 100644 index 00000000000000..afe404b9470840 --- /dev/null +++ b/lib/routes/uraaka-joshi/uraaka-joshi-user.js @@ -0,0 +1,19 @@ +const buildData = require('../../utils/common-config'); + +module.exports = async (ctx) => { + const params = ctx.params; + const link = `https://www.uraaka-joshi.com/users/${params.id}`; + ctx.state.data = await buildData({ + link, + url: link, + title: `$('.top-profile-card-name-link').text() + '@${params.id} - 裏垢女子まとめ'`, + item: { + item: '.content-main .stream .stream-item', + title: `$('.post-name').text() + '@${params.id} - 裏垢女子まとめ'`, + link: `https://www.uraaka-joshi.com/users/${params.id}`, + description: `$('.post .context').html()`, + pubDate: `new Date($('.post-time').attr('datetime')).toUTCString()`, + guid: `new Date($('.post-time').attr('datetime')).getTime()`, + }, + }); +}; diff --git a/lib/routes/uraaka-joshi/uraaka-joshi.js b/lib/routes/uraaka-joshi/uraaka-joshi.js new file mode 100644 index 00000000000000..74af353ef4923d --- /dev/null +++ b/lib/routes/uraaka-joshi/uraaka-joshi.js @@ -0,0 +1,21 @@ +const buildData = require('../../utils/common-config'); + +module.exports = async (ctx) => { + const link = `https://www.uraaka-joshi.com/`; + ctx.state.data = await buildData({ + link, + url: link, + title: `%title%`, + params: { + title: '裏垢女子まとめ', + }, + item: { + item: '.content-main .stream .stream-item', + title: `$('.post-account-group').text() + ' - %title%'`, + link: `$('.post-account-group').attr('href')`, + description: `$('.post .context').html()`, + pubDate: `new Date($('.post-time').attr('datetime')).toUTCString()`, + guid: `new Date($('.post-time').attr('datetime')).getTime()`, + }, + }); +}; diff --git a/lib/utils/common-config.js b/lib/utils/common-config.js new file mode 100644 index 00000000000000..9822849d69e672 --- /dev/null +++ b/lib/utils/common-config.js @@ -0,0 +1,63 @@ +const cheerio = require('cheerio'); +const axios = require('./axios'); + +function transElemText($, prop) { + const regex = new RegExp(/\$\((.*)\)/g); + let result = prop; + if (regex.test(result)) { + result = eval(result); + } + return result; +} + +function replaceParams(data, prop, $) { + const regex = new RegExp(/%(.*)%/g); + let result = prop; + let group = regex.exec(prop); + while (group) { + // FIXME Multi vars + result = result.replace(group[0], transElemText($, data.params[group[1]])); + group = regex.exec(prop); + } + return result; +} + +function getProp(data, prop, $) { + let result = data; + if (Array.isArray(prop)) { + for (const e of prop) { + result = transElemText($, result[e]); + } + } else { + result = transElemText($, result[prop]); + } + return replaceParams(data, result, $); +} + +async function buildData(data) { + const response = (await axios.get(data.url)).data; + const $ = cheerio.load(response); + const $item = $(data.item.item); + // 这里应该是可以通过参数注入一些代码的,不过应该无伤大雅 + return { + title: getProp(data, 'title', $), + description: getProp(data, 'description', $), + item: $item + .map((_, e) => { + const $elem = (selector) => $(e).find(selector); + return { + title: getProp(data, ['item', 'title'], $elem), + description: getProp(data, ['item', 'description'], $elem), + pubDate: getProp(data, ['item', 'pubDate'], $elem), + link: getProp(data, ['item', 'link'], $elem), + guid: getProp(data, ['item', 'guid'], $elem), + }; + }) + .get(), + }; +} + +module.exports = buildData; +module.exports.transElemText = transElemText; +module.exports.replaceParams = replaceParams; +module.exports.getProp = getProp; diff --git a/lib/utils/date.js b/lib/utils/date.js index 19a45da00629fc..c235f2ab017b43 100644 --- a/lib/utils/date.js +++ b/lib/utils/date.js @@ -7,6 +7,7 @@ module.exports = (html, timeZone = -serverOffset) => { if (/(\d+)分钟前/.exec(html)) { math = /(\d+)分钟前/.exec(html); date.setMinutes(date.getMinutes() - math[1]); + date.setSeconds(0); } else if (/(\d+)小时前/.exec(html)) { math = /(\d+)小时前/.exec(html); date.setHours(date.getHours() - math[1]); diff --git a/test/utils/common-config.js b/test/utils/common-config.js new file mode 100644 index 00000000000000..39d26541db17f0 --- /dev/null +++ b/test/utils/common-config.js @@ -0,0 +1,38 @@ +const configUtils = require('../../lib/utils/common-config'); + +describe('index', () => { + it('transElemText', async () => { + const $ = () => 'RSSHub'; + expect(configUtils.transElemText($, '$()')).toBe('RSSHub'); + }); + + it('replaceParams', async () => { + const $ = () => 'RSSHub'; + const data = { + params: { + title: 'RSSHub', + }, + title: '%title%', + }; + expect(configUtils.replaceParams(data, data.title, $)).toBe('RSSHub'); + }); + + it('getProp', async () => { + const $ = () => 'RSSHub'; + const data = { + title: 'RSSHub', + }; + expect(configUtils.getProp(data, ['title'], $)).toBe('RSSHub'); + }); + + it('all', async () => { + const $ = () => 'RSSHub'; + const data = { + params: { + title: '$()', + }, + title: '%title%', + }; + expect(configUtils.getProp(data, ['title'], $)).toBe('RSSHub'); + }); +}); From 0abd80a9a78f4f4bdab576ea01dc8eaa80662411 Mon Sep 17 00:00:00 2001 From: ciaran <760218327@qq.com> Date: Mon, 11 Mar 2019 10:47:49 +0800 Subject: [PATCH 09/43] =?UTF-8?q?fix=20=E5=90=8E=E7=BB=ADapp=20route=20(#1?= =?UTF-8?q?705)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 随着页面元素的更新而更新 --- lib/routes/houxu/lives.js | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/lib/routes/houxu/lives.js b/lib/routes/houxu/lives.js index acfa2ef02f8c0e..247c96af79edaf 100644 --- a/lib/routes/houxu/lives.js +++ b/lib/routes/houxu/lives.js @@ -7,34 +7,22 @@ module.exports = async (ctx) => { const res = await axios.get(baseUrl); const $ = cheerio.load(res.data); - const list = $('div.list > div'); + const list = $('div.container > div'); const out = list .map((_, el) => { const each = $(el); + + const p = each.find('p'); return { - title: - each - .find('cite') - .text() - .trim() + - ' | ' + - each - .find('a') - .first() - .text() - .trim(), - description: each - .find('p > a') - .contents() - .filter(function() { - return this.nodeType === 3; - }) + title: each + .find('h3') .text() .trim(), + description: p.html() + p.next().html(), link: 'https://houxu.app' + each - .find('a') + .find('h3 > a') .first() .attr('href'), }; From 9f96dcf77ab9e1b66d173361d13ca3aeaaaccb87 Mon Sep 17 00:00:00 2001 From: billyct Date: Mon, 11 Mar 2019 10:49:52 +0800 Subject: [PATCH 10/43] =?UTF-8?q?=F0=9F=90=B0=20Add=20=E4=B8=AD=E5=8D=8E?= =?UTF-8?q?=E4=BA=BA=E6=B0=91=E5=85=B1=E5=92=8C=E5=9B=BD=E7=94=9F=E6=80=81?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E9=83=A8=E5=85=AC=E5=91=8A=20(#1707)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 4 +++ lib/router.js | 3 +++ lib/routes/gov/mee/gs.js | 54 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 lib/routes/gov/mee/gs.js diff --git a/docs/README.md b/docs/README.md index 2716eaa55d165e..8b47eac4495174 100755 --- a/docs/README.md +++ b/docs/README.md @@ -2693,6 +2693,10 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 +### 中华人民共和国生态环境部 + + + ### 联合国 diff --git a/lib/router.js b/lib/router.js index 4be7c2d95f20be..98593147786dc1 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1019,6 +1019,9 @@ router.get('/cyzone/author/:id', require('./routes/cyzone/author')); router.get('/gov/zhengce/zuixin', require('./routes/gov/zhengce/zuixin')); router.get('/gov/zhengce/wenjian/:pcodeJiguan?', require('./routes/gov/zhengce/wenjian')); +// 中华人民共和国生态环境部 +router.get('/gov/mee/gs', require('./routes/gov/mee/gs')); + // 小黑盒 router.get('/xiaoheihe/user/:id', require('./routes/xiaoheihe/user')); diff --git a/lib/routes/gov/mee/gs.js b/lib/routes/gov/mee/gs.js new file mode 100644 index 00000000000000..f571f5efdd09cc --- /dev/null +++ b/lib/routes/gov/mee/gs.js @@ -0,0 +1,54 @@ +const axios = require('../../../utils/axios'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const linkBase = `http://www.mee.gov.cn/xxgk/gs/gsq/`; + const listData = await axios.get(linkBase); + const $ = cheerio.load(listData.data); + ctx.state.data = { + title: `公示 - 中华人民共和国生态环境部`, + link: linkBase, + item: await Promise.all( + $('.main .main_top li') + .map(async (_, el) => { + const $el = $(el); + const $a = $el.find('>a'); + const href = $a.attr('href'); + const key = `gov_gs: ${href}`; + let description; + const value = await ctx.cache.get(key); + + // 移除 href 中的 ./,并且拼接原来的 url + const link = `${linkBase}${href.slice(2)}`; + + if (value) { + description = value; + } else { + const contentData = await axios.get(link); + const $content = cheerio.load(contentData.data); + description = $content('.TRS_Editor').html(); + ctx.cache.set(key, description, 24 * 60 * 60); + } + + const title = $a.text(); + + // 获取 date + const pubDate = new Date( + $el + .find('.shover') + .first() + .text() + .match(/\d{4}-\d{2}-\d{2}/) + ).toUTCString(); + + return { + title, + description, + link, + pubDate, + }; + }) + .get() + ), + }; +}; From b3d938032d8315403c7326c44266ee6d8d3233c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=89=E5=87=89?= Date: Mon, 11 Mar 2019 10:51:41 +0800 Subject: [PATCH 11/43] Hotfix: dajia (#1709) --- lib/routes/tencent/dajia/index.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/routes/tencent/dajia/index.js b/lib/routes/tencent/dajia/index.js index 1b4a56996a2cb1..a8a581a9db5632 100644 --- a/lib/routes/tencent/dajia/index.js +++ b/lib/routes/tencent/dajia/index.js @@ -1,5 +1,6 @@ const axios = require('../../../utils/axios'); const cheerio = require('cheerio'); +const iconv = require('iconv-lite'); module.exports = async (ctx) => { const listRes = await axios({ @@ -13,15 +14,17 @@ module.exports = async (ctx) => { const storyList = JSON.parse(listRes.data.slice(1, -2)).data; const resultItem = await Promise.all( storyList.map(async (story) => { - const url = story.n_mobile_url; + const mobileUrl = story.n_mobile_url; + const pcUrl = story.n_url; const item = { title: story.n_title, description: '', - link: url, + link: pcUrl, + guid: mobileUrl, author: story.name, pubDate: new Date(story.n_publishtime).toUTCString(), }; - const key = `tx-dajia: ${url}`; + const key = `tx-dajia: ${mobileUrl}`; const value = await ctx.cache.get(key); if (value) { @@ -29,13 +32,13 @@ module.exports = async (ctx) => { } else { const storyDetail = await axios({ method: 'get', - url: url, + url: pcUrl, headers: { - Referer: url, - 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', + Referer: pcUrl, }, + responseType: 'arraybuffer', }); - const $ = cheerio.load(storyDetail.data); + const $ = cheerio.load(iconv.decode(storyDetail.data, 'gb2312')); $('#articleContent img').each(function(_, item) { const $img = $(item); const src = $img.attr('src'); From 16f14998ed52fc8dc3064929aa644c8bc91d642e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=89=E5=87=89?= Date: Mon, 11 Mar 2019 10:52:08 +0800 Subject: [PATCH 12/43] Add: douyin like (#1710) - Closes #1694 --- docs/README.md | 2 ++ lib/router.js | 1 + lib/routes/douyin/like.js | 71 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 lib/routes/douyin/like.js diff --git a/docs/README.md b/docs/README.md index 8b47eac4495174..d71fe3bb80da1a 100755 --- a/docs/README.md +++ b/docs/README.md @@ -590,6 +590,8 @@ RSSHub 提供下列 API 接口: + + ### 美拍 diff --git a/lib/router.js b/lib/router.js index 98593147786dc1..446f8c350a09ed 100755 --- a/lib/router.js +++ b/lib/router.js @@ -727,6 +727,7 @@ router.get('/curseforge/files/:project', require('./routes/curseforge/files')); // 抖音 router.get('/douyin/user/:id', require('./routes/douyin/user')); +router.get('/douyin/like/:id', require('./routes/douyin/like')); // 少数派 sspai router.get('/sspai/series', require('./routes/sspai/series')); diff --git a/lib/routes/douyin/like.js b/lib/routes/douyin/like.js new file mode 100644 index 00000000000000..7ba09cd43a1f94 --- /dev/null +++ b/lib/routes/douyin/like.js @@ -0,0 +1,71 @@ +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const id = ctx.params.id; + const browser = await require('../../utils/puppeteer')(); + const page = await browser.newPage(); + + const timerPromise = new Promise((resolve) => setTimeout(resolve, 1000)); + await timerPromise; + + const data = await new Promise((resolve) => { + const result = { + name: null, + description: null, + list: null, + }; + + page.goto(`https://www.douyin.com/share/user/${id}`) + .then(() => { + page.click('.like-tab').catch(() => {}); + }) + .catch(() => {}); + + page.on('response', (response) => { + const req = response.request(); + if (req.url().match(`www.douyin.com/share/user/${id}`)) { + response.text().then((text) => { + const $ = cheerio.load(text); + result.name = $('.nickname').text(); + result.description = $('.signature').text(); + if (result.list) { + resolve(result); + browser.close(); + } + }); + } else if (req.url().match('www.douyin.com/aweme/v1/aweme/favorite')) { + response.json().then((data) => { + result.list = data; + if (result.name) { + resolve(result); + browser.close(); + } + }); + } + }); + }); + + ctx.state.data = { + title: `${data.name}的抖音-喜欢的视频`, + link: `https://www.douyin.com/share/user/${id}`, + description: data.description, + item: + data.list && + data.list.aweme_list.map((item) => ({ + title: item.share_info.share_desc, + description: ` +

${item.share_info.share_desc}

+

APP 内打开

+

+

`, + link: item.video.play_addr.url_list[0], + })), + }; +}; From 68b5e7f1ede6e29b5ad850bcfdb6ce13d5f24c1f Mon Sep 17 00:00:00 2001 From: imlonghao Date: Mon, 11 Mar 2019 10:55:35 +0800 Subject: [PATCH 13/43] [Dockerhub] Fix date and guid (#1717) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 原来的 `pubDate` 为 `2019-03-08T04:10:53.381143Z` 格式,现修改成 UTC 格式 2. 原来的 `guid` 为 link ,每次有新的 build 都是返回同一个 link ,现从接口中找了个不会重复的参数即 `pubDate` 作为 guid --- lib/routes/dockerhub/build.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/routes/dockerhub/build.js b/lib/routes/dockerhub/build.js index b3306a66418b8a..e7f186ccbb867d 100644 --- a/lib/routes/dockerhub/build.js +++ b/lib/routes/dockerhub/build.js @@ -16,7 +16,8 @@ module.exports = async (ctx) => { title: `${namespace}:${tag} was built. ${(item.images[0].size / 1000000).toFixed(2)} MB`, link, author: owner, - pubDate: item.last_updated, + pubDate: new Date(item.last_updated).toUTCString(), + guid: item.last_updated, })); ctx.state.data = { From 718686fabc1def020d00ba0f58faab309ee77255 Mon Sep 17 00:00:00 2001 From: imlonghao Date: Mon, 11 Mar 2019 10:56:01 +0800 Subject: [PATCH 14/43] [Zhihu - Activities] Add type roundtable (#1719) close #1718 --- lib/routes/zhihu/activities.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/routes/zhihu/activities.js b/lib/routes/zhihu/activities.js index 020eb8b5ab09b5..fb9b840c6989fc 100644 --- a/lib/routes/zhihu/activities.js +++ b/lib/routes/zhihu/activities.js @@ -76,6 +76,11 @@ module.exports = async (ctx) => { description = detail.description.replace(/\n|\r/g, '
'); url = `https://www.zhihu.com/lives/${detail.id}`; break; + case 'roundtable': + title = detail.name; + description = detail.description; + url = `https://www.zhihu.com/roundtable/${detail.id}`; + break; } return { From 54752afe9b828ec232972287f757c688e36421d4 Mon Sep 17 00:00:00 2001 From: imlonghao Date: Mon, 11 Mar 2019 10:56:28 +0800 Subject: [PATCH 15/43] =?UTF-8?q?=E7=85=8E=E8=9B=8B=E6=97=A0=E8=81=8A?= =?UTF-8?q?=E5=9B=BE=E9=93=BE=E6=8E=A5=E4=BF=AE=E5=A4=8D=20(#1720)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sub_model 为 top-ooxx 时也有链接,所以去掉了 if close #1716 --- lib/routes/jandan/pic.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/routes/jandan/pic.js b/lib/routes/jandan/pic.js index 0e5be59fc61f06..2165237eaed606 100644 --- a/lib/routes/jandan/pic.js +++ b/lib/routes/jandan/pic.js @@ -28,17 +28,10 @@ module.exports = async (ctx) => { } // Get current comment's link. - let link = $(item) + const link = `https://jandan.net${$(item) .find('.righttext') .find('a') - .attr('href'); - - if (link !== undefined) { - link = `http:${link}`; - } else { - // sub_model 为 top-ooxx 时无链接 - link = ''; - } + .attr('href')}`; const imgList = []; $(item) From 412d54967f7b88d3123b3702618d855abc122ba7 Mon Sep 17 00:00:00 2001 From: Simon Shi Date: Mon, 11 Mar 2019 10:56:52 +0800 Subject: [PATCH 16/43] fix: shmtu routes (#1721) --- lib/routes/universities/shmtu/events.js | 46 +++++++++++----------- lib/routes/universities/shmtu/jwc.js | 45 ++++++++++----------- lib/routes/universities/shmtu/notes.js | 52 ++++++++++++------------- 3 files changed, 68 insertions(+), 75 deletions(-) diff --git a/lib/routes/universities/shmtu/events.js b/lib/routes/universities/shmtu/events.js index ea6d1de4fc5346..509a528e24574e 100644 --- a/lib/routes/universities/shmtu/events.js +++ b/lib/routes/universities/shmtu/events.js @@ -2,7 +2,7 @@ const axios = require('../../../utils/axios'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const host = 'https://www.shmtu.edu.cn'; + const host = 'http://www.shmtu.edu.cn'; const response = await axios({ method: 'get', @@ -21,31 +21,31 @@ module.exports = async (ctx) => { description: '上海海事大学 学术讲座', item: text && - text - .map((index, item) => { - item = $(item); - return { - title: item - .find('.title') + text.map((item) => { + item = $(item); + return { + title: item + .find('.title') + .text() + .trim(), + description: item + .find('.title') + .text() + .trim(), + author: + '发布部门 - ' + + item + .find('.department') .text() .trim(), - description: item - .find('.title') - .text() - .trim(), - author: - '发布部门 - ' + - item - .find('.department') - .text() - .trim(), - pubDate: item + pubDate: new Date( + item .find('span') .find('span') - .attr('content'), - link: host + item.find('a').attr('href'), - }; - }) - .get(), + .attr('content') + ).toUTCString(), + link: host + item.find('a').attr('href'), + }; + }), }; }; diff --git a/lib/routes/universities/shmtu/jwc.js b/lib/routes/universities/shmtu/jwc.js index a85d4a3d3b6f50..cbdfa27b89d1f3 100644 --- a/lib/routes/universities/shmtu/jwc.js +++ b/lib/routes/universities/shmtu/jwc.js @@ -3,13 +3,8 @@ const cheerio = require('cheerio'); module.exports = async (ctx) => { const host = 'http://jwc.shmtu.edu.cn/Information/'; - let type = ctx.params.type; - let info = '教务新闻'; - if (type === '2') { - info = '教务公告'; - } else { - type = '1'; - } + const type = ctx.params.type; + const info = type === '2' ? '教务公告' : '教务新闻'; const response = await axios({ method: 'get', @@ -28,25 +23,25 @@ module.exports = async (ctx) => { description: `上海海事大学 ${info}`, item: text && - text - .map((index, item) => { - item = $(item); - return { - title: item.find('a').attr('title'), - description: item.find('a').attr('title'), - author: - '信息类别 - ' + - $('.gvItemNormal', item) - .slice(1, 2) - .text() - .trim(), - pubDate: $('.gvItemNormal', item) - .slice(4) + text.map((item) => { + item = $(item); + return { + title: item.find('a').attr('title'), + description: item.find('a').attr('title'), + author: + '信息类别 - ' + + $('.gvItemNormal', item) + .slice(1, 2) .text() .trim(), - link: (host + item.find('a').attr('href')).replace('/Information/..', ''), - }; - }) - .get(), + pubDate: new Date( + $('.gvItemNormal', item) + .slice(4) + .text() + .trim() + ).toUTCString(), + link: (host + item.find('a').attr('href')).replace('/Information/..', ''), + }; + }), }; }; diff --git a/lib/routes/universities/shmtu/notes.js b/lib/routes/universities/shmtu/notes.js index 8ad425d44bc187..ec315fceb61186 100644 --- a/lib/routes/universities/shmtu/notes.js +++ b/lib/routes/universities/shmtu/notes.js @@ -2,7 +2,7 @@ const axios = require('../../../utils/axios'); const cheerio = require('cheerio'); module.exports = async (ctx) => { - const host = 'https://www.shmtu.edu.cn'; + const host = 'http://www.shmtu.edu.cn'; const response = await axios({ method: 'get', @@ -21,33 +21,31 @@ module.exports = async (ctx) => { description: '上海海事大学 通知公告', item: text && - text - .map((index, item) => { - item = $(item); - return { - title: item - .find('.title') + text.map((item) => { + item = $(item); + return { + title: item + .find('.title') + .text() + .trim(), + description: item + .find('.title') + .text() + .trim(), + author: + '发布部门 - ' + + item + .find('.department') .text() .trim(), - description: item - .find('.title') - .text() - .trim(), - author: - '发布部门 - ' + - item - .find('.department') - .text() - .trim(), - pubDate: new Date( - item - .find('span') - .find('span') - .attr('content') - ).toUTCString(), - link: host + item.find('a').attr('href'), - }; - }) - .get(), + pubDate: new Date( + item + .find('span') + .find('span') + .attr('content') + ).toUTCString(), + link: host + item.find('a').attr('href'), + }; + }), }; }; From 08ae33635a031cb3c96792a3dc4423b1f79f4082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=89=E5=87=89?= Date: Mon, 11 Mar 2019 11:02:35 +0800 Subject: [PATCH 17/43] Add: tg channel photo (#1714) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 目前只处理了非私有频道的图片(不包括图片文件)显示 - Closes #903 --- lib/routes/telegram/channel.js | 113 ++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 43 deletions(-) diff --git a/lib/routes/telegram/channel.js b/lib/routes/telegram/channel.js index bb62a5ff2139bd..6b41e3b6555036 100644 --- a/lib/routes/telegram/channel.js +++ b/lib/routes/telegram/channel.js @@ -1,6 +1,7 @@ const axios = require('../../utils/axios'); const config = require('../../config'); const logger = require('../../utils/logger'); +const cheerio = require('cheerio'); let botName = ''; axios({ @@ -18,6 +19,22 @@ module.exports = async (ctx) => { const username = ctx.params.username; const cacheDays = 30; const cacheLength = 5; + const fomatPhoto = async (link) => { + const imgList = []; + const { data } = await axios.get(link + '?embed=1&single=1'); + const $ = cheerio.load(data); + + $('.tgme_widget_message_photo_wrap').each(function() { + const bg = $(this).css('background-image'); + imgList.push(bg.match(/url\('(.+)'\)/)[1]); + }); + return imgList.reduce((acc, img) => { + if (img) { + acc += ``; + } + return acc; + }, ''); + }; let response = await axios({ method: 'get', @@ -41,54 +58,64 @@ module.exports = async (ctx) => { ctx.cache.set(`RSSHubTelegramChannelName${username}`, data[0].channel_post.chat.title, cacheDays * 24 * 60 * 60); // cache post - post = data.map((item) => { - item = item.channel_post; - let text = item.text || item.caption || ''; - const media = ['photo', 'audio', 'document', 'game', 'sticker', 'video', 'voice', 'contact', 'location', 'venue']; - media.forEach((me) => { - if (item[me]) { - text += ` [${me}]`; - } - }); - - let html = text; - - if (item.entities) { - const enter = []; - item.entities.forEach((entity) => { - switch (entity.type) { - case 'text_link': - enter.push([entity.offset, ``], [entity.offset + entity.length, '']); - break; - case 'bold': - enter.push([entity.offset, ''], [entity.offset + entity.length, '']); - break; - case 'hashtag': - case 'italic': - enter.push([entity.offset, ''], [entity.offset + entity.length, '']); - break; + post = await Promise.all( + data.map(async (item) => { + item = item.channel_post; + let text = item.text || item.caption || ''; + let html = text; + const link = `https://t.me/${username}/${item.message_id}`; + const media = ['photo', 'audio', 'document', 'game', 'sticker', 'video', 'voice', 'contact', 'location', 'venue']; + // https://css-tricks.com/why-using-reduce-to-sequentially-resolve-promises-works/ + await media.reduce(async (acc, me) => { + if (item[me]) { + if (item.chat.username && me === 'photo') { + // 暂时只处理非私有频道的图片 + const photos = await fomatPhoto(link); + html += ` ${photos}`; + } + text += ` [${me}]`; } - }); - enter.sort((a, b) => a[0] - b[0]); - if (enter.length) { - html = text.slice(0, enter[0][0]); - enter.forEach((en, index) => { - if (index !== enter.length - 1) { - html += enter[index][1] + text.slice(enter[index][0], enter[index + 1][0]); - } else { - html += enter[index][1] + text.slice(enter[index][0]); + return acc; + }, Promise.resolve()); + + if (item.entities) { + const enter = []; + item.entities.forEach((entity) => { + switch (entity.type) { + case 'text_link': + enter.push([entity.offset, ``], [entity.offset + entity.length, '']); + break; + case 'bold': + enter.push([entity.offset, ''], [entity.offset + entity.length, '']); + break; + case 'hashtag': + case 'italic': + enter.push([entity.offset, ''], [entity.offset + entity.length, '']); + break; } }); + enter.sort((a, b) => a[0] - b[0]); + if (enter.length) { + html = text.slice(0, enter[0][0]); + enter.forEach((en, index) => { + if (index !== enter.length - 1) { + html += enter[index][1] + text.slice(enter[index][0], enter[index + 1][0]); + } else { + html += enter[index][1] + text.slice(enter[index][0]); + } + }); + } } - } - return { - title: text, - description: html, - pubDate: new Date(item.date * 1000).toUTCString(), - link: `https://t.me/${username}/${item.message_id}`, - }; - }); + return Promise.resolve({ + title: text, + description: html, + pubDate: new Date(item.date * 1000).toUTCString(), + link, + }); + }) + ); + if (post.length >= cacheLength) { ctx.cache.set(`RSSHubTelegramChannelPost${username}`, post.slice(0, cacheLength), cacheDays * 24 * 60 * 60); } else { From 776fb0bb0838a2df216329483cdff80207a8edbf Mon Sep 17 00:00:00 2001 From: HuangWei Date: Mon, 11 Mar 2019 11:05:25 +0800 Subject: [PATCH 18/43] [new RSS] Add routes/blogs/jingwei_link for blog https://jingwei.link/ (#1724) --- docs/README.md | 4 ++++ lib/router.js | 4 ++++ lib/routes/blogs/jingwei_link.js | 31 +++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 lib/routes/blogs/jingwei_link.js diff --git a/docs/README.md b/docs/README.md index d71fe3bb80da1a..c376315d691101 100755 --- a/docs/README.md +++ b/docs/README.md @@ -3119,6 +3119,10 @@ type 为 all 时,category 参数不支持 cost 和 free +### 博客: 敬维 + + + ### 裏垢女子まとめ diff --git a/lib/router.js b/lib/router.js index 446f8c350a09ed..839b9be3d53931 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1125,6 +1125,10 @@ router.get('/luogu/daily/:id?', require('./routes/luogu/daily')); // 决胜网 router.get('/juesheng', require('./routes/juesheng')); +// 一些博客 +// 敬维-以认真的态度做完美的事情: https://jingwei.link/ +router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link')); + // 裏垢女子まとめ router.get('/uraaka-joshi', require('./routes/uraaka-joshi/uraaka-joshi')); router.get('/uraaka-joshi/:id', require('./routes/uraaka-joshi/uraaka-joshi-user')); diff --git a/lib/routes/blogs/jingwei_link.js b/lib/routes/blogs/jingwei_link.js new file mode 100644 index 00000000000000..598dd645d79fc5 --- /dev/null +++ b/lib/routes/blogs/jingwei_link.js @@ -0,0 +1,31 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const url = 'https://jingwei.link/'; + const response = await axios({ + method: 'get', + url, + }); + const $ = cheerio.load(response.data); + const resultItem = $("article[class='article-item']") + .map((index, elem) => { + elem = $(elem); + + const $esction = elem.find('section[class="post-preview"]'); + + return { + title: $esction.find('h2').text(), + description: $esction.find('h3').text(), + link: $esction.find('a').attr('href'), + author: '敬维', + }; + }) + .get(); + + ctx.state.data = { + title: '敬维-以认真的态度做完美的事情', + link: url, + item: resultItem, + }; +}; From c105b41ab5d938ebbee7b58aeb3ee7ce67f529e8 Mon Sep 17 00:00:00 2001 From: ciaran <760218327@qq.com> Date: Tue, 12 Mar 2019 14:21:27 +0800 Subject: [PATCH 19/43] =?UTF-8?q?fix:=20xidian=20=E8=B7=AF=E7=94=B1=20(#17?= =?UTF-8?q?31)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/universities/xidian/jwc.js | 69 +++++++++++++-------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/lib/routes/universities/xidian/jwc.js b/lib/routes/universities/xidian/jwc.js index 5b1bff55de071c..86b070e7508874 100644 --- a/lib/routes/universities/xidian/jwc.js +++ b/lib/routes/universities/xidian/jwc.js @@ -13,48 +13,47 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - let list = $('td[bgcolor="#ffffff"]') - .first() - .children(); + const list = $('#__01 > tbody > tr > td:nth-child(2)'); + const titleTables = list.children().filter((index) => index % 2 !== 1); - list = list - .filter((index) => index % 2 !== 0) - .splice(0, 10) - .map((index, item) => { - this.index = index; - item = $(item); - return item - .find('tr') - .find('tr') - .map((index, item) => { - item = $(item); - return { - title: item.find('a').attr('title'), - description: arrC[this.index] + '
' + item.find('a').attr('title') + '

全文内容需使用校园网或VPN获取', - pubDate: new Date( - item - .children() - .last() - .text() - ).toUTCString(), - link: `https://jwc.xidian.edu.cn/${item.find('a').attr('href')}`, - }; - }); - }) - .get(); - let result = []; - if (category === 'all' && arrE.indexOf(category) === -1) { - for (let i = 0; i < list.length; i++) { - result = result.concat(list[i].get()); - } + const parseTable = (index, item) => { + const title = arrC[index]; + const aTags = $(item) + .next() + .find('a'); + return aTags + .map((_, item) => { + item = $(item); + return { + title: item.attr('title'), + description: title + '
' + item.attr('title') + '
全文内容需使用校园网或VPN获取', + pubDate: new Date( + item + .parent() + .next() + .text() + ).toUTCString(), + link: `https://jwc.xidian.edu.cn/${item.attr('href')}`, + }; + }) + .get(); + }; + + const arrIndex = arrE.indexOf(category); + let result; + if (arrIndex === -1) { + result = titleTables.map(parseTable).get(); + result.sort((a, b) => new Date(b.pubDate) - new Date(a.pubDate)); } else { - result = list[arrE.indexOf(category)].get(); + result = parseTable(arrIndex, titleTables[arrIndex]); } ctx.state.data = { title: '西电教务处', link: 'https://jwc.xidian.edu.cn', - description: $('meta[Name="keywords"]').attr('Content'), + description: $('title') + .text() + .concat(arrIndex === -1 ? '' : '-' + arrC[arrIndex]), item: result, }; }; From 1788bdb7d9fec7f4d456bc7bb6f2cec433d4b0b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Tue, 12 Mar 2019 14:21:52 +0800 Subject: [PATCH 20/43] Update dependency jest to v24.4.0 (#1732) --- package.json | 2 +- yarn.lock | 350 ++++++++++++++++++++++++++------------------------- 2 files changed, 179 insertions(+), 173 deletions(-) diff --git a/package.json b/package.json index 1c3ef6219c6f99..bd03ef2b94285c 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "eslint": "5.15.1", "eslint-config-prettier": "4.1.0", "eslint-plugin-prettier": "3.0.1", - "jest": "24.3.1", + "jest": "24.4.0", "lint-staged": "8.1.5", "mockdate": "2.0.2", "nodemon": "1.18.10", diff --git a/yarn.lock b/yarn.lock index 95eff51c1af415..e43e18590e7bdc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,31 +882,31 @@ chalk "^2.0.1" slash "^2.0.0" -"@jest/core@^24.3.1": - version "24.3.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.3.1.tgz#9811596d9fcc6dbb3d4062c67e4c4867bc061585" - integrity sha512-orucOIBKfXgm1IJirtPT0ToprqDVGYKUNJKNc9a6v1Lww6qLPq+xj5OfxyhpJb2rWOgzEkATW1bfZzg3oqV70w== +"@jest/core@^24.4.0": + version "24.4.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.4.0.tgz#ec53510f19dde5aaf4e9e28a3c3426fc0f2a41d6" + integrity sha512-S48krBwigVm3DwLSEtMiiWnWz+G3uGii192LIZYbWULYSOCwQeG7hWb6a3yWBLYuZnATh3W6QMxs7whS0/hQMQ== dependencies: "@jest/console" "^24.3.0" - "@jest/reporters" "^24.3.1" + "@jest/reporters" "^24.4.0" "@jest/test-result" "^24.3.0" - "@jest/transform" "^24.3.1" + "@jest/transform" "^24.4.0" "@jest/types" "^24.3.0" ansi-escapes "^3.0.0" chalk "^2.0.1" exit "^0.1.2" graceful-fs "^4.1.15" jest-changed-files "^24.3.0" - jest-config "^24.3.1" - jest-haste-map "^24.3.1" + jest-config "^24.4.0" + jest-haste-map "^24.4.0" jest-message-util "^24.3.0" jest-regex-util "^24.3.0" - jest-resolve-dependencies "^24.3.1" - jest-runner "^24.3.1" - jest-runtime "^24.3.1" - jest-snapshot "^24.3.1" + jest-resolve-dependencies "^24.4.0" + jest-runner "^24.4.0" + jest-runtime "^24.4.0" + jest-snapshot "^24.4.0" jest-util "^24.3.0" - jest-validate "^24.3.1" + jest-validate "^24.4.0" jest-watcher "^24.3.0" micromatch "^3.1.10" p-each-series "^1.0.0" @@ -915,13 +915,13 @@ rimraf "^2.5.4" strip-ansi "^5.0.0" -"@jest/environment@^24.3.1": - version "24.3.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.3.1.tgz#1fbda3ec8fb8ffbaee665d314da91d662227e11e" - integrity sha512-M8bqEkQqPwZVhMMFMqqCnzqIZtuM5vDMfFQ9ZvnEfRT+2T1zTA4UAOH/V4HagEi6S3BCd/mdxFdYmPgXf7GKCA== +"@jest/environment@^24.4.0": + version "24.4.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.4.0.tgz#552f0629a9cc2bd015f370b3af77222f069f158f" + integrity sha512-YuPsWWwTS4wkMsvCNXvBZPZQGOVtsVyle9OzHIAdWvV+B9qjs0vA85Il1+FSG0b765VqznPvpfIe1wKoIFOleQ== dependencies: "@jest/fake-timers" "^24.3.0" - "@jest/transform" "^24.3.1" + "@jest/transform" "^24.4.0" "@jest/types" "^24.3.0" "@types/node" "*" jest-mock "^24.3.0" @@ -936,14 +936,14 @@ jest-message-util "^24.3.0" jest-mock "^24.3.0" -"@jest/reporters@^24.3.1": - version "24.3.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.3.1.tgz#68e4abc8d4233acd0dd87287f3bd270d81066248" - integrity sha512-jEIDJcvk20ReUW1Iqb+prlAcFV+kfFhQ/01poCq8X9As7/l/2y1GqVwJ3+6SaPTZuCXh0d0LVDy86zDAa8zlVA== +"@jest/reporters@^24.4.0": + version "24.4.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.4.0.tgz#e1e6ca29593f36088db76a380f04e93e71f09607" + integrity sha512-teO0to16UaYJTLWXCWCa1kBPx/PY4dw2/8I2LPIzk5mNN5km8jyx5jz8D1Yy0nqascVtbpG4+VnSt7E16cnrcw== dependencies: - "@jest/environment" "^24.3.1" + "@jest/environment" "^24.4.0" "@jest/test-result" "^24.3.0" - "@jest/transform" "^24.3.1" + "@jest/transform" "^24.4.0" "@jest/types" "^24.3.0" chalk "^2.0.1" exit "^0.1.2" @@ -952,11 +952,11 @@ istanbul-lib-coverage "^2.0.2" istanbul-lib-instrument "^3.0.1" istanbul-lib-source-maps "^3.0.1" - jest-haste-map "^24.3.1" - jest-resolve "^24.3.1" - jest-runtime "^24.3.1" + jest-haste-map "^24.4.0" + jest-resolve "^24.4.0" + jest-runtime "^24.4.0" jest-util "^24.3.0" - jest-worker "^24.3.1" + jest-worker "^24.4.0" node-notifier "^5.2.1" slash "^2.0.0" source-map "^0.6.0" @@ -980,10 +980,10 @@ "@jest/types" "^24.3.0" "@types/istanbul-lib-coverage" "^1.1.0" -"@jest/transform@^24.3.1": - version "24.3.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.3.1.tgz#ce9e1329eb5e640f493bcd5c8eb9970770959bfc" - integrity sha512-PpjylI5goT4Si69+qUjEeHuKjex0LjjrqJzrMYzlOZn/+SCumGKuGC0UQFeEPThyGsFvWH1Q4gj0R66eOHnIpw== +"@jest/transform@^24.4.0": + version "24.4.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.4.0.tgz#2f6b4b5dc7f7673d8fec8bf1040d4236c58c7a60" + integrity sha512-Y928pU6bqWqMlGugRiaWOresox/CIrRuBVdPnYiSoIcRtwNKZujCOkzIzRalcTTxm77wuLjNihcq8OWfdm+Dxg== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^24.3.0" @@ -992,7 +992,7 @@ convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.1.15" - jest-haste-map "^24.3.1" + jest-haste-map "^24.4.0" jest-regex-util "^24.3.0" jest-util "^24.3.0" micromatch "^3.1.10" @@ -1764,12 +1764,12 @@ babel-helper-vue-jsx-merge-props@^2.0.3: resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6" integrity sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg== -babel-jest@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.3.1.tgz#168468a37e90426520c5293da4f55e1a512063b0" - integrity sha512-6KaXyUevY0KAxD5Ba+EBhyfwvc+R2f7JV7BpBZ5T8yJGgj0M1hYDfRhDq35oD5MzprMf/ggT81nEuLtMyxfDIg== +babel-jest@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.4.0.tgz#6c4029f52175d4f8f138cdad42d2a02fe34ddb03" + integrity sha512-wh23nKbWZf9SeO0GNOQc2QDqaMXOmbaI2Hvbcl6FGqg9zqHwr9Jy0e0ZqsXiJ2Cv8YKqD+eOE2wAGVhq4nzWDQ== dependencies: - "@jest/transform" "^24.3.1" + "@jest/transform" "^24.4.0" "@jest/types" "^24.3.0" "@types/babel__core" "^7.1.0" babel-plugin-istanbul "^5.1.0" @@ -3871,15 +3871,15 @@ expand-template@^2.0.3: resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== -expect@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.3.1.tgz#7c42507da231a91a8099d065bc8dc9322dc85fc0" - integrity sha512-xnmobSlaqhg4FKqjb5REk4AobQzFMJoctDdREKfSGqrtzRfCWYbfqt3WmikAvQz/J8mCNQhORgYdEjPMJbMQPQ== +expect@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.4.0.tgz#df52da212bc06831c38fb51a53106ae7a0e7aaf2" + integrity sha512-p3QGkNhxN4WXih12lOx4vuhJpl/ZFD1AWu9lWh8IXNZD10ySSOzDN4Io8zuEOWvzylFkDpU9oQ/KRTZ/Bs9/ag== dependencies: "@jest/types" "^24.3.0" ansi-styles "^3.2.0" jest-get-type "^24.3.0" - jest-matcher-utils "^24.3.1" + jest-matcher-utils "^24.4.0" jest-message-util "^24.3.0" jest-regex-util "^24.3.0" @@ -5532,56 +5532,56 @@ jest-changed-files@^24.3.0: execa "^1.0.0" throat "^4.0.0" -jest-cli@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.3.1.tgz#52e4ae5f11044b41e06ca39fc7a7302fbbcb1661" - integrity sha512-HdwMgigvDQdlWX7gwM2QMkJJRqSk7tTYKq7kVplblK28RarqquJMWV/lOCN8CukuG9u3DZTeXpCDXR7kpGfB3w== +jest-cli@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.4.0.tgz#3297c2f817611b86ce1250fb5703a28bca201034" + integrity sha512-QQOgpRpXoDqpxhEux/AGyI9XJzVOJ5ppz4Kb9MlA5PvzsyYD3DRk/uiyJgmvBhCCXvcA1CKEl/g/LH0kbKg10Q== dependencies: - "@jest/core" "^24.3.1" + "@jest/core" "^24.4.0" "@jest/test-result" "^24.3.0" "@jest/types" "^24.3.0" chalk "^2.0.1" exit "^0.1.2" import-local "^2.0.0" is-ci "^2.0.0" - jest-config "^24.3.1" + jest-config "^24.4.0" jest-util "^24.3.0" - jest-validate "^24.3.1" + jest-validate "^24.4.0" prompts "^2.0.1" realpath-native "^1.1.0" yargs "^12.0.2" -jest-config@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.3.1.tgz#271aff2d3aeabf1ff92512024eeca3323cd31a07" - integrity sha512-ujHQywsM//vKFvJwEC02KNZgKAGOzGz1bFPezmTQtuj8XdfsAVq8p6N/dw4yodXV11gSf6TJ075i4ehM+mKatA== +jest-config@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.4.0.tgz#07bf14d43c02aec3bd384121a165a6ee9d8c5ed1" + integrity sha512-H2R6qkfUPck+OlIWsjeShecbqYiEDUvzZfsfgQkx6LVakAORy7wZFptONVF+Qz7iO9Bl6x35cBA2A1o1W+ctDg== dependencies: "@babel/core" "^7.1.0" "@jest/types" "^24.3.0" - babel-jest "^24.3.1" + babel-jest "^24.4.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^24.3.1" - jest-environment-node "^24.3.1" + jest-environment-jsdom "^24.4.0" + jest-environment-node "^24.4.0" jest-get-type "^24.3.0" - jest-jasmine2 "^24.3.1" + jest-jasmine2 "^24.4.0" jest-regex-util "^24.3.0" - jest-resolve "^24.3.1" + jest-resolve "^24.4.0" jest-util "^24.3.0" - jest-validate "^24.3.1" + jest-validate "^24.4.0" micromatch "^3.1.10" - pretty-format "^24.3.1" + pretty-format "^24.4.0" realpath-native "^1.1.0" -jest-diff@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.3.1.tgz#87952e5ea1548567da91df398fa7bf7977d3f96a" - integrity sha512-YRVzDguyzShP3Pb9wP/ykBkV7Z+O4wltrMZ2P4LBtNxrHNpxwI2DECrpD9XevxWubRy5jcE8sSkxyX3bS7W+rA== +jest-diff@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.4.0.tgz#106cd0491cb32da31debbea3e21f094d358dc7d9" + integrity sha512-2GdKN8GOledWkMGXcRCSr3KVTrjZU6vxbfZzwzRlM7gSG8HNIx+eoFXauQNQ5j7q73fZCoPnyS5/uOcXQ3wkWg== dependencies: chalk "^2.0.1" diff-sequences "^24.3.0" jest-get-type "^24.3.0" - pretty-format "^24.3.1" + pretty-format "^24.4.0" jest-docblock@^24.3.0: version "24.3.0" @@ -5590,35 +5590,35 @@ jest-docblock@^24.3.0: dependencies: detect-newline "^2.1.0" -jest-each@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.3.1.tgz#ed8fe8b9f92a835a6625ca8c7ee06bc904440316" - integrity sha512-GTi+nxDaWwSgOPLiiqb/p4LURy0mv3usoqsA2eoTYSmRsLgjgZ6VUyRpUBH5JY9EMBx33suNFXk0iyUm29WRpw== +jest-each@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.4.0.tgz#2a0e06d957b31ec9ca4679ed9d4a15ac48299d6b" + integrity sha512-W98N4Ep6BBdCanynA9jdJDUaPvZ9OAnIHNA8mK6kbH7JYdnNQKGvp5ivl/PjCTqiI2wnHKYRI06EjsfOqT8ZFQ== dependencies: "@jest/types" "^24.3.0" chalk "^2.0.1" jest-get-type "^24.3.0" jest-util "^24.3.0" - pretty-format "^24.3.1" + pretty-format "^24.4.0" -jest-environment-jsdom@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.3.1.tgz#49826bcf12fb3e38895f1e2aaeb52bde603cc2e4" - integrity sha512-rz2OSYJiQerDqWDwjisqRwhVNpwkqFXdtyMzEuJ47Ip9NRpRQ+qy7/+zFujPUy/Z+zjWRO5seHLB/dOD4VpEVg== +jest-environment-jsdom@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.4.0.tgz#86e1c494abb1ab58b7aa5791bdb4fa96d709b57b" + integrity sha512-7irZXPZLQF79r97uH9dG9mm76H+27CMSH8TEcF70x6pY4xFJipjjluiXRw1C2lh0o6FrbSQKpkSXncdOw+hY0A== dependencies: - "@jest/environment" "^24.3.1" + "@jest/environment" "^24.4.0" "@jest/fake-timers" "^24.3.0" "@jest/types" "^24.3.0" jest-mock "^24.3.0" jest-util "^24.3.0" jsdom "^11.5.1" -jest-environment-node@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.3.1.tgz#333d864c569b27658a96bb3b10e02e7172125415" - integrity sha512-Xy+/yFem/yUs9OkzbcawQT237vwDjBhAVLjac1KYAMYVjGb0Vb/Ovw4g61PunVdrEIpfcXNtRUltM4+9c7lARQ== +jest-environment-node@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.4.0.tgz#c10cd617ccc73c1936d46a925e9dcade8709d044" + integrity sha512-ed1TjncsHO+Ird4BDrWwqsMQQM+bg9AFHj0AcCumgzfc+Us6ywWUQUg+5UbKLKnu1EWp5mK7mmbLxLqdz2kc9w== dependencies: - "@jest/environment" "^24.3.1" + "@jest/environment" "^24.4.0" "@jest/fake-timers" "^24.3.0" "@jest/types" "^24.3.0" jest-mock "^24.3.0" @@ -5629,59 +5629,59 @@ jest-get-type@^24.3.0: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.3.0.tgz#582cfd1a4f91b5cdad1d43d2932f816d543c65da" integrity sha512-HYF6pry72YUlVcvUx3sEpMRwXEWGEPlJ0bSPVnB3b3n++j4phUEoSPcS6GC0pPJ9rpyPSe4cb5muFo6D39cXow== -jest-haste-map@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.3.1.tgz#b4a66dbe1e6bc45afb9cd19c083bff81cdd535a1" - integrity sha512-OTMQle+astr1lWKi62Ccmk2YWn6OtUoU/8JpJdg8zdsnpFIry/k0S4sQ4nWocdM07PFdvqcthWc78CkCE6sXvA== +jest-haste-map@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.4.0.tgz#a969ecab8a9521115c5fecec82366d66433c851b" + integrity sha512-X20xhhPBjbz4UVTN9BMBjlFUM/gmi1TmYWWxZUgLg4fZXMIve4RUdA/nS/QgC76ouGgvwb9z52KwZ85bmNx55A== dependencies: "@jest/types" "^24.3.0" fb-watchman "^2.0.0" graceful-fs "^4.1.15" invariant "^2.2.4" - jest-serializer "^24.3.0" + jest-serializer "^24.4.0" jest-util "^24.3.0" - jest-worker "^24.3.1" + jest-worker "^24.4.0" micromatch "^3.1.10" sane "^4.0.3" -jest-jasmine2@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.3.1.tgz#127d628d3ac0829bd3c0fccacb87193e543b420b" - integrity sha512-STo6ar1IyPlIPq9jPxDQhM7lC0dAX7KKN0LmCLMlgJeXwX+1XiVdtZDv1a4zyg6qhNdpo1arOBGY0BcovUK7ug== +jest-jasmine2@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.4.0.tgz#f1d3749b1fc4a90cbdca1480f0ce932d135b69e5" + integrity sha512-J9A0SKWuUNDmXKU+a3Yj69NmUXK7R3btHHu1ZMpjHKlMoHggVjdzsolpNHELCENBOTXvcLXqEH0Xm+pYRoNfMw== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^24.3.1" + "@jest/environment" "^24.4.0" "@jest/test-result" "^24.3.0" "@jest/types" "^24.3.0" chalk "^2.0.1" co "^4.6.0" - expect "^24.3.1" + expect "^24.4.0" is-generator-fn "^2.0.0" - jest-each "^24.3.1" - jest-matcher-utils "^24.3.1" + jest-each "^24.4.0" + jest-matcher-utils "^24.4.0" jest-message-util "^24.3.0" - jest-runtime "^24.3.1" - jest-snapshot "^24.3.1" + jest-runtime "^24.4.0" + jest-snapshot "^24.4.0" jest-util "^24.3.0" - pretty-format "^24.3.1" + pretty-format "^24.4.0" throat "^4.0.0" -jest-leak-detector@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.3.1.tgz#ed89d05ca07e91b2b51dac1f676ab354663aa8da" - integrity sha512-GncRwEtAw/SohdSyY4bk2RE06Ac1dZrtQGZQ2j35hSuN4gAAAKSYMszJS2WDixsAEaFN+GHBHG+d8pjVGklKyw== +jest-leak-detector@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.4.0.tgz#f255d2f582b8dda7b960e04a42f7239b7ec6520b" + integrity sha512-PAo0y19ZkWZWYmdoPAQKpYTDt7IGwrTFhIwGmHO1xkRjzAWW8zcCoiMLrFwNSi9rir2ZH7el8gXZ0d2mmU7O9Q== dependencies: - pretty-format "^24.3.1" + pretty-format "^24.4.0" -jest-matcher-utils@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.3.1.tgz#025e1cd9c54a5fde68e74b12428775d06d123aa8" - integrity sha512-P5VIsUTJeI0FYvWVMwEHjxK1L83vEkDiKMV0XFPIrT2jzWaWPB2+dPCHkP2ID9z4eUKElaHqynZnJiOdNVHfXQ== +jest-matcher-utils@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.4.0.tgz#285a2a5c8414d2f4a62d89ddc4b381730e2b717d" + integrity sha512-JDWrJ1G+GfxtEQlX7DlCV/0sk0uYbnra0jVl3DiDbS0FUX0HeGA1CxRW/U87LB3XNHQydhBKbXgf+pDCiUCn4w== dependencies: chalk "^2.0.1" - jest-diff "^24.3.1" + jest-diff "^24.4.0" jest-get-type "^24.3.0" - pretty-format "^24.3.1" + pretty-format "^24.4.0" jest-message-util@^24.3.0: version "24.3.0" @@ -5704,105 +5704,111 @@ jest-mock@^24.3.0: dependencies: "@jest/types" "^24.3.0" +jest-pnp-resolver@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" + integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== + jest-regex-util@^24.3.0: version "24.3.0" resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== -jest-resolve-dependencies@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.3.1.tgz#a22839d611ba529a74594ee274ce2b77d046bea9" - integrity sha512-9JUejNImGnJjbNR/ttnod+zQIWANpsrYMPt18s2tYGK6rP191qFsyEQ2BhAQMdYDRkTmi8At+Co9tL+jTPqdpw== +jest-resolve-dependencies@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.4.0.tgz#296420c04211d2697dfe3141744e7071028ea9b0" + integrity sha512-3ssDSve3iSsIKm5daivq1mrCaBVFAa+TMG4qardNPoi7IJfupDUETIBCXYF9GRtIfNuD/dJOSag4u6oMHRxTGg== dependencies: "@jest/types" "^24.3.0" jest-regex-util "^24.3.0" - jest-snapshot "^24.3.1" + jest-snapshot "^24.4.0" -jest-resolve@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.3.1.tgz#103dbd438b59618ea428ec4acbd65c56495ba397" - integrity sha512-N+Q3AcVuKxpn/kjQMxUVLwBk32ZE1diP4MPcHyjVwcKpCUuKrktfRR3Mqe/T2HoD25wyccstaqcPUKIudl41bg== +jest-resolve@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.4.0.tgz#5314af3cc9abc8d2de55c6e78edac4253c2f46f3" + integrity sha512-XvMIuDH6wQi76YJfNG40iolXP2l+fA+LLORGgNSZ5VgowCeyV/XVygTN4L3No3GP1cthUdl/ULzWBd2CfYmTkw== dependencies: "@jest/types" "^24.3.0" browser-resolve "^1.11.3" chalk "^2.0.1" + jest-pnp-resolver "^1.2.1" realpath-native "^1.1.0" -jest-runner@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.3.1.tgz#5488566fa60cdb4b00a89c734ad6b54b9561415d" - integrity sha512-Etc9hQ5ruwg+q7DChm+E8qzHHdNTLeUdlo+whPQRSpNSgl0AEgc2r2mT4lxODREqmnHg9A8JHA44pIG4GE0Gzg== +jest-runner@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.4.0.tgz#71ad09858be897cc37da1bf88bf67baaa0219fdb" + integrity sha512-eCuEMDbJknyKEUBWBDebW3GQ6Ty8wwB3YqDjFb4p3UQozA2HarPq0n9N83viq18vvZ/BDrQvW6RLdZaiLipM4Q== dependencies: "@jest/console" "^24.3.0" - "@jest/environment" "^24.3.1" + "@jest/environment" "^24.4.0" "@jest/test-result" "^24.3.0" "@jest/types" "^24.3.0" chalk "^2.4.2" exit "^0.1.2" graceful-fs "^4.1.15" - jest-config "^24.3.1" + jest-config "^24.4.0" jest-docblock "^24.3.0" - jest-haste-map "^24.3.1" - jest-jasmine2 "^24.3.1" - jest-leak-detector "^24.3.1" + jest-haste-map "^24.4.0" + jest-jasmine2 "^24.4.0" + jest-leak-detector "^24.4.0" jest-message-util "^24.3.0" - jest-resolve "^24.3.1" - jest-runtime "^24.3.1" + jest-resolve "^24.4.0" + jest-runtime "^24.4.0" jest-util "^24.3.0" - jest-worker "^24.3.1" + jest-worker "^24.4.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.3.1.tgz#2798230b4fbed594b375a13e395278694d4751e2" - integrity sha512-Qz/tJWbZ2naFJ2Kvy1p+RhhRgsPYh4e6wddVRy6aHBr32FTt3Ja33bfV7pkMFWXFbVuAsJMJVdengbvdhWzq4A== +jest-runtime@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.4.0.tgz#77df2137d1cb78a30f8b7c52cc06427272e06334" + integrity sha512-wmopIA6EqgfSvYmqFvfZViJy5LCyIATUSRRt16HQDNN4ypWUQAaFwZ9fpbPo7e2UnKHTe2CK0dCRB1o/a6JUfQ== dependencies: "@jest/console" "^24.3.0" - "@jest/environment" "^24.3.1" + "@jest/environment" "^24.4.0" "@jest/source-map" "^24.3.0" - "@jest/transform" "^24.3.1" + "@jest/transform" "^24.4.0" "@jest/types" "^24.3.0" "@types/yargs" "^12.0.2" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.1.15" - jest-config "^24.3.1" - jest-haste-map "^24.3.1" + jest-config "^24.4.0" + jest-haste-map "^24.4.0" jest-message-util "^24.3.0" jest-mock "^24.3.0" jest-regex-util "^24.3.0" - jest-resolve "^24.3.1" - jest-snapshot "^24.3.1" + jest-resolve "^24.4.0" + jest-snapshot "^24.4.0" jest-util "^24.3.0" - jest-validate "^24.3.1" + jest-validate "^24.4.0" realpath-native "^1.1.0" slash "^2.0.0" strip-bom "^3.0.0" yargs "^12.0.2" -jest-serializer@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.3.0.tgz#074e307300d1451617cf2630d11543ee4f74a1c8" - integrity sha512-RiSpqo2OFbVLJN/PgAOwQIUeHDfss6NBUDTLhjiJM8Bb5rMrwRqHfkaqahIsOf9cXXB5UjcqDCzbQ7AIoMqWkg== +jest-serializer@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" + integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== -jest-snapshot@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.3.1.tgz#0f22a86c1b8c87e823f5ad095e82c19d9ed93d72" - integrity sha512-7wbNJWh0sBjmoaexTOWqS7nleTQME7o2W9XKU6CHCxG49Thjct4aVPC/QPNF5NHnvf4M/VDmudIDbwz6noJTRA== +jest-snapshot@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.4.0.tgz#7e76ff377cf84af65e37b46c48bbda555e7545da" + integrity sha512-h+xO+ZQC+XEcf5wsy6+yducTKw6ku+oS5E2eJZI4YI65AT/lvbMjKgulgQWUOxga4HP0qHnz9uwa67/Zo7jVrw== dependencies: "@babel/types" "^7.0.0" "@jest/types" "^24.3.0" chalk "^2.0.1" - expect "^24.3.1" - jest-diff "^24.3.1" - jest-matcher-utils "^24.3.1" + expect "^24.4.0" + jest-diff "^24.4.0" + jest-matcher-utils "^24.4.0" jest-message-util "^24.3.0" - jest-resolve "^24.3.1" + jest-resolve "^24.4.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^24.3.1" + pretty-format "^24.4.0" semver "^5.5.0" jest-util@^24.3.0: @@ -5824,17 +5830,17 @@ jest-util@^24.3.0: slash "^2.0.0" source-map "^0.6.0" -jest-validate@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.3.1.tgz#9359eea5a767a3d20b4fa7a5764fd78330ba8312" - integrity sha512-ww3+IPNCOEMi1oKlrHdSnBXetXtdrrdSh0bqLNTVkWglduhORf94RJWd1ko9oEPU2TcEQS5QIPacYziQIUzc4A== +jest-validate@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.4.0.tgz#4f19c7d738a6bb700620c766428c7738d6985555" + integrity sha512-XESrpRYneLmiN9ayFm9RhBV5dwmhRZ+LbebScuuQ5GsY6ILpX9UeUMUdQ5Iz++YxFsmn5Lyi/Wkw6EV4v7nNTg== dependencies: "@jest/types" "^24.3.0" camelcase "^5.0.0" chalk "^2.0.1" jest-get-type "^24.3.0" leven "^2.1.0" - pretty-format "^24.3.1" + pretty-format "^24.4.0" jest-watcher@^24.3.0: version "24.3.0" @@ -5850,22 +5856,22 @@ jest-watcher@^24.3.0: jest-util "^24.3.0" string-length "^2.0.0" -jest-worker@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.3.1.tgz#c1759dd2b1d5541b09a2e5e1bc3288de6c9d8632" - integrity sha512-ZCoAe/iGLzTJvWHrO8fyx3bmEQhpL16SILJmWHKe8joHhyF3z00psF1sCRT54DoHw5GJG0ZpUtGy+ylvwA4haA== +jest-worker@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.4.0.tgz#fbc452b0120bb5c2a70cdc88fa132b48eeb11dd0" + integrity sha512-BH9X/klG9vxwoO99ZBUbZFfV8qO0XNZ5SIiCyYK2zOuJBl6YJVAeNIQjcoOVNu4HGEHeYEKsUWws8kSlSbZ9YQ== dependencies: "@types/node" "*" merge-stream "^1.0.1" supports-color "^6.1.0" -jest@24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.3.1.tgz#81959de0d57b2df923510f4fafe266712d37dcca" - integrity sha512-SqZguEbYNcZ3r0KUUBN+IkKfyPS1VBbIUiK4Wrc0AiGUR52gJa0fmlWSOCL3x25908QrfoQwkVDu5jCsfXb2ig== +jest@24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.4.0.tgz#688b71a2dadd41e26d0cfc04e1ddcacf30a1efbb" + integrity sha512-gAGfjvu8hHN0N6/aDyCBpncWWBcpY6wq69Msq/I6Xd763q/ZYBEMh0SKUomrViFoJ/dyistA6b4aJh8e+5QMyw== dependencies: import-local "^2.0.0" - jest-cli "^24.3.1" + jest-cli "^24.4.0" joi@^11.1.1: version "11.4.0" @@ -8199,10 +8205,10 @@ pretty-error@^2.0.2: renderkid "^2.0.1" utila "~0.4" -pretty-format@^24.3.1: - version "24.3.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.3.1.tgz#ae4a98e93d73d86913a8a7dd1a7c3c900f8fda59" - integrity sha512-NZGH1NWS6o4i9pvRWLsxIK00JB9pqOUzVrO7yWT6vjI2thdxwvxefBJO6O5T24UAhI8P5dMceZ7x5wphgVI7Mg== +pretty-format@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.4.0.tgz#48db91969eb89f272c1bf3514bc5d5b228b3e722" + integrity sha512-SEXFzT01NwO4vaymwhz1/CM+wKCLOT92uqrzxIjmdRQMt7JAEuZ2eInCMvDS+4ZidEB+Rdq+fMs/Vwse8VAh1A== dependencies: "@jest/types" "^24.3.0" ansi-regex "^4.0.0" From 43c5c95690c2f13eed75af4664193ebd56544a35 Mon Sep 17 00:00:00 2001 From: SettingDust Date: Tue, 12 Mar 2019 14:24:49 +0800 Subject: [PATCH 21/43] MP4BA (#1711) --- docs/README.md | 17 ++++++ lib/router.js | 3 + lib/routes/mp4ba/index.js | 124 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 lib/routes/mp4ba/index.js diff --git a/docs/README.md b/docs/README.md index c376315d691101..4f08a974d314ec 100755 --- a/docs/README.md +++ b/docs/README.md @@ -1096,6 +1096,23 @@ GitHub 官方也提供了一些 RSS: +### Mp4Ba + +**类型参考这里** +| 1 | 2 | 3 | 4 | +| - | - | - | - | +| 电影 | 连续剧 | 综艺 | 动画 | + +| 5 | 6 | 7 | 8 | 9 | +| ------ | ------ | ------ | ------ | ------ | +| 动作片 | 喜剧片 | 爱情片 | 科幻片 | 恐怖片 | + +| 10 | 11 | 12 | 13 | 14 | 15 | +| ------ | ------ | ------ | ------ | ------ | ------ | +| 剧情片 | 战争片 | 国产剧 | 港台剧 | 日韩剧 | 欧美剧 | + + + ## 图片 ### 妹子图 diff --git a/lib/router.js b/lib/router.js index 839b9be3d53931..85388e1e8af5f6 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1133,4 +1133,7 @@ router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link')); router.get('/uraaka-joshi', require('./routes/uraaka-joshi/uraaka-joshi')); router.get('/uraaka-joshi/:id', require('./routes/uraaka-joshi/uraaka-joshi-user')); +// MP4吧 +router.get('/mp4ba/:param', require('./routes/mp4ba')); + module.exports = router; diff --git a/lib/routes/mp4ba/index.js b/lib/routes/mp4ba/index.js new file mode 100644 index 00000000000000..5fd4f3680d2628 --- /dev/null +++ b/lib/routes/mp4ba/index.js @@ -0,0 +1,124 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); + +const baseUrl = 'http://www.mp4ba.com'; + +class ParamType { + static get paramType() { + return { type: 0, search: 1 }; + } + + constructor(param) { + this._param = param; + + if (param.match(/\d{1,2}/)) { + this._type = ParamType.paramType.type; // 参数为1-2位数字即为类型RSS + } else { + this._type = ParamType.paramType.search; // 其他情况为搜索 + } + } + + get param() { + return this._param; + } + + get type() { + return this._type; + } + + get url() { + let url; + if (!this._url) { + switch (this._type) { + case ParamType.paramType.type: + url = `${baseUrl}/?m=vod-type-id-${this._param}.html`; + break; + case ParamType.paramType.search: + url = `${baseUrl}/index.php?m=vod-search&wd=${this._param}`; + break; + } + this._url = url; + } + return this._url; + } +} + +async function buildRss($, paramType, ctx) { + const $list = (selector) => $('#data_list').find(selector); // 列表对象 + const title = $('title').text(); + const typeString = title.substring(0, title.indexOf('-')); + + function buildDesc() { + let desc = ''; + switch (paramType.type) { + case ParamType.paramType.type: + desc = `${typeString}类型`; + break; + case ParamType.paramType.search: + desc = `${typeString}的搜索结果`; + break; + } + return desc; + } + + async function buildItem($) { + return await Promise.all( + $('.alt1') + .map(async (_, result) => { + const $ = cheerio.load(result); + const $a = $('td') + .eq(2) + .children('a'); + const pageUrl = `${baseUrl}${$a.attr('href')}`; + const { cache } = ctx; + const title = $a.text().replace('.Mp4Ba', ''); + const link = pageUrl; + const guid = pageUrl.match(/\d+/); + let description = null; + const enclosure_type = 'application/x-bittorrent'; + let $magnet = null; + + async function getDescription() { + const key = `Mp4Ba${pageUrl.match(/\d+/)}`; + const value = await ctx.cache.get(key); + if (value) { + description = value; + const $ = cheerio.load(value); + $magnet = $('a[href^="magnet:?xt=urn:btih:"]'); + } else { + const pageData = (await axios.get(pageUrl)).data; + const $page = cheerio.load(pageData); + $magnet = $page('.main') + .find('.down_list') + .find('a[href^="magnet:?xt=urn:btih:"]'); + description = $page('.main') + .find('.intro') + .html(); + cache.set(key, description, 24 * 60 * 60); + } + } + + await getDescription(); + const enclosure_url = $magnet.attr('href'); + return { title, link, description, enclosure_url, enclosure_type, guid }; + }) + .get() + ); + } + + return { + title: `${typeString} - 高清MP4吧`, + link: paramType.url, + description: buildDesc(), + item: await buildItem($list), + }; +} + +module.exports = async (ctx) => { + const { params } = ctx; + const { param } = params; + const paramType = new ParamType(param); + const { data } = await axios.get(encodeURI(paramType.url)); + const $ = cheerio.load(data); + ctx.state.data = await buildRss($, paramType, ctx); +}; From 5eab3a4a693b5b97e39f767f840c64a2a6bcf0a0 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 12 Mar 2019 14:44:28 +0800 Subject: [PATCH 22/43] fix null cache type, close #1728 #1730 --- lib/middleware/cache.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/middleware/cache.js b/lib/middleware/cache.js index 71b490c28bd2a1..5feddf2f40b8ed 100644 --- a/lib/middleware/cache.js +++ b/lib/middleware/cache.js @@ -109,6 +109,11 @@ module.exports = function(app, options = {}) { } }; available = true; + } else { + app.context.cache = { + get: () => null, + set: () => null, + }; } app.context.cache.tryGet = async function(key, getValueFunc, maxAge = 24 * 60 * 60) { From 03f47d94009b7f93e9b389ad6a4f73c340568440 Mon Sep 17 00:00:00 2001 From: fengkx Date: Tue, 12 Mar 2019 14:46:01 +0800 Subject: [PATCH 23/43] add maitta route (#1725) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add maitta route * 更换请求源 --- docs/README.md | 4 +++ lib/router.js | 3 +++ lib/routes/maitta/index.js | 50 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 lib/routes/maitta/index.js diff --git a/docs/README.md b/docs/README.md index 4f08a974d314ec..d51eb08b19bea8 100755 --- a/docs/README.md +++ b/docs/README.md @@ -3136,6 +3136,10 @@ type 为 all 时,category 参数不支持 cost 和 free +### 播客 IBC 岩手放送| IBC ラジオ イヤーマイッタマイッタ + + + ### 博客: 敬维 diff --git a/lib/router.js b/lib/router.js index 85388e1e8af5f6..fa0bd2fba4c471 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1125,6 +1125,9 @@ router.get('/luogu/daily/:id?', require('./routes/luogu/daily')); // 决胜网 router.get('/juesheng', require('./routes/juesheng')); +// 播客IBCラジオ イヤーマイッタマイッタ +router.get('/maitta', require('./routes/maitta')); + // 一些博客 // 敬维-以认真的态度做完美的事情: https://jingwei.link/ router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link')); diff --git a/lib/routes/maitta/index.js b/lib/routes/maitta/index.js new file mode 100644 index 00000000000000..c1c5299b567025 --- /dev/null +++ b/lib/routes/maitta/index.js @@ -0,0 +1,50 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); +const url = 'https://www.ibc.co.jp/radio/maitta/audio/'; + +module.exports = async (ctx) => { + const res = await axios.get(url); + const $ = cheerio.load(res.data); + const items = $('.broadcast').get(); + ctx.state.data = { + title: 'IBCラジオ イヤーマイッタマイッタ|IBC岩手放送', + link: 'http://www.ibc.co.jp/radio/maitta/audio', + description: $('meta[name=description]').attr('content'), + itunes_author: '水越アナと大塚アナ', + image: 'https://cdn.ibc.co.jp/radio/maitta/audio/images/og.png', + language: 'ja', + item: items.map((item) => { + item = $(item); + return { + title: item.find('h3').text(), + description: item + .find('.linecontent') + .text() + .trim(), + link: `https:${ + item + .find('a') + .first() + .attr('href') + .split('?')[0] + }`, + pubDate: new Date( + item + .find('.onairdate') + .text() + .split('日')[0] + .replace(/年|月/g, '-') + ).toUTCString(), + itunes_item_image: 'https://cdn.ibc.co.jp/radio/maitta/audio/images/og.png', + enclosure_url: `https:${ + item + .find('a') + .first() + .attr('href') + .split('?')[0] + }`, // 音频链接 + enclosure_type: 'audio/mpeg', + }; + }), + }; +}; From 1a8b5b36141cff6704716f3a19006461d3cb7eb4 Mon Sep 17 00:00:00 2001 From: Wenhu Date: Tue, 12 Mar 2019 19:02:49 +0800 Subject: [PATCH 24/43] =?UTF-8?q?Add=20=E5=A5=BD=E5=A5=87=E5=BF=83?= =?UTF-8?q?=E6=97=A5=E6=8A=A5=20(#1735)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 10 ++++++ lib/router.js | 7 ++++ lib/routes/jiemian/list.js | 60 +++++++++++++++++++++++++++++++++++ lib/routes/qdaily/category.js | 51 +++++++++++++++++++++++++++++ lib/routes/qdaily/column.js | 51 +++++++++++++++++++++++++++++ 5 files changed, 179 insertions(+) create mode 100644 lib/routes/jiemian/list.js create mode 100644 lib/routes/qdaily/category.js create mode 100644 lib/routes/qdaily/column.js diff --git a/docs/README.md b/docs/README.md index d51eb08b19bea8..885ba9f491db05 100755 --- a/docs/README.md +++ b/docs/README.md @@ -654,6 +654,12 @@ RSSHub 提供下列 API 接口: +### 好奇心日报 + + + + + ## 编程 ### 掘金 @@ -2102,6 +2108,10 @@ Category 列表: +### 界面新闻 + + + ### 澎湃新闻 diff --git a/lib/router.js b/lib/router.js index fa0bd2fba4c471..7f1c457448ca26 100755 --- a/lib/router.js +++ b/lib/router.js @@ -276,6 +276,13 @@ router.get('/jike/daily', require('./routes/jike/daily')); // 极客时间 router.get('/geektime/column/:cid', require('./routes/geektime/column')); +// 界面新闻 +router.get('/jiemian/list/:cid', require('./routes/jiemian/list.js')); + +// 好奇心日报 +router.get('/qdaily/column/:id', require('./routes/qdaily/column')); +router.get('/qdaily/category/:id', require('./routes/qdaily/category')); + // 爱奇艺 router.get('/iqiyi/dongman/:id', require('./routes/iqiyi/dongman')); diff --git a/lib/routes/jiemian/list.js b/lib/routes/jiemian/list.js new file mode 100644 index 00000000000000..2db94be894f2b0 --- /dev/null +++ b/lib/routes/jiemian/list.js @@ -0,0 +1,60 @@ +const cheerio = require('cheerio'); +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const url = `https://www.jiemian.com/lists/${ctx.params.cid}.html`; + + const res = await axios.get(url); + const $ = cheerio.load(res.data); + const list = $('.news-view').get(); + + const proList = []; + const indexList = []; + + const out = await Promise.all( + list.map(async (item, i) => { + const $ = cheerio.load(item); + const time = $('.date').text(); + let title = $('.news-img a').attr('title'); + if (!title) { + title = $('a').text(); + } + const itemUrl = $('.news-img a').attr('href'); + const cache = await ctx.cache.get(itemUrl); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + const single = { + title, + pubDate: new Date(time).toUTCString(), + link: itemUrl, + guid: itemUrl, + }; + proList.push(axios.get(itemUrl)); + indexList.push(i); + return Promise.resolve(single); + }) + ); + const responses = await axios.all(proList); + for (let i = 0; i < responses.length; i++) { + const res = responses[i]; + const $ = cheerio.load(res.data); + + let time = $('.article-info span') + .eq(1) + .text(); + if (!time) { + time = $('.article-header .info .date').text(); + } + out[indexList[i]].pubDate = new Date(time).toUTCString(); + + const content = $('.article-view .article-main').html(); + out[indexList[i]].description = content; + ctx.cache.set(out[indexList[i]].link, JSON.stringify(out[i]), 24 * 60 * 60); + } + ctx.state.data = { + title: $('title').text(), + link: url, + item: out, + }; +}; diff --git a/lib/routes/qdaily/category.js b/lib/routes/qdaily/category.js new file mode 100644 index 00000000000000..82f5eb9384d878 --- /dev/null +++ b/lib/routes/qdaily/category.js @@ -0,0 +1,51 @@ +const cheerio = require('cheerio'); +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const url = `http://www.qdaily.com/categories/${ctx.params.id}.html`; + + const res = await axios.get(url); + const $ = cheerio.load(res.data); + const list = $('.article').get(); + + const proList = []; + const indexList = []; + + const out = await Promise.all( + list.map(async (item, i) => { + const $ = cheerio.load(item); + const time = $('.smart-date').attr('data-origindate'); + let title = $('.title').text(); + if (!title) { + title = $('.smart-dotdotdot').text(); + } + const itemUrl = $('a').attr('href'); + const allUrl = `http://www.qdaily.com${itemUrl}`; + const cache = await ctx.cache.get(allUrl); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + const single = { + title, + pubDate: new Date(time).toUTCString(), + link: allUrl, + guid: allUrl, + }; + proList.push(axios.get(allUrl)); + indexList.push(i); + return Promise.resolve(single); + }) + ); + const responses = await axios.all(proList); + for (let i = 0; i < responses.length; i++) { + const res = responses[i]; + const $ = cheerio.load(res.data); + out[indexList[i]].description = $('.main .com-article-detail').html(); + ctx.cache.set(out[indexList[i]].link, JSON.stringify(out[i]), 24 * 60 * 60); + } + ctx.state.data = { + title: $('title').text(), + link: url, + item: out, + }; +}; diff --git a/lib/routes/qdaily/column.js b/lib/routes/qdaily/column.js new file mode 100644 index 00000000000000..be2beb42290ae3 --- /dev/null +++ b/lib/routes/qdaily/column.js @@ -0,0 +1,51 @@ +const cheerio = require('cheerio'); +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const url = `http://www.qdaily.com/special_columns/${ctx.params.id}.html`; + + const res = await axios.get(url); + const $ = cheerio.load(res.data); + const list = $('.article').get(); + + const proList = []; + const indexList = []; + + const out = await Promise.all( + list.map(async (item, i) => { + const $ = cheerio.load(item); + const time = $('.smart-date').attr('data-origindate'); + let title = $('.title').text(); + if (!title) { + title = $('.smart-dotdotdot').text(); + } + const itemUrl = $('a').attr('href'); + const allUrl = `http://www.qdaily.com${itemUrl}`; + const cache = await ctx.cache.get(allUrl); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + const single = { + title, + pubDate: new Date(time).toUTCString(), + link: allUrl, + guid: allUrl, + }; + proList.push(axios.get(allUrl)); + indexList.push(i); + return Promise.resolve(single); + }) + ); + const responses = await axios.all(proList); + for (let i = 0; i < responses.length; i++) { + const res = responses[i]; + const $ = cheerio.load(res.data); + out[indexList[i]].description = $('.main .com-article-detail').html(); + ctx.cache.set(out[indexList[i]].link, JSON.stringify(out[i]), 24 * 60 * 60); + } + ctx.state.data = { + title: $('title').text(), + link: url, + item: out, + }; +}; From e505e463e081e7218166f7cfffade08b322737fb Mon Sep 17 00:00:00 2001 From: Yorkin Yuan Date: Wed, 13 Mar 2019 11:56:55 +0800 Subject: [PATCH 25/43] =?UTF-8?q?:sparkles:=20=E5=B0=8F=E9=BB=91=E7=9B=92?= =?UTF-8?q?=E6=96=B0=E9=97=BB=E3=80=81=E6=89=93=E6=8A=98=E6=83=85=E5=86=B5?= =?UTF-8?q?=EF=BC=8C=E6=B8=B8=E6=88=8F=E6=97=B6=E5=85=89=E6=96=B0=E9=97=BB?= =?UTF-8?q?=E3=80=81=E5=8F=91=E5=94=AE=E8=A1=A8=20(#1736)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 10 ++++++++++ lib/router.js | 6 ++++++ lib/routes/vgtime/news.js | 20 ++++++++++++++++++++ lib/routes/vgtime/release.js | 20 ++++++++++++++++++++ lib/routes/xiaoheihe/discount.js | 20 ++++++++++++++++++++ lib/routes/xiaoheihe/news.js | 20 ++++++++++++++++++++ 6 files changed, 96 insertions(+) create mode 100644 lib/routes/vgtime/news.js create mode 100644 lib/routes/vgtime/release.js create mode 100644 lib/routes/xiaoheihe/discount.js create mode 100644 lib/routes/xiaoheihe/news.js diff --git a/docs/README.md b/docs/README.md index 885ba9f491db05..9f1afafa1b1553 100755 --- a/docs/README.md +++ b/docs/README.md @@ -2534,10 +2534,20 @@ Example: `https://store.steampowered.com/search/?specials=1&term=atelier` 中的 + + + + ### Indienova +### 游戏时光 + + + + + ## 小说·文学·阅读 ### 观止(每日一文) diff --git a/lib/router.js b/lib/router.js index 7f1c457448ca26..ea02c2d7414d79 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1032,6 +1032,8 @@ router.get('/gov/mee/gs', require('./routes/gov/mee/gs')); // 小黑盒 router.get('/xiaoheihe/user/:id', require('./routes/xiaoheihe/user')); +router.get('/xiaoheihe/news', require('./routes/xiaoheihe/news')); +router.get('/xiaoheihe/discount', require('./routes/xiaoheihe/discount')); // 惠誉评级 router.get('/fitchratings/site/:type', require('./routes/fitchratings/site')); @@ -1143,6 +1145,10 @@ router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link')); router.get('/uraaka-joshi', require('./routes/uraaka-joshi/uraaka-joshi')); router.get('/uraaka-joshi/:id', require('./routes/uraaka-joshi/uraaka-joshi-user')); +// 游戏时光 +router.get('/vgtime/news', require('./routes/vgtime/news.js')); +router.get('/vgtime/release', require('./routes/vgtime/release')); + // MP4吧 router.get('/mp4ba/:param', require('./routes/mp4ba')); diff --git a/lib/routes/vgtime/news.js b/lib/routes/vgtime/news.js new file mode 100644 index 00000000000000..a57b1eac7edede --- /dev/null +++ b/lib/routes/vgtime/news.js @@ -0,0 +1,20 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: `http://www.vgtime.com/vgtime-app/api/v2/homepage/listByTag.json?page=1&pageSize=20&tags=1`, + }); + const data = response.data.data.topicList; + + ctx.state.data = { + title: `游戏时光新闻列表`, + link: `http://www.vgtime.com/topic/index.jhtml`, + item: data.map((item) => ({ + title: item.title, + description: `作者:${item.user.name}`, + pubDate: new Date(item.publishDate * 1000).toUTCString(), + link: item.shareUrl, + })), + }; +}; diff --git a/lib/routes/vgtime/release.js b/lib/routes/vgtime/release.js new file mode 100644 index 00000000000000..7deda246d030a6 --- /dev/null +++ b/lib/routes/vgtime/release.js @@ -0,0 +1,20 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: `http://app02.vgtime.com:8080/vgtime-app/api/v2/game/last/sales`, + }); + const data = response.data.data.gameList; + + ctx.state.data = { + title: `游戏时光游戏发售表`, + link: `https://www.vgtime.com/game/release.jhtml`, + item: data.map((item) => ({ + title: item.title, + description: `平台:${item.platformsText};${item.introduction}`, + pubDate: item.publishDate, + link: item.shareUrl, + })), + }; +}; diff --git a/lib/routes/xiaoheihe/discount.js b/lib/routes/xiaoheihe/discount.js new file mode 100644 index 00000000000000..39044043d35483 --- /dev/null +++ b/lib/routes/xiaoheihe/discount.js @@ -0,0 +1,20 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: `https://api.xiaoheihe.cn/game/all_recommend/games/?show_type=discount&offset=0&limit=30&heybox_id=12777814&imei=867252032615972&os_type=Android&os_version=9&version=1.1.55&_time=1551803757&hkey=6977cde54ab859fbb98757d3e6b953d9`, + }); + const data = response.data.result.list; + + ctx.state.data = { + title: `小黑盒游戏打折情况`, + link: `https://xiaoheihe.cn/games/index`, + item: data.map((item) => ({ + title: item.game_name, + description: `原价¥${item.heybox_price.original_coin / 1000}元,现价¥${item.heybox_price.cost_coin / 1000}元,折扣力度${item.heybox_price.discount}%OFF`, + pubDate: ('' + item.price.deadline_date).replace(' 截止', ''), + link: item.game_img, + })), + }; +}; diff --git a/lib/routes/xiaoheihe/news.js b/lib/routes/xiaoheihe/news.js new file mode 100644 index 00000000000000..a63033b33d2587 --- /dev/null +++ b/lib/routes/xiaoheihe/news.js @@ -0,0 +1,20 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: `https://api.xiaoheihe.cn/maxnews/app/list?tag=-1&offset=0&limit=30&rec_mark=timeline&heybox_id=12777814&imei=867252032615972&os_type=Android&os_version=9&version=1.1.55&_time=1551801017&hkey=b28cd7a1cba463b4d9176ba2f8f42d35`, + }); + const data = response.data.result; + + ctx.state.data = { + title: `小黑盒游戏新闻`, + link: `https://xiaoheihe.cn/community/index`, + item: data.map((item) => ({ + title: item.title, + description: item.description, + pubDate: item.date, + link: item.newUrl, + })), + }; +}; From c4430e29f5c7aba58b46b74249713ee16203c0f7 Mon Sep 17 00:00:00 2001 From: Wenhu Date: Wed, 13 Mar 2019 11:57:40 +0800 Subject: [PATCH 26/43] =?UTF-8?q?fix=20=E5=A5=BD=E5=A5=87=E5=BF=83?= =?UTF-8?q?=E6=97=A5=E6=8A=A5=E5=9B=BE=E7=89=87=E6=97=A0=E6=B3=95=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=20(#1739)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 4 ++-- lib/routes/qdaily/category.js | 12 ++++++++++-- lib/routes/qdaily/column.js | 9 +++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index 9f1afafa1b1553..2b62b08e834deb 100755 --- a/docs/README.md +++ b/docs/README.md @@ -656,9 +656,9 @@ RSSHub 提供下列 API 接口: ### 好奇心日报 - + - + ## 编程 diff --git a/lib/routes/qdaily/category.js b/lib/routes/qdaily/category.js index 82f5eb9384d878..b706344807bbc5 100644 --- a/lib/routes/qdaily/category.js +++ b/lib/routes/qdaily/category.js @@ -2,7 +2,7 @@ const cheerio = require('cheerio'); const axios = require('../../utils/axios'); module.exports = async (ctx) => { - const url = `http://www.qdaily.com/categories/${ctx.params.id}.html`; + const url = `https://www.qdaily.com/categories/${ctx.params.id}.html`; const res = await axios.get(url); const $ = cheerio.load(res.data); @@ -20,7 +20,7 @@ module.exports = async (ctx) => { title = $('.smart-dotdotdot').text(); } const itemUrl = $('a').attr('href'); - const allUrl = `http://www.qdaily.com${itemUrl}`; + const allUrl = `https://www.qdaily.com${itemUrl}`; const cache = await ctx.cache.get(allUrl); if (cache) { return Promise.resolve(JSON.parse(cache)); @@ -40,6 +40,14 @@ module.exports = async (ctx) => { for (let i = 0; i < responses.length; i++) { const res = responses[i]; const $ = cheerio.load(res.data); + $('img').each((index, item) => { + item = $(item); + item.attr('src', item.attr('data-src')); + item.attr('referrerpolicy', 'no-referrer'); + }); + $('.article-detail-bd .author-share').remove(); + $('.article-detail-ft').remove(); + out[indexList[i]].description = $('.main .com-article-detail').html(); ctx.cache.set(out[indexList[i]].link, JSON.stringify(out[i]), 24 * 60 * 60); } diff --git a/lib/routes/qdaily/column.js b/lib/routes/qdaily/column.js index be2beb42290ae3..da5ec82cbcde8f 100644 --- a/lib/routes/qdaily/column.js +++ b/lib/routes/qdaily/column.js @@ -40,6 +40,15 @@ module.exports = async (ctx) => { for (let i = 0; i < responses.length; i++) { const res = responses[i]; const $ = cheerio.load(res.data); + + $('img').each((index, item) => { + item = $(item); + item.attr('src', item.attr('data-src')); + item.attr('referrerpolicy', 'no-referrer'); + }); + $('.article-detail-bd .author-share').remove(); + $('.article-detail-ft').remove(); + out[indexList[i]].description = $('.main .com-article-detail').html(); ctx.cache.set(out[indexList[i]].link, JSON.stringify(out[i]), 24 * 60 * 60); } From 34a4de4c21ba92ac1a6b0347aa30b25ccdb64c68 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 13 Mar 2019 11:57:58 +0800 Subject: [PATCH 27/43] chore(deps): update dependency jest to v24.5.0 (#1738) --- package.json | 2 +- yarn.lock | 524 +++++++++++++++++++++++++-------------------------- 2 files changed, 263 insertions(+), 263 deletions(-) diff --git a/package.json b/package.json index bd03ef2b94285c..9e6f98b9b5b123 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "eslint": "5.15.1", "eslint-config-prettier": "4.1.0", "eslint-plugin-prettier": "3.0.1", - "jest": "24.4.0", + "jest": "24.5.0", "lint-staged": "8.1.5", "mockdate": "2.0.2", "nodemon": "1.18.10", diff --git a/yarn.lock b/yarn.lock index e43e18590e7bdc..c0605f72a9da6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -882,32 +882,32 @@ chalk "^2.0.1" slash "^2.0.0" -"@jest/core@^24.4.0": - version "24.4.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.4.0.tgz#ec53510f19dde5aaf4e9e28a3c3426fc0f2a41d6" - integrity sha512-S48krBwigVm3DwLSEtMiiWnWz+G3uGii192LIZYbWULYSOCwQeG7hWb6a3yWBLYuZnATh3W6QMxs7whS0/hQMQ== +"@jest/core@^24.5.0": + version "24.5.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.5.0.tgz#2cefc6a69e9ebcae1da8f7c75f8a257152ba1ec0" + integrity sha512-RDZArRzAs51YS7dXG1pbXbWGxK53rvUu8mCDYsgqqqQ6uSOaTjcVyBl2Jce0exT2rSLk38ca7az7t2f3b0/oYQ== dependencies: "@jest/console" "^24.3.0" - "@jest/reporters" "^24.4.0" - "@jest/test-result" "^24.3.0" - "@jest/transform" "^24.4.0" - "@jest/types" "^24.3.0" + "@jest/reporters" "^24.5.0" + "@jest/test-result" "^24.5.0" + "@jest/transform" "^24.5.0" + "@jest/types" "^24.5.0" ansi-escapes "^3.0.0" chalk "^2.0.1" exit "^0.1.2" graceful-fs "^4.1.15" - jest-changed-files "^24.3.0" - jest-config "^24.4.0" - jest-haste-map "^24.4.0" - jest-message-util "^24.3.0" + jest-changed-files "^24.5.0" + jest-config "^24.5.0" + jest-haste-map "^24.5.0" + jest-message-util "^24.5.0" jest-regex-util "^24.3.0" - jest-resolve-dependencies "^24.4.0" - jest-runner "^24.4.0" - jest-runtime "^24.4.0" - jest-snapshot "^24.4.0" - jest-util "^24.3.0" - jest-validate "^24.4.0" - jest-watcher "^24.3.0" + jest-resolve-dependencies "^24.5.0" + jest-runner "^24.5.0" + jest-runtime "^24.5.0" + jest-snapshot "^24.5.0" + jest-util "^24.5.0" + jest-validate "^24.5.0" + jest-watcher "^24.5.0" micromatch "^3.1.10" p-each-series "^1.0.0" pirates "^4.0.1" @@ -915,36 +915,36 @@ rimraf "^2.5.4" strip-ansi "^5.0.0" -"@jest/environment@^24.4.0": - version "24.4.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.4.0.tgz#552f0629a9cc2bd015f370b3af77222f069f158f" - integrity sha512-YuPsWWwTS4wkMsvCNXvBZPZQGOVtsVyle9OzHIAdWvV+B9qjs0vA85Il1+FSG0b765VqznPvpfIe1wKoIFOleQ== +"@jest/environment@^24.5.0": + version "24.5.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.5.0.tgz#a2557f7808767abea3f9e4cc43a172122a63aca8" + integrity sha512-tzUHR9SHjMXwM8QmfHb/EJNbF0fjbH4ieefJBvtwO8YErLTrecc1ROj0uo2VnIT6SlpEGZnvdCK6VgKYBo8LsA== dependencies: - "@jest/fake-timers" "^24.3.0" - "@jest/transform" "^24.4.0" - "@jest/types" "^24.3.0" + "@jest/fake-timers" "^24.5.0" + "@jest/transform" "^24.5.0" + "@jest/types" "^24.5.0" "@types/node" "*" - jest-mock "^24.3.0" + jest-mock "^24.5.0" -"@jest/fake-timers@^24.3.0": - version "24.3.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.3.0.tgz#0a7f8b877b78780c3fa5c3f8683cc0aaf9488331" - integrity sha512-rHwVI17dGMHxHzfAhnZ04+wFznjFfZ246QugeBnbiYr7/bDosPD2P1qeNjWnJUUcfl0HpS6kkr+OB/mqSJxQFg== +"@jest/fake-timers@^24.5.0": + version "24.5.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.5.0.tgz#4a29678b91fd0876144a58f8d46e6c62de0266f0" + integrity sha512-i59KVt3QBz9d+4Qr4QxsKgsIg+NjfuCjSOWj3RQhjF5JNy+eVJDhANQ4WzulzNCHd72srMAykwtRn5NYDGVraw== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" "@types/node" "*" - jest-message-util "^24.3.0" - jest-mock "^24.3.0" - -"@jest/reporters@^24.4.0": - version "24.4.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.4.0.tgz#e1e6ca29593f36088db76a380f04e93e71f09607" - integrity sha512-teO0to16UaYJTLWXCWCa1kBPx/PY4dw2/8I2LPIzk5mNN5km8jyx5jz8D1Yy0nqascVtbpG4+VnSt7E16cnrcw== - dependencies: - "@jest/environment" "^24.4.0" - "@jest/test-result" "^24.3.0" - "@jest/transform" "^24.4.0" - "@jest/types" "^24.3.0" + jest-message-util "^24.5.0" + jest-mock "^24.5.0" + +"@jest/reporters@^24.5.0": + version "24.5.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.5.0.tgz#9363a210d0daa74696886d9cb294eb8b3ad9b4d9" + integrity sha512-vfpceiaKtGgnuC3ss5czWOihKOUSyjJA4M4udm6nH8xgqsuQYcyDCi4nMMcBKsHXWgz9/V5G7iisnZGfOh1w6Q== + dependencies: + "@jest/environment" "^24.5.0" + "@jest/test-result" "^24.5.0" + "@jest/transform" "^24.5.0" + "@jest/types" "^24.5.0" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.2" @@ -952,10 +952,10 @@ istanbul-lib-coverage "^2.0.2" istanbul-lib-instrument "^3.0.1" istanbul-lib-source-maps "^3.0.1" - jest-haste-map "^24.4.0" - jest-resolve "^24.4.0" - jest-runtime "^24.4.0" - jest-util "^24.3.0" + jest-haste-map "^24.5.0" + jest-resolve "^24.5.0" + jest-runtime "^24.5.0" + jest-util "^24.5.0" jest-worker "^24.4.0" node-notifier "^5.2.1" slash "^2.0.0" @@ -971,40 +971,40 @@ graceful-fs "^4.1.15" source-map "^0.6.0" -"@jest/test-result@^24.3.0": - version "24.3.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.3.0.tgz#4c0b1c9716212111920f7cf8c4329c69bc81924a" - integrity sha512-j7UZ49T8C4CVipEY99nLttnczVTtLyVzFfN20OiBVn7awOs0U3endXSTq7ouPrLR5y4YjI5GDcbcvDUjgeamzg== +"@jest/test-result@^24.5.0": + version "24.5.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.5.0.tgz#ab66fb7741a04af3363443084e72ea84861a53f2" + integrity sha512-u66j2vBfa8Bli1+o3rCaVnVYa9O8CAFZeqiqLVhnarXtreSXG33YQ6vNYBogT7+nYiFNOohTU21BKiHlgmxD5A== dependencies: "@jest/console" "^24.3.0" - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" "@types/istanbul-lib-coverage" "^1.1.0" -"@jest/transform@^24.4.0": - version "24.4.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.4.0.tgz#2f6b4b5dc7f7673d8fec8bf1040d4236c58c7a60" - integrity sha512-Y928pU6bqWqMlGugRiaWOresox/CIrRuBVdPnYiSoIcRtwNKZujCOkzIzRalcTTxm77wuLjNihcq8OWfdm+Dxg== +"@jest/transform@^24.5.0": + version "24.5.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.5.0.tgz#6709fc26db918e6af63a985f2cc3c464b4cf99d9" + integrity sha512-XSsDz1gdR/QMmB8UCKlweAReQsZrD/DK7FuDlNo/pE8EcKMrfi2kqLRk8h8Gy/PDzgqJj64jNEzOce9pR8oj1w== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" babel-plugin-istanbul "^5.1.0" chalk "^2.0.1" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.1.15" - jest-haste-map "^24.4.0" + jest-haste-map "^24.5.0" jest-regex-util "^24.3.0" - jest-util "^24.3.0" + jest-util "^24.5.0" micromatch "^3.1.10" realpath-native "^1.1.0" slash "^2.0.0" source-map "^0.6.1" write-file-atomic "2.4.1" -"@jest/types@^24.3.0": - version "24.3.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.3.0.tgz#3f6e117e47248a9a6b5f1357ec645bd364f7ad23" - integrity sha512-VoO1F5tU2n/93QN/zaZ7Q8SeV/Rj+9JJOgbvKbBwy4lenvmdj1iDaQEPXGTKrO6OSvDeb2drTFipZJYxgo6kIQ== +"@jest/types@^24.5.0": + version "24.5.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.5.0.tgz#feee214a4d0167b0ca447284e95a57aa10b3ee95" + integrity sha512-kN7RFzNMf2R8UDadPOl6ReyI+MT8xfqRuAnuVL+i4gwjv/zubdDK+EDeLHYwq1j0CSSR2W/MmgaRlMZJzXdmVA== dependencies: "@types/istanbul-lib-coverage" "^1.1.0" "@types/yargs" "^12.0.9" @@ -1764,13 +1764,13 @@ babel-helper-vue-jsx-merge-props@^2.0.3: resolved "https://registry.yarnpkg.com/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz#22aebd3b33902328e513293a8e4992b384f9f1b6" integrity sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg== -babel-jest@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.4.0.tgz#6c4029f52175d4f8f138cdad42d2a02fe34ddb03" - integrity sha512-wh23nKbWZf9SeO0GNOQc2QDqaMXOmbaI2Hvbcl6FGqg9zqHwr9Jy0e0ZqsXiJ2Cv8YKqD+eOE2wAGVhq4nzWDQ== +babel-jest@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.5.0.tgz#0ea042789810c2bec9065f7c8ab4dc18e1d28559" + integrity sha512-0fKCXyRwxFTJL0UXDJiT2xYxO9Lu2vBd9n+cC+eDjESzcVG3s2DRGAxbzJX21fceB1WYoBjAh8pQ83dKcl003g== dependencies: - "@jest/transform" "^24.4.0" - "@jest/types" "^24.3.0" + "@jest/transform" "^24.5.0" + "@jest/types" "^24.5.0" "@types/babel__core" "^7.1.0" babel-plugin-istanbul "^5.1.0" babel-preset-jest "^24.3.0" @@ -3871,16 +3871,16 @@ expand-template@^2.0.3: resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== -expect@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.4.0.tgz#df52da212bc06831c38fb51a53106ae7a0e7aaf2" - integrity sha512-p3QGkNhxN4WXih12lOx4vuhJpl/ZFD1AWu9lWh8IXNZD10ySSOzDN4Io8zuEOWvzylFkDpU9oQ/KRTZ/Bs9/ag== +expect@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.5.0.tgz#492fb0df8378d8474cc84b827776b069f46294ed" + integrity sha512-p2Gmc0CLxOgkyA93ySWmHFYHUPFIHG6XZ06l7WArWAsrqYVaVEkOU5NtT5i68KUyGKbkQgDCkiT65bWmdoL6Bw== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" ansi-styles "^3.2.0" jest-get-type "^24.3.0" - jest-matcher-utils "^24.4.0" - jest-message-util "^24.3.0" + jest-matcher-utils "^24.5.0" + jest-message-util "^24.5.0" jest-regex-util "^24.3.0" extend-shallow@^2.0.1: @@ -5523,65 +5523,65 @@ javascript-stringify@^1.6.0: resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-1.6.0.tgz#142d111f3a6e3dae8f4a9afd77d45855b5a9cce3" integrity sha1-FC0RHzpuPa6PSpr9d9RYVbWpzOM= -jest-changed-files@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.3.0.tgz#7050ae29aaf1d59437c80f21d5b3cd354e88a499" - integrity sha512-fTq0YAUR6644fgsqLC7Zi2gXA/bAplMRvfXQdutmkwgrCKK6upkj+sgXqsUfUZRm15CVr3YSojr/GRNn71IMvg== +jest-changed-files@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.5.0.tgz#4075269ee115d87194fd5822e642af22133cf705" + integrity sha512-Ikl29dosYnTsH9pYa1Tv9POkILBhN/TLZ37xbzgNsZ1D2+2n+8oEZS2yP1BrHn/T4Rs4Ggwwbp/x8CKOS5YJOg== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" execa "^1.0.0" throat "^4.0.0" -jest-cli@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.4.0.tgz#3297c2f817611b86ce1250fb5703a28bca201034" - integrity sha512-QQOgpRpXoDqpxhEux/AGyI9XJzVOJ5ppz4Kb9MlA5PvzsyYD3DRk/uiyJgmvBhCCXvcA1CKEl/g/LH0kbKg10Q== +jest-cli@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.5.0.tgz#598139d3446d1942fb7dc93944b9ba766d756d4b" + integrity sha512-P+Jp0SLO4KWN0cGlNtC7JV0dW1eSFR7eRpoOucP2UM0sqlzp/bVHeo71Omonvigrj9AvCKy7NtQANtqJ7FXz8g== dependencies: - "@jest/core" "^24.4.0" - "@jest/test-result" "^24.3.0" - "@jest/types" "^24.3.0" + "@jest/core" "^24.5.0" + "@jest/test-result" "^24.5.0" + "@jest/types" "^24.5.0" chalk "^2.0.1" exit "^0.1.2" import-local "^2.0.0" is-ci "^2.0.0" - jest-config "^24.4.0" - jest-util "^24.3.0" - jest-validate "^24.4.0" + jest-config "^24.5.0" + jest-util "^24.5.0" + jest-validate "^24.5.0" prompts "^2.0.1" realpath-native "^1.1.0" yargs "^12.0.2" -jest-config@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.4.0.tgz#07bf14d43c02aec3bd384121a165a6ee9d8c5ed1" - integrity sha512-H2R6qkfUPck+OlIWsjeShecbqYiEDUvzZfsfgQkx6LVakAORy7wZFptONVF+Qz7iO9Bl6x35cBA2A1o1W+ctDg== +jest-config@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.5.0.tgz#404d1bc6bb81aed6bd1890d07e2dca9fbba2e121" + integrity sha512-t2UTh0Z2uZhGBNVseF8wA2DS2SuBiLOL6qpLq18+OZGfFUxTM7BzUVKyHFN/vuN+s/aslY1COW95j1Rw81huOQ== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^24.3.0" - babel-jest "^24.4.0" + "@jest/types" "^24.5.0" + babel-jest "^24.5.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^24.4.0" - jest-environment-node "^24.4.0" + jest-environment-jsdom "^24.5.0" + jest-environment-node "^24.5.0" jest-get-type "^24.3.0" - jest-jasmine2 "^24.4.0" + jest-jasmine2 "^24.5.0" jest-regex-util "^24.3.0" - jest-resolve "^24.4.0" - jest-util "^24.3.0" - jest-validate "^24.4.0" + jest-resolve "^24.5.0" + jest-util "^24.5.0" + jest-validate "^24.5.0" micromatch "^3.1.10" - pretty-format "^24.4.0" + pretty-format "^24.5.0" realpath-native "^1.1.0" -jest-diff@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.4.0.tgz#106cd0491cb32da31debbea3e21f094d358dc7d9" - integrity sha512-2GdKN8GOledWkMGXcRCSr3KVTrjZU6vxbfZzwzRlM7gSG8HNIx+eoFXauQNQ5j7q73fZCoPnyS5/uOcXQ3wkWg== +jest-diff@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.5.0.tgz#a2d8627964bb06a91893c0fbcb28ab228c257652" + integrity sha512-mCILZd9r7zqL9Uh6yNoXjwGQx0/J43OD2vvWVKwOEOLZliQOsojXwqboubAQ+Tszrb6DHGmNU7m4whGeB9YOqw== dependencies: chalk "^2.0.1" diff-sequences "^24.3.0" jest-get-type "^24.3.0" - pretty-format "^24.4.0" + pretty-format "^24.5.0" jest-docblock@^24.3.0: version "24.3.0" @@ -5590,119 +5590,119 @@ jest-docblock@^24.3.0: dependencies: detect-newline "^2.1.0" -jest-each@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.4.0.tgz#2a0e06d957b31ec9ca4679ed9d4a15ac48299d6b" - integrity sha512-W98N4Ep6BBdCanynA9jdJDUaPvZ9OAnIHNA8mK6kbH7JYdnNQKGvp5ivl/PjCTqiI2wnHKYRI06EjsfOqT8ZFQ== +jest-each@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.5.0.tgz#da14d017a1b7d0f01fb458d338314cafe7f72318" + integrity sha512-6gy3Kh37PwIT5sNvNY2VchtIFOOBh8UCYnBlxXMb5sr5wpJUDPTUATX2Axq1Vfk+HWTMpsYPeVYp4TXx5uqUBw== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" chalk "^2.0.1" jest-get-type "^24.3.0" - jest-util "^24.3.0" - pretty-format "^24.4.0" - -jest-environment-jsdom@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.4.0.tgz#86e1c494abb1ab58b7aa5791bdb4fa96d709b57b" - integrity sha512-7irZXPZLQF79r97uH9dG9mm76H+27CMSH8TEcF70x6pY4xFJipjjluiXRw1C2lh0o6FrbSQKpkSXncdOw+hY0A== - dependencies: - "@jest/environment" "^24.4.0" - "@jest/fake-timers" "^24.3.0" - "@jest/types" "^24.3.0" - jest-mock "^24.3.0" - jest-util "^24.3.0" + jest-util "^24.5.0" + pretty-format "^24.5.0" + +jest-environment-jsdom@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.5.0.tgz#1c3143063e1374100f8c2723a8b6aad23b6db7eb" + integrity sha512-62Ih5HbdAWcsqBx2ktUnor/mABBo1U111AvZWcLKeWN/n/gc5ZvDBKe4Og44fQdHKiXClrNGC6G0mBo6wrPeGQ== + dependencies: + "@jest/environment" "^24.5.0" + "@jest/fake-timers" "^24.5.0" + "@jest/types" "^24.5.0" + jest-mock "^24.5.0" + jest-util "^24.5.0" jsdom "^11.5.1" -jest-environment-node@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.4.0.tgz#c10cd617ccc73c1936d46a925e9dcade8709d044" - integrity sha512-ed1TjncsHO+Ird4BDrWwqsMQQM+bg9AFHj0AcCumgzfc+Us6ywWUQUg+5UbKLKnu1EWp5mK7mmbLxLqdz2kc9w== +jest-environment-node@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.5.0.tgz#763eebdf529f75b60aa600c6cf8cb09873caa6ab" + integrity sha512-du6FuyWr/GbKLsmAbzNF9mpr2Iu2zWSaq/BNHzX+vgOcts9f2ayXBweS7RAhr+6bLp6qRpMB6utAMF5Ygktxnw== dependencies: - "@jest/environment" "^24.4.0" - "@jest/fake-timers" "^24.3.0" - "@jest/types" "^24.3.0" - jest-mock "^24.3.0" - jest-util "^24.3.0" + "@jest/environment" "^24.5.0" + "@jest/fake-timers" "^24.5.0" + "@jest/types" "^24.5.0" + jest-mock "^24.5.0" + jest-util "^24.5.0" jest-get-type@^24.3.0: version "24.3.0" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.3.0.tgz#582cfd1a4f91b5cdad1d43d2932f816d543c65da" integrity sha512-HYF6pry72YUlVcvUx3sEpMRwXEWGEPlJ0bSPVnB3b3n++j4phUEoSPcS6GC0pPJ9rpyPSe4cb5muFo6D39cXow== -jest-haste-map@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.4.0.tgz#a969ecab8a9521115c5fecec82366d66433c851b" - integrity sha512-X20xhhPBjbz4UVTN9BMBjlFUM/gmi1TmYWWxZUgLg4fZXMIve4RUdA/nS/QgC76ouGgvwb9z52KwZ85bmNx55A== +jest-haste-map@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.5.0.tgz#3f17d0c548b99c0c96ed2893f9c0ccecb2eb9066" + integrity sha512-mb4Yrcjw9vBgSvobDwH8QUovxApdimGcOkp+V1ucGGw4Uvr3VzZQBJhNm1UY3dXYm4XXyTW2G7IBEZ9pM2ggRQ== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" fb-watchman "^2.0.0" graceful-fs "^4.1.15" invariant "^2.2.4" jest-serializer "^24.4.0" - jest-util "^24.3.0" + jest-util "^24.5.0" jest-worker "^24.4.0" micromatch "^3.1.10" sane "^4.0.3" -jest-jasmine2@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.4.0.tgz#f1d3749b1fc4a90cbdca1480f0ce932d135b69e5" - integrity sha512-J9A0SKWuUNDmXKU+a3Yj69NmUXK7R3btHHu1ZMpjHKlMoHggVjdzsolpNHELCENBOTXvcLXqEH0Xm+pYRoNfMw== +jest-jasmine2@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.5.0.tgz#e6af4d7f73dc527d007cca5a5b177c0bcc29d111" + integrity sha512-sfVrxVcx1rNUbBeyIyhkqZ4q+seNKyAG6iM0S2TYBdQsXjoFDdqWFfsUxb6uXSsbimbXX/NMkJIwUZ1uT9+/Aw== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^24.4.0" - "@jest/test-result" "^24.3.0" - "@jest/types" "^24.3.0" + "@jest/environment" "^24.5.0" + "@jest/test-result" "^24.5.0" + "@jest/types" "^24.5.0" chalk "^2.0.1" co "^4.6.0" - expect "^24.4.0" + expect "^24.5.0" is-generator-fn "^2.0.0" - jest-each "^24.4.0" - jest-matcher-utils "^24.4.0" - jest-message-util "^24.3.0" - jest-runtime "^24.4.0" - jest-snapshot "^24.4.0" - jest-util "^24.3.0" - pretty-format "^24.4.0" + jest-each "^24.5.0" + jest-matcher-utils "^24.5.0" + jest-message-util "^24.5.0" + jest-runtime "^24.5.0" + jest-snapshot "^24.5.0" + jest-util "^24.5.0" + pretty-format "^24.5.0" throat "^4.0.0" -jest-leak-detector@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.4.0.tgz#f255d2f582b8dda7b960e04a42f7239b7ec6520b" - integrity sha512-PAo0y19ZkWZWYmdoPAQKpYTDt7IGwrTFhIwGmHO1xkRjzAWW8zcCoiMLrFwNSi9rir2ZH7el8gXZ0d2mmU7O9Q== +jest-leak-detector@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.5.0.tgz#21ae2b3b0da252c1171cd494f75696d65fb6fa89" + integrity sha512-LZKBjGovFRx3cRBkqmIg+BZnxbrLqhQl09IziMk3oeh1OV81Hg30RUIx885mq8qBv1PA0comB9bjKcuyNO1bCQ== dependencies: - pretty-format "^24.4.0" + pretty-format "^24.5.0" -jest-matcher-utils@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.4.0.tgz#285a2a5c8414d2f4a62d89ddc4b381730e2b717d" - integrity sha512-JDWrJ1G+GfxtEQlX7DlCV/0sk0uYbnra0jVl3DiDbS0FUX0HeGA1CxRW/U87LB3XNHQydhBKbXgf+pDCiUCn4w== +jest-matcher-utils@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.5.0.tgz#5995549dcf09fa94406e89526e877b094dad8770" + integrity sha512-QM1nmLROjLj8GMGzg5VBra3I9hLpjMPtF1YqzQS3rvWn2ltGZLrGAO1KQ9zUCVi5aCvrkbS5Ndm2evIP9yZg1Q== dependencies: chalk "^2.0.1" - jest-diff "^24.4.0" + jest-diff "^24.5.0" jest-get-type "^24.3.0" - pretty-format "^24.4.0" + pretty-format "^24.5.0" -jest-message-util@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.3.0.tgz#e8f64b63ebc75b1a9c67ee35553752596e70d4a9" - integrity sha512-lXM0YgKYGqN5/eH1NGw4Ix+Pk2I9Y77beyRas7xM24n+XTTK3TbT0VkT3L/qiyS7WkW0YwyxoXnnAaGw4hsEDA== +jest-message-util@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.5.0.tgz#181420a65a7ef2e8b5c2f8e14882c453c6d41d07" + integrity sha512-6ZYgdOojowCGiV0D8WdgctZEAe+EcFU+KrVds+0ZjvpZurUW2/oKJGltJ6FWY2joZwYXN5VL36GPV6pNVRqRnQ== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.3.0" - "@jest/types" "^24.3.0" + "@jest/test-result" "^24.5.0" + "@jest/types" "^24.5.0" "@types/stack-utils" "^1.0.1" chalk "^2.0.1" micromatch "^3.1.10" slash "^2.0.0" stack-utils "^1.0.1" -jest-mock@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.3.0.tgz#95a86b6ad474e3e33227e6dd7c4ff6b07e18d3cb" - integrity sha512-AhAo0qjbVWWGvcbW5nChFjR0ObQImvGtU6DodprNziDOt+pP0CBdht/sYcNIOXeim8083QUi9bC8QdKB8PTK4Q== +jest-mock@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.5.0.tgz#976912c99a93f2a1c67497a9414aa4d9da4c7b76" + integrity sha512-ZnAtkWrKf48eERgAOiUxVoFavVBziO2pAi2MfZ1+bGXVkDfxWLxU0//oJBkgwbsv6OAmuLBz4XFFqvCFMqnGUw== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" jest-pnp-resolver@^1.2.1: version "1.2.1" @@ -5714,75 +5714,75 @@ jest-regex-util@^24.3.0: resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== -jest-resolve-dependencies@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.4.0.tgz#296420c04211d2697dfe3141744e7071028ea9b0" - integrity sha512-3ssDSve3iSsIKm5daivq1mrCaBVFAa+TMG4qardNPoi7IJfupDUETIBCXYF9GRtIfNuD/dJOSag4u6oMHRxTGg== +jest-resolve-dependencies@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.5.0.tgz#1a0dae9cdd41349ca4a84148b3e78da2ba33fd4b" + integrity sha512-dRVM1D+gWrFfrq2vlL5P9P/i8kB4BOYqYf3S7xczZ+A6PC3SgXYSErX/ScW/469pWMboM1uAhgLF+39nXlirCQ== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" jest-regex-util "^24.3.0" - jest-snapshot "^24.4.0" + jest-snapshot "^24.5.0" -jest-resolve@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.4.0.tgz#5314af3cc9abc8d2de55c6e78edac4253c2f46f3" - integrity sha512-XvMIuDH6wQi76YJfNG40iolXP2l+fA+LLORGgNSZ5VgowCeyV/XVygTN4L3No3GP1cthUdl/ULzWBd2CfYmTkw== +jest-resolve@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.5.0.tgz#8c16ba08f60a1616c3b1cd7afb24574f50a24d04" + integrity sha512-ZIfGqLX1Rg8xJpQqNjdoO8MuxHV1q/i2OO1hLXjgCWFWs5bsedS8UrOdgjUqqNae6DXA+pCyRmdcB7lQEEbXew== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" browser-resolve "^1.11.3" chalk "^2.0.1" jest-pnp-resolver "^1.2.1" realpath-native "^1.1.0" -jest-runner@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.4.0.tgz#71ad09858be897cc37da1bf88bf67baaa0219fdb" - integrity sha512-eCuEMDbJknyKEUBWBDebW3GQ6Ty8wwB3YqDjFb4p3UQozA2HarPq0n9N83viq18vvZ/BDrQvW6RLdZaiLipM4Q== +jest-runner@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.5.0.tgz#9be26ece4fd4ab3dfb528b887523144b7c5ffca8" + integrity sha512-oqsiS9TkIZV5dVkD+GmbNfWBRPIvxqmlTQ+AQUJUQ07n+4xTSDc40r+aKBynHw9/tLzafC00DIbJjB2cOZdvMA== dependencies: "@jest/console" "^24.3.0" - "@jest/environment" "^24.4.0" - "@jest/test-result" "^24.3.0" - "@jest/types" "^24.3.0" + "@jest/environment" "^24.5.0" + "@jest/test-result" "^24.5.0" + "@jest/types" "^24.5.0" chalk "^2.4.2" exit "^0.1.2" graceful-fs "^4.1.15" - jest-config "^24.4.0" + jest-config "^24.5.0" jest-docblock "^24.3.0" - jest-haste-map "^24.4.0" - jest-jasmine2 "^24.4.0" - jest-leak-detector "^24.4.0" - jest-message-util "^24.3.0" - jest-resolve "^24.4.0" - jest-runtime "^24.4.0" - jest-util "^24.3.0" + jest-haste-map "^24.5.0" + jest-jasmine2 "^24.5.0" + jest-leak-detector "^24.5.0" + jest-message-util "^24.5.0" + jest-resolve "^24.5.0" + jest-runtime "^24.5.0" + jest-util "^24.5.0" jest-worker "^24.4.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.4.0.tgz#77df2137d1cb78a30f8b7c52cc06427272e06334" - integrity sha512-wmopIA6EqgfSvYmqFvfZViJy5LCyIATUSRRt16HQDNN4ypWUQAaFwZ9fpbPo7e2UnKHTe2CK0dCRB1o/a6JUfQ== +jest-runtime@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.5.0.tgz#3a76e0bfef4db3896d5116e9e518be47ba771aa2" + integrity sha512-GTFHzfLdwpaeoDPilNpBrorlPoNZuZrwKKzKJs09vWwHo+9TOsIIuszK8cWOuKC7ss07aN1922Ge8fsGdsqCuw== dependencies: "@jest/console" "^24.3.0" - "@jest/environment" "^24.4.0" + "@jest/environment" "^24.5.0" "@jest/source-map" "^24.3.0" - "@jest/transform" "^24.4.0" - "@jest/types" "^24.3.0" + "@jest/transform" "^24.5.0" + "@jest/types" "^24.5.0" "@types/yargs" "^12.0.2" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.1.15" - jest-config "^24.4.0" - jest-haste-map "^24.4.0" - jest-message-util "^24.3.0" - jest-mock "^24.3.0" + jest-config "^24.5.0" + jest-haste-map "^24.5.0" + jest-message-util "^24.5.0" + jest-mock "^24.5.0" jest-regex-util "^24.3.0" - jest-resolve "^24.4.0" - jest-snapshot "^24.4.0" - jest-util "^24.3.0" - jest-validate "^24.4.0" + jest-resolve "^24.5.0" + jest-snapshot "^24.5.0" + jest-util "^24.5.0" + jest-validate "^24.5.0" realpath-native "^1.1.0" slash "^2.0.0" strip-bom "^3.0.0" @@ -5793,34 +5793,34 @@ jest-serializer@^24.4.0: resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== -jest-snapshot@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.4.0.tgz#7e76ff377cf84af65e37b46c48bbda555e7545da" - integrity sha512-h+xO+ZQC+XEcf5wsy6+yducTKw6ku+oS5E2eJZI4YI65AT/lvbMjKgulgQWUOxga4HP0qHnz9uwa67/Zo7jVrw== +jest-snapshot@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.5.0.tgz#e5d224468a759fd19e36f01217aac912f500f779" + integrity sha512-eBEeJb5ROk0NcpodmSKnCVgMOo+Qsu5z9EDl3tGffwPzK1yV37mjGWF2YeIz1NkntgTzP+fUL4s09a0+0dpVWA== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" chalk "^2.0.1" - expect "^24.4.0" - jest-diff "^24.4.0" - jest-matcher-utils "^24.4.0" - jest-message-util "^24.3.0" - jest-resolve "^24.4.0" + expect "^24.5.0" + jest-diff "^24.5.0" + jest-matcher-utils "^24.5.0" + jest-message-util "^24.5.0" + jest-resolve "^24.5.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^24.4.0" + pretty-format "^24.5.0" semver "^5.5.0" -jest-util@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.3.0.tgz#a549ae9910fedbd4c5912b204bb1bcc122ea0057" - integrity sha512-eKIAC+MTKWZthUUVOwZ3Tc5a0cKMnxalQHr6qZ4kPzKn6k09sKvsmjCygqZ1SxVVfUKoa8Sfn6XDv9uTJ1iXTg== +jest-util@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.5.0.tgz#9d9cb06d9dcccc8e7cc76df91b1635025d7baa84" + integrity sha512-Xy8JsD0jvBz85K7VsTIQDuY44s+hYJyppAhcsHsOsGisVtdhar6fajf2UOf2mEVEgh15ZSdA0zkCuheN8cbr1Q== dependencies: "@jest/console" "^24.3.0" - "@jest/fake-timers" "^24.3.0" + "@jest/fake-timers" "^24.5.0" "@jest/source-map" "^24.3.0" - "@jest/test-result" "^24.3.0" - "@jest/types" "^24.3.0" + "@jest/test-result" "^24.5.0" + "@jest/types" "^24.5.0" "@types/node" "*" callsites "^3.0.0" chalk "^2.0.1" @@ -5830,30 +5830,30 @@ jest-util@^24.3.0: slash "^2.0.0" source-map "^0.6.0" -jest-validate@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.4.0.tgz#4f19c7d738a6bb700620c766428c7738d6985555" - integrity sha512-XESrpRYneLmiN9ayFm9RhBV5dwmhRZ+LbebScuuQ5GsY6ILpX9UeUMUdQ5Iz++YxFsmn5Lyi/Wkw6EV4v7nNTg== +jest-validate@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.5.0.tgz#62fd93d81214c070bb2d7a55f329a79d8057c7de" + integrity sha512-gg0dYszxjgK2o11unSIJhkOFZqNRQbWOAB2/LOUdsd2LfD9oXiMeuee8XsT0iRy5EvSccBgB4h/9HRbIo3MHgQ== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" camelcase "^5.0.0" chalk "^2.0.1" jest-get-type "^24.3.0" leven "^2.1.0" - pretty-format "^24.4.0" + pretty-format "^24.5.0" -jest-watcher@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.3.0.tgz#ee51c6afbe4b35a12fcf1107556db6756d7b9290" - integrity sha512-EpJS/aUG8D3DMuy9XNA4fnkKWy3DQdoWhY92ZUdlETIeEn1xya4Np/96MBSh4II5YvxwKe6JKwbu3Bnzfwa7vA== +jest-watcher@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.5.0.tgz#da7bd9cb5967e274889b42078c8f501ae1c47761" + integrity sha512-/hCpgR6bg0nKvD3nv4KasdTxuhwfViVMHUATJlnGCD0r1QrmIssimPbmc5KfAQblAVxkD8xrzuij9vfPUk1/rA== dependencies: - "@jest/test-result" "^24.3.0" - "@jest/types" "^24.3.0" + "@jest/test-result" "^24.5.0" + "@jest/types" "^24.5.0" "@types/node" "*" "@types/yargs" "^12.0.9" ansi-escapes "^3.0.0" chalk "^2.0.1" - jest-util "^24.3.0" + jest-util "^24.5.0" string-length "^2.0.0" jest-worker@^24.4.0: @@ -5865,13 +5865,13 @@ jest-worker@^24.4.0: merge-stream "^1.0.1" supports-color "^6.1.0" -jest@24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.4.0.tgz#688b71a2dadd41e26d0cfc04e1ddcacf30a1efbb" - integrity sha512-gAGfjvu8hHN0N6/aDyCBpncWWBcpY6wq69Msq/I6Xd763q/ZYBEMh0SKUomrViFoJ/dyistA6b4aJh8e+5QMyw== +jest@24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.5.0.tgz#38f11ae2c2baa2f86c2bc4d8a91d2b51612cd19a" + integrity sha512-lxL+Fq5/RH7inxxmfS2aZLCf8MsS+YCUBfeiNO6BWz/MmjhDGaIEA/2bzEf9q4Q0X+mtFHiinHFvQ0u+RvW/qQ== dependencies: import-local "^2.0.0" - jest-cli "^24.4.0" + jest-cli "^24.5.0" joi@^11.1.1: version "11.4.0" @@ -8205,12 +8205,12 @@ pretty-error@^2.0.2: renderkid "^2.0.1" utila "~0.4" -pretty-format@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.4.0.tgz#48db91969eb89f272c1bf3514bc5d5b228b3e722" - integrity sha512-SEXFzT01NwO4vaymwhz1/CM+wKCLOT92uqrzxIjmdRQMt7JAEuZ2eInCMvDS+4ZidEB+Rdq+fMs/Vwse8VAh1A== +pretty-format@^24.5.0: + version "24.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.5.0.tgz#cc69a0281a62cd7242633fc135d6930cd889822d" + integrity sha512-/3RuSghukCf8Riu5Ncve0iI+BzVkbRU5EeUoArKARZobREycuH5O4waxvaNIloEXdb0qwgmEAed5vTpX1HNROQ== dependencies: - "@jest/types" "^24.3.0" + "@jest/types" "^24.5.0" ansi-regex "^4.0.0" ansi-styles "^3.2.0" react-is "^16.8.4" From 1d957fcf30fdfb7b49157bdfd879f6ed757d91f3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Wed, 13 Mar 2019 11:58:41 +0800 Subject: [PATCH 28/43] fix(deps): update dependency googleapis to v38 (#1740) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 9e6f98b9b5b123..263596b02c56d3 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "dayjs": "^1.7.7", "form-data": "^2.3.2", "git-rev-sync": "1.12.0", - "googleapis": "37.2.0", + "googleapis": "38.0.0", "he": "^1.1.1", "iconv-lite": "0.4.24", "imgur": "^0.3.1", diff --git a/yarn.lock b/yarn.lock index c0605f72a9da6a..6164dfb64d1391 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4541,10 +4541,10 @@ googleapis-common@^0.7.0: url-template "^2.0.8" uuid "^3.2.1" -googleapis@37.2.0: - version "37.2.0" - resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-37.2.0.tgz#63bfcadaccc7cb8c1d8dff90573c48ca18132409" - integrity sha512-UenlZ0c4eaVAylIPvvsIlL/q5/3Xg8DuKug5aqdmRMk+tTVfJUmEKgp3s4ZSUOI5oKqO/+arIW5UnY2S62B13w== +googleapis@38.0.0: + version "38.0.0" + resolved "https://registry.yarnpkg.com/googleapis/-/googleapis-38.0.0.tgz#780453875d56ea3cc2ed70063cd59db068b8a0f0" + integrity sha512-8p3gYviQniL4bsRJV79ZIXHEPjVpI+z8UBNrrHcBOv6aEGWZPKa2bpStMocHXNQ4E39GhZdMON857e0BAJ2Z0Q== dependencies: google-auth-library "^3.0.0" googleapis-common "^0.7.0" From 909b0fdf4dbad396e9988ebfc3e023adce822fa5 Mon Sep 17 00:00:00 2001 From: Chenyang Shi Date: Wed, 13 Mar 2019 12:07:30 +0800 Subject: [PATCH 29/43] =?UTF-8?q?add=20=E4=BB=8A=E6=97=A5=E7=83=AD?= =?UTF-8?q?=E6=A6=9C=20(#1741)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #1734 --- docs/README.md | 4 ++++ lib/router.js | 3 +++ lib/routes/tophub/index.js | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 lib/routes/tophub/index.js diff --git a/docs/README.md b/docs/README.md index 2b62b08e834deb..15eff5886fc894 100755 --- a/docs/README.md +++ b/docs/README.md @@ -3169,3 +3169,7 @@ type 为 all 时,category 参数不支持 cost 和 free + +### 今日热榜 + + diff --git a/lib/router.js b/lib/router.js index ea02c2d7414d79..695ecfda123766 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1145,6 +1145,9 @@ router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link')); router.get('/uraaka-joshi', require('./routes/uraaka-joshi/uraaka-joshi')); router.get('/uraaka-joshi/:id', require('./routes/uraaka-joshi/uraaka-joshi-user')); +// 今日热榜 +router.get('/tophub/:id', require('./routes/tophub')); + // 游戏时光 router.get('/vgtime/news', require('./routes/vgtime/news.js')); router.get('/vgtime/release', require('./routes/vgtime/release')); diff --git a/lib/routes/tophub/index.js b/lib/routes/tophub/index.js new file mode 100644 index 00000000000000..44dc42ecf6aa6e --- /dev/null +++ b/lib/routes/tophub/index.js @@ -0,0 +1,34 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const id = ctx.params.id; + + const link = `https://tophub.today/n/${id}`; + const response = await axios.get(link); + const $ = cheerio.load(response.data); + + const title = $('div.Xc-ec-L.b-L') + .text() + .trim(); + + const out = $('div.Zd-p-Sc > div:nth-child(1) tr') + .map(function() { + const info = { + title: $(this) + .find('td.al a') + .text(), + link: $(this) + .find('td.al a') + .attr('href'), + }; + return info; + }) + .get(); + + ctx.state.data = { + title: title, + link: link, + item: out, + }; +}; From 7c72d91b1b51d7e85266ac9da37c16fda82233b9 Mon Sep 17 00:00:00 2001 From: RANPOX Date: Wed, 13 Mar 2019 12:38:04 +0800 Subject: [PATCH 30/43] =?UTF-8?q?fix=20=E4=BB=8A=E6=97=A5=E5=93=88?= =?UTF-8?q?=E5=B7=A5=E5=A4=A7=20=E5=93=88=E5=B7=A5=E5=A4=A7=E6=95=99?= =?UTF-8?q?=E5=8A=A1=E5=A4=84=20=E6=88=AA=E5=8F=96=E9=94=99=E8=AF=AF=20(#1?= =?UTF-8?q?742)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pr #1674 中的 commit 246b1bc9f372baa258459b930cb8aa722d6d9006 "chore: 大学路由限制条数" 使用splice函数对很多大学的返回条目进行了限制,但是随之产生了bug,这里对哈工大进行了修复,但是其他大学(包括但不限于华中科技大学 山东大学等)仍存在问题。 --- lib/routes/universities/hit/jwc.js | 2 +- lib/routes/universities/hit/today.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/routes/universities/hit/jwc.js b/lib/routes/universities/hit/jwc.js index acc3c1222e9aa7..86ddc6c4a75de0 100644 --- a/lib/routes/universities/hit/jwc.js +++ b/lib/routes/universities/hit/jwc.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const { data } = response; const $ = cheerio.load(data); const links = $('.news_list li') - .splice(0, 10) + .slice(0, 10) .map((i, el) => ({ pubDate: new Date( $('span.fbll', el) diff --git a/lib/routes/universities/hit/today.js b/lib/routes/universities/hit/today.js index f61e968f74f107..ab206a2a87a3a0 100644 --- a/lib/routes/universities/hit/today.js +++ b/lib/routes/universities/hit/today.js @@ -16,7 +16,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const category_name = $('div.banner-title').text(); const list = $('.paragraph li') - .splice(0, 10) + .slice(0, 10) .map((i, e) => ({ path: $('span span a', e).attr('href'), title: $('span span a', e).text(), From af1df7f1788aa9070f48170b8a844cc8ddaaa2d5 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 13 Mar 2019 12:45:24 +0800 Subject: [PATCH 31/43] fix splice --- lib/routes/universities/buaa/news/index.js | 2 +- lib/routes/universities/cczu/jwc.js | 2 +- lib/routes/universities/cczu/news.js | 2 +- lib/routes/universities/cpu/home.js | 2 +- lib/routes/universities/cpu/jwc.js | 2 +- lib/routes/universities/cpu/yjsy.js | 2 +- lib/routes/universities/cqust/jw.js | 2 +- lib/routes/universities/cqust/lib.js | 2 +- lib/routes/universities/dgut/jwc.js | 2 +- lib/routes/universities/dgut/xsc.js | 2 +- lib/routes/universities/dlu/jiaowu/news.js | 2 +- lib/routes/universities/dpu/jiaowu/news.js | 2 +- lib/routes/universities/dpu/wlfw/news.js | 2 +- lib/routes/universities/henu/news.js | 2 +- lib/routes/universities/hust/aia/news.js | 2 +- lib/routes/universities/hust/aia/notice.js | 2 +- lib/routes/universities/kmust/job/careers.js | 2 +- lib/routes/universities/kmust/job/jobfairs.js | 2 +- lib/routes/universities/kmust/jwc.js | 2 +- lib/routes/universities/nchu/jwc.js | 2 +- lib/routes/universities/njust/cwc/index.js | 2 +- lib/routes/universities/njust/gs/index.js | 2 +- lib/routes/universities/njust/jwc/index.js | 2 +- lib/routes/universities/nku/jwc/index.js | 2 +- lib/routes/universities/nuist/bulletin.js | 2 +- lib/routes/universities/nuist/cas.js | 2 +- lib/routes/universities/pku/eecs.js | 2 +- lib/routes/universities/scnu/jw.js | 2 +- lib/routes/universities/scnu/library.js | 2 +- .../universities/sctu/information-engineer-faculty/context.js | 2 +- .../universities/sctu/information-engineer-faculty/index.js | 2 +- lib/routes/universities/sctu/jwc/context.js | 2 +- lib/routes/universities/sctu/jwc/index.js | 2 +- lib/routes/universities/sdu/cmse.js | 2 +- lib/routes/universities/sdu/epe.js | 2 +- lib/routes/universities/sdu/grad/academic.js | 2 +- lib/routes/universities/sdu/mech.js | 2 +- lib/routes/universities/sdu/sc.js | 2 +- lib/routes/universities/seu/yzb/index.js | 2 +- lib/routes/universities/shmtu/events.js | 2 +- lib/routes/universities/shmtu/jwc.js | 2 +- lib/routes/universities/shmtu/notes.js | 2 +- lib/routes/universities/shu/jwc.js | 2 +- lib/routes/universities/sjtu/gs/tzgg.js | 2 +- lib/routes/universities/sjtu/seiee/academic.js | 2 +- lib/routes/universities/sjtu/seiee/bjwb/abroad.js | 2 +- lib/routes/universities/sjtu/seiee/bjwb/international.js | 2 +- lib/routes/universities/sjtu/seiee/bjwb/major_select.js | 2 +- lib/routes/universities/sjtu/seiee/bjwb/major_transfer.js | 2 +- lib/routes/universities/sjtu/seiee/bjwb/postgraduate.js | 2 +- lib/routes/universities/sjtu/seiee/xsb.js | 2 +- lib/routes/universities/sysu/sdcs.js | 2 +- lib/routes/universities/tju/sse/notice.js | 2 +- lib/routes/universities/uestc/jwc.js | 2 +- lib/routes/universities/uestc/news.js | 2 +- lib/routes/universities/wzbc/news.js | 4 ++-- 56 files changed, 57 insertions(+), 57 deletions(-) diff --git a/lib/routes/universities/buaa/news/index.js b/lib/routes/universities/buaa/news/index.js index ed27d53cbf69b9..464868be709318 100644 --- a/lib/routes/universities/buaa/news/index.js +++ b/lib/routes/universities/buaa/news/index.js @@ -53,7 +53,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); - const list = $('.mainleft > .listlefttop > .listleftop1').splice(0, 10); + const list = $('.mainleft > .listlefttop > .listleftop1').slice(0, 10); const result = await util.ProcessFeed(list, ctx.cache); diff --git a/lib/routes/universities/cczu/jwc.js b/lib/routes/universities/cczu/jwc.js index 88f2170c4f0c80..1efa09ad6bcf91 100644 --- a/lib/routes/universities/cczu/jwc.js +++ b/lib/routes/universities/cczu/jwc.js @@ -24,7 +24,7 @@ module.exports = async (ctx) => { link: pageUrl, title: category === 'all' ? baseTitle : `${baseTitle} ${$('title').text()}`, item: $('div[id^="wp_news_w"] a') - .splice(0, 10) + .slice(0, 10) .filter((_, elem) => elem.attribs.href.match(entryUrlRegex)) .map((_, elem) => ({ link: url.resolve(pageUrl, elem.attribs.href), diff --git a/lib/routes/universities/cczu/news.js b/lib/routes/universities/cczu/news.js index 4f1e322b3b322a..0819169c74e153 100644 --- a/lib/routes/universities/cczu/news.js +++ b/lib/routes/universities/cczu/news.js @@ -24,7 +24,7 @@ module.exports = async (ctx) => { link: pageUrl, title: category === 'all' ? baseTitle : `${baseTitle} ${$('title').text()}`, item: $('div[id^="wp_news_w"] a') - .splice(0, 10) + .slice(0, 10) .filter((_, elem) => elem.attribs.href.match(entryUrlRegex)) .map((_, elem) => ({ link: url.resolve(pageUrl, elem.attribs.href), diff --git a/lib/routes/universities/cpu/home.js b/lib/routes/universities/cpu/home.js index d6d6e07b2888ad..f2a9a267e3e474 100644 --- a/lib/routes/universities/cpu/home.js +++ b/lib/routes/universities/cpu/home.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const $list = $('div#wp_news_w3 a').splice(0, 10); + const $list = $('div#wp_news_w3 a').slice(0, 10); const resultItem = await Promise.all( $list.map(async (item) => { diff --git a/lib/routes/universities/cpu/jwc.js b/lib/routes/universities/cpu/jwc.js index 24c6b406fcffba..ba5fdcd740a273 100644 --- a/lib/routes/universities/cpu/jwc.js +++ b/lib/routes/universities/cpu/jwc.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const $list = $('div#wp_news_w6 ul.news_list li a').splice(0, 10); + const $list = $('div#wp_news_w6 ul.news_list li a').slice(0, 10); const resultItem = await Promise.all( $list.map(async (item) => { diff --git a/lib/routes/universities/cpu/yjsy.js b/lib/routes/universities/cpu/yjsy.js index 4cd39f20c49c95..82e79acc11a9ab 100644 --- a/lib/routes/universities/cpu/yjsy.js +++ b/lib/routes/universities/cpu/yjsy.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const $list = $('div.listbox tbody td a').splice(0, 10); + const $list = $('div.listbox tbody td a').slice(0, 10); const resultItem = await Promise.all( $list.map(async (item) => { diff --git a/lib/routes/universities/cqust/jw.js b/lib/routes/universities/cqust/jw.js index f992180cab86c9..378886387b32e8 100644 --- a/lib/routes/universities/cqust/jw.js +++ b/lib/routes/universities/cqust/jw.js @@ -13,7 +13,7 @@ module.exports = async (ctx) => { const link = host + map[type]; const response = await axios.get(link); const $ = cheerio.load(response.data); - const list = $('li[id^="lineu"]').splice(0, 10); + const list = $('li[id^="lineu"]').slice(0, 10); ctx.state.data = { title: '重科教务处', diff --git a/lib/routes/universities/cqust/lib.js b/lib/routes/universities/cqust/lib.js index c6b5f5a247840a..c417f1d2718c98 100644 --- a/lib/routes/universities/cqust/lib.js +++ b/lib/routes/universities/cqust/lib.js @@ -18,7 +18,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('div[class="newsList"]') .find('li') - .splice(0, 10); + .slice(0, 10); ctx.state.data = { title: '重科图书馆', diff --git a/lib/routes/universities/dgut/jwc.js b/lib/routes/universities/dgut/jwc.js index a3de7616993ff7..d8e569ba74afd4 100644 --- a/lib/routes/universities/dgut/jwc.js +++ b/lib/routes/universities/dgut/jwc.js @@ -32,7 +32,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const text = $('div.con-right') .find('div.list_div') - .splice(0, 10); + .slice(0, 10); ctx.state.data = { title: `东莞理工学院 ${name} ${info}`, diff --git a/lib/routes/universities/dgut/xsc.js b/lib/routes/universities/dgut/xsc.js index ae6fffebb60310..9626c481a085c5 100644 --- a/lib/routes/universities/dgut/xsc.js +++ b/lib/routes/universities/dgut/xsc.js @@ -35,7 +35,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const text = $('#paging > ul') .find('li') - .splice(0, 10); + .slice(0, 10); ctx.state.data = { title: `东莞理工学院 ${name} ${info}`, diff --git a/lib/routes/universities/dlu/jiaowu/news.js b/lib/routes/universities/dlu/jiaowu/news.js index 245205add8f16a..c7c2429352551e 100644 --- a/lib/routes/universities/dlu/jiaowu/news.js +++ b/lib/routes/universities/dlu/jiaowu/news.js @@ -31,7 +31,7 @@ module.exports = async (ctx) => { link: base_url, title: '大连大学教务处', item: $('td[valign="top"]>table[cellspacing="3"][width="100%"] tr') - .splice(0, 10) + .slice(0, 10) .map((_, elem) => ({ link: resolve_url(base_url, $('a', elem).attr('href')), title: $('a', elem).attr('title'), diff --git a/lib/routes/universities/dpu/jiaowu/news.js b/lib/routes/universities/dpu/jiaowu/news.js index 4eedcfe470ed1a..71adb811884b02 100644 --- a/lib/routes/universities/dpu/jiaowu/news.js +++ b/lib/routes/universities/dpu/jiaowu/news.js @@ -30,7 +30,7 @@ module.exports = async (ctx) => { link: link, title: $('#more>h1').text(), item: $('.more_list>li') - .splice(0, 10) + .slice(0, 10) .map((_, elem) => ({ link: resolve_url(base_url, $('a', elem).attr('href')), title: $('a', elem).text(), diff --git a/lib/routes/universities/dpu/wlfw/news.js b/lib/routes/universities/dpu/wlfw/news.js index f8dde456abe3f6..2abeb6bdeff094 100644 --- a/lib/routes/universities/dpu/wlfw/news.js +++ b/lib/routes/universities/dpu/wlfw/news.js @@ -29,7 +29,7 @@ module.exports = async (ctx) => { link: link, title: $('#more>h1').text(), item: $('.more_list>li') - .splice(0, 10) + .slice(0, 10) .map((_, elem) => ({ link: resolve_url(base_url, $('a', elem).attr('href')), title: $('a', elem).text(), diff --git a/lib/routes/universities/henu/news.js b/lib/routes/universities/henu/news.js index 5936e32c2761f2..c57964927ca388 100644 --- a/lib/routes/universities/henu/news.js +++ b/lib/routes/universities/henu/news.js @@ -28,7 +28,7 @@ module.exports = async (ctx) => { link: link, title: $('title').text(), item: $('.list>tr') - .splice(0, 10) + .slice(0, 10) .map((_, elem) => ({ link: resolve_url(link, $('a', elem).attr('href')), title: $('tit1', elem).text(), diff --git a/lib/routes/universities/hust/aia/news.js b/lib/routes/universities/hust/aia/news.js index b76158e7ce7720..efbffcdd8128b1 100755 --- a/lib/routes/universities/hust/aia/news.js +++ b/lib/routes/universities/hust/aia/news.js @@ -6,7 +6,7 @@ module.exports = async (ctx) => { const link = 'http://aia.hust.edu.cn/yxxw.htm'; const response = await axios.get(link); const $ = cheerio.load(response.data); - const list = $('.N02_list li dl').splice(0, 10); + const list = $('.N02_list li dl').slice(0, 10); ctx.state.data = { title: '华科人工智能和自动化学院新闻', diff --git a/lib/routes/universities/hust/aia/notice.js b/lib/routes/universities/hust/aia/notice.js index d085d55d294771..d0dcf68d5d7341 100755 --- a/lib/routes/universities/hust/aia/notice.js +++ b/lib/routes/universities/hust/aia/notice.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { const list = $('.m_content .m_con') .eq(type) .find('.N02_list_dl') - .splice(0, 10); + .slice(0, 10); ctx.state.data = { title: `华科人工智能和自动化学院${typelist[type]}通知`, diff --git a/lib/routes/universities/kmust/job/careers.js b/lib/routes/universities/kmust/job/careers.js index 8209d0a663602b..9bb3778b35a73e 100644 --- a/lib/routes/universities/kmust/job/careers.js +++ b/lib/routes/universities/kmust/job/careers.js @@ -21,7 +21,7 @@ module.exports = async (ctx) => { link: url.resolve(baseUrl, `/module/careers${type === 'outer' && '?type=outer'}`), item: data.data && - data.data.splice(0, 10).map((item) => { + data.data.slice(0, 10).map((item) => { const { meet_day = '', meet_time = '', company_name = '', school_name = '', address = '', company_property = '', industry_category = '', career_talk_id = '' } = item; return { title: `【${meet_day} ${meet_time}】${company_name}`, diff --git a/lib/routes/universities/kmust/job/jobfairs.js b/lib/routes/universities/kmust/job/jobfairs.js index ee17f6fdb59101..cfb1f165516ac8 100644 --- a/lib/routes/universities/kmust/job/jobfairs.js +++ b/lib/routes/universities/kmust/job/jobfairs.js @@ -20,7 +20,7 @@ module.exports = async (ctx) => { link: url.resolve(baseUrl, '/module/jobfairs'), item: data.data && - data.data.splice(0, 10).map((item) => { + data.data.slice(0, 10).map((item) => { const { meet_day = '', meet_time = '', title = '', school_name = '', address = '', fair_id = '' } = item; return { title: `【${meet_day} ${meet_time}】${title}`, diff --git a/lib/routes/universities/kmust/jwc.js b/lib/routes/universities/kmust/jwc.js index 2c90d91bbc5a87..c53fdfcaabce02 100644 --- a/lib/routes/universities/kmust/jwc.js +++ b/lib/routes/universities/kmust/jwc.js @@ -33,7 +33,7 @@ module.exports = async (ctx) => { link: pageUrl, title, item: $('table[width="92%"] a[target="_blank"]') - .splice(0, 10) + .slice(0, 10) .map((_, elem) => ({ link: url.resolve(baseUrl, elem.attribs.href), title: elem.children[0].data, diff --git a/lib/routes/universities/nchu/jwc.js b/lib/routes/universities/nchu/jwc.js index 002ccf2d230c52..1e7b46d7d40637 100644 --- a/lib/routes/universities/nchu/jwc.js +++ b/lib/routes/universities/nchu/jwc.js @@ -25,7 +25,7 @@ module.exports = async (ctx) => { const linkList = $('td[width=515]') .find('a') - .splice(0, 10) + .slice(0, 10) .map((_, e) => ({ title: $(e).text(), link: `${host}/${$(e).attr('href')}`, diff --git a/lib/routes/universities/njust/cwc/index.js b/lib/routes/universities/njust/cwc/index.js index 4b08bf3d189064..74b193e36e89f4 100644 --- a/lib/routes/universities/njust/cwc/index.js +++ b/lib/routes/universities/njust/cwc/index.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { const id = map.get(type).id; const items = $(`#${id} tr tr`) - .splice(0, 10) + .slice(0, 10) .map((_, elem) => { const a = $('td:first-child > a', elem); return { diff --git a/lib/routes/universities/njust/gs/index.js b/lib/routes/universities/njust/gs/index.js index e756e8855c1f75..8c28e39017b2b3 100644 --- a/lib/routes/universities/njust/gs/index.js +++ b/lib/routes/universities/njust/gs/index.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { }, }); const $ = cheerio.load(res.data); - const list = $('.wp_article_list li').splice(0, 10); + const list = $('.wp_article_list li').slice(0, 10); ctx.state.data = { title: map.get(type).title, diff --git a/lib/routes/universities/njust/jwc/index.js b/lib/routes/universities/njust/jwc/index.js index b8c78c8cbec7d3..e656040b6422a2 100644 --- a/lib/routes/universities/njust/jwc/index.js +++ b/lib/routes/universities/njust/jwc/index.js @@ -20,7 +20,7 @@ module.exports = async (ctx) => { const id = map.get(type).id; const items = $(`#${id} tr tr`) - .splice(0, 10) + .slice(0, 10) .map((_, elem) => { const a = $('td:first-child > a', elem); return { diff --git a/lib/routes/universities/nku/jwc/index.js b/lib/routes/universities/nku/jwc/index.js index a2130e54128b75..b07c4238f2167f 100644 --- a/lib/routes/universities/nku/jwc/index.js +++ b/lib/routes/universities/nku/jwc/index.js @@ -23,7 +23,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); - const list = $('#wp_news_w6 ul li').splice(0, 10); + const list = $('#wp_news_w6 ul li').slice(0, 10); ctx.state.data = { title: '南开大学教务处', diff --git a/lib/routes/universities/nuist/bulletin.js b/lib/routes/universities/nuist/bulletin.js index f995305cc12046..1cbe1ab4d342c7 100644 --- a/lib/routes/universities/nuist/bulletin.js +++ b/lib/routes/universities/nuist/bulletin.js @@ -29,7 +29,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.news_list') .find('.news') - .splice(0, 10); + .slice(0, 10); ctx.state.data = { title: baseTitle + (category === '791' ? '' : ':' + map[category]), diff --git a/lib/routes/universities/nuist/cas.js b/lib/routes/universities/nuist/cas.js index 14ca39ed329e8b..cbdc2bf7974172 100644 --- a/lib/routes/universities/nuist/cas.js +++ b/lib/routes/universities/nuist/cas.js @@ -25,7 +25,7 @@ module.exports = async (ctx) => { .map((index, item) => { const td = $(item) .find('td.gridline') - .splice(0, 10); + .slice(0, 10); return { title: $(item) .find('.Title') diff --git a/lib/routes/universities/pku/eecs.js b/lib/routes/universities/pku/eecs.js index 211f9d73c12ad2..3b305beddaf6b1 100644 --- a/lib/routes/universities/pku/eecs.js +++ b/lib/routes/universities/pku/eecs.js @@ -18,7 +18,7 @@ module.exports = async (ctx) => { }); const $ = cheerio.load(response.data); - const text = $('.hvr-shutter-out-vertical').splice(0, 10); + const text = $('.hvr-shutter-out-vertical').slice(0, 10); ctx.state.data = { title: '北大信科通知', diff --git a/lib/routes/universities/scnu/jw.js b/lib/routes/universities/scnu/jw.js index 00bf564eef7dc8..4358de745ea554 100644 --- a/lib/routes/universities/scnu/jw.js +++ b/lib/routes/universities/scnu/jw.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(res.data); const list = $('.notice_01') .find('li') - .splice(0, 10); + .slice(0, 10); ctx.state.data = { title: $('title') diff --git a/lib/routes/universities/scnu/library.js b/lib/routes/universities/scnu/library.js index 23c94500493793..d97d0e05940f35 100644 --- a/lib/routes/universities/scnu/library.js +++ b/lib/routes/universities/scnu/library.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(res.data); const list = $('.article-list') .find('li') - .splice(0, 10); + .slice(0, 10); ctx.state.data = { title: $('title').text(), diff --git a/lib/routes/universities/sctu/information-engineer-faculty/context.js b/lib/routes/universities/sctu/information-engineer-faculty/context.js index 97a0eea179728d..119fd5f58f2957 100644 --- a/lib/routes/universities/sctu/information-engineer-faculty/context.js +++ b/lib/routes/universities/sctu/information-engineer-faculty/context.js @@ -21,7 +21,7 @@ module.exports = async (ctx) => { const $ = formal(response.data); - const list = $('.data').splice(0, 10); + const list = $('.data').slice(0, 10); ctx.state.data = { title: '四川旅游学院', diff --git a/lib/routes/universities/sctu/information-engineer-faculty/index.js b/lib/routes/universities/sctu/information-engineer-faculty/index.js index b5284413158fcc..d526db16b76ac4 100644 --- a/lib/routes/universities/sctu/information-engineer-faculty/index.js +++ b/lib/routes/universities/sctu/information-engineer-faculty/index.js @@ -16,7 +16,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(data); - const list = $('.list_dt a').splice(0, 10); + const list = $('.list_dt a').slice(0, 10); ctx.state.data = { title: '四川旅游学院信息与工程系', diff --git a/lib/routes/universities/sctu/jwc/context.js b/lib/routes/universities/sctu/jwc/context.js index 8706b45f217851..e7c1d08853a706 100644 --- a/lib/routes/universities/sctu/jwc/context.js +++ b/lib/routes/universities/sctu/jwc/context.js @@ -21,7 +21,7 @@ module.exports = async (ctx) => { const $ = formal(response.data); - const list = $('#list2').splice(0, 10); + const list = $('#list2').slice(0, 10); ctx.state.data = { title: '四川旅游学院信息与工程学院', diff --git a/lib/routes/universities/sctu/jwc/index.js b/lib/routes/universities/sctu/jwc/index.js index 8560e483233e2f..60df64d5166fbb 100644 --- a/lib/routes/universities/sctu/jwc/index.js +++ b/lib/routes/universities/sctu/jwc/index.js @@ -22,7 +22,7 @@ module.exports = async (ctx) => { const $ = formal(response.data); - const list = $('#list1 ul li').splice(0, 10); + const list = $('#list1 ul li').slice(0, 10); ctx.state.data = { title: '四川旅游学院', diff --git a/lib/routes/universities/sdu/cmse.js b/lib/routes/universities/sdu/cmse.js index 8fa0076a85a1b3..45bfc29b100b6a 100644 --- a/lib/routes/universities/sdu/cmse.js +++ b/lib/routes/universities/sdu/cmse.js @@ -14,7 +14,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('#list_right_list a') - .splice(0, 10) + .slice(0, 10) .map((i, e) => $(e).attr('href')) .get(); diff --git a/lib/routes/universities/sdu/epe.js b/lib/routes/universities/sdu/epe.js index 3ae20688c07345..b52046889727a8 100644 --- a/lib/routes/universities/sdu/epe.js +++ b/lib/routes/universities/sdu/epe.js @@ -14,7 +14,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('#page_right_main li a') - .splice(0, 10) + .slice(0, 10) .map((i, e) => $(e).attr('href')) .get(); diff --git a/lib/routes/universities/sdu/grad/academic.js b/lib/routes/universities/sdu/grad/academic.js index 13eb13ded53ab6..cb8caaf193f963 100644 --- a/lib/routes/universities/sdu/grad/academic.js +++ b/lib/routes/universities/sdu/grad/academic.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('#div_more_news a') - .splice(0, 10) + .slice(0, 10) .map((i, e) => $(e).attr('href')) .get(); diff --git a/lib/routes/universities/sdu/mech.js b/lib/routes/universities/sdu/mech.js index 27cfc948fe21e4..e34a25da74d3fe 100644 --- a/lib/routes/universities/sdu/mech.js +++ b/lib/routes/universities/sdu/mech.js @@ -14,7 +14,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('#page_list li a') - .splice(0, 10) + .slice(0, 10) .map((i, e) => $(e).attr('href')) .get(); diff --git a/lib/routes/universities/sdu/sc.js b/lib/routes/universities/sdu/sc.js index 9ba6b7d3a885ab..962cba90c19cf1 100644 --- a/lib/routes/universities/sdu/sc.js +++ b/lib/routes/universities/sdu/sc.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { const dateDict = {}; const list = $('#div_more_news .leftNews') - .splice(0, 10) + .slice(0, 10) .map((i, e) => { const divs = $(e).children(); let c_link = $('a', divs[1]).attr('href'); diff --git a/lib/routes/universities/seu/yzb/index.js b/lib/routes/universities/seu/yzb/index.js index 6475359d4fff22..bf1e320c787a2c 100644 --- a/lib/routes/universities/seu/yzb/index.js +++ b/lib/routes/universities/seu/yzb/index.js @@ -19,7 +19,7 @@ module.exports = async (ctx) => { const id = map.get(type).id; const items = $(`#${id} tr tr`) - .splice(0, 10) + .slice(0, 10) .map((_, elem) => { const a = $('td:first-child > a', elem); return { diff --git a/lib/routes/universities/shmtu/events.js b/lib/routes/universities/shmtu/events.js index 509a528e24574e..9891ac6129dd0e 100644 --- a/lib/routes/universities/shmtu/events.js +++ b/lib/routes/universities/shmtu/events.js @@ -13,7 +13,7 @@ module.exports = async (ctx) => { }); const $ = cheerio.load(response.data); - const text = $('tr', 'tbody').splice(0, 10); + const text = $('tr', 'tbody').slice(0, 10); ctx.state.data = { title: '上海海事大学 学术讲座', diff --git a/lib/routes/universities/shmtu/jwc.js b/lib/routes/universities/shmtu/jwc.js index cbdfa27b89d1f3..e273db000b34b9 100644 --- a/lib/routes/universities/shmtu/jwc.js +++ b/lib/routes/universities/shmtu/jwc.js @@ -15,7 +15,7 @@ module.exports = async (ctx) => { }); const $ = cheerio.load(response.data); - const text = $('.gvRow', '.tdMCViewList').splice(0, 10); + const text = $('.gvRow', '.tdMCViewList').slice(0, 10); ctx.state.data = { title: `上海海事大学 ${info}`, diff --git a/lib/routes/universities/shmtu/notes.js b/lib/routes/universities/shmtu/notes.js index ec315fceb61186..33a161cd9e6023 100644 --- a/lib/routes/universities/shmtu/notes.js +++ b/lib/routes/universities/shmtu/notes.js @@ -13,7 +13,7 @@ module.exports = async (ctx) => { }); const $ = cheerio.load(response.data); - const text = $('tr', 'tbody').splice(0, 10); + const text = $('tr', 'tbody').slice(0, 10); ctx.state.data = { title: '上海海事大学 通知公告', diff --git a/lib/routes/universities/shu/jwc.js b/lib/routes/universities/shu/jwc.js index 68360b3d4b759d..80dec9e5f36288 100644 --- a/lib/routes/universities/shu/jwc.js +++ b/lib/routes/universities/shu/jwc.js @@ -25,7 +25,7 @@ module.exports = async (ctx) => { const respond = await axios.get(link); const $ = cheerio.load(respond.data); const list = $('#dnn_ctr43516_ArticleList__ctl0_ArtDataList__ctl1_titleLink1') - .splice(0, 10) + .slice(0, 10) .map(function(index, ele) { return { title: $(ele).attr('title'), diff --git a/lib/routes/universities/sjtu/gs/tzgg.js b/lib/routes/universities/sjtu/gs/tzgg.js index d5e715e1f9691c..30fff8746acd0b 100644 --- a/lib/routes/universities/sjtu/gs/tzgg.js +++ b/lib/routes/universities/sjtu/gs/tzgg.js @@ -19,7 +19,7 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const list = $('.comm li').splice(0, 10); + const list = $('.comm li').slice(0, 10); const result = await util.ProcessFeed(list, ctx.cache, url); diff --git a/lib/routes/universities/sjtu/seiee/academic.js b/lib/routes/universities/sjtu/seiee/academic.js index 0a6d38523e34b3..6698ac94aaae91 100644 --- a/lib/routes/universities/sjtu/seiee/academic.js +++ b/lib/routes/universities/sjtu/seiee/academic.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.list_style_1 li a') - .splice(0, 10) + .slice(0, 10) .map((i, e) => $(e).attr('href')) .get(); diff --git a/lib/routes/universities/sjtu/seiee/bjwb/abroad.js b/lib/routes/universities/sjtu/seiee/bjwb/abroad.js index 0e09bb847b119d..afc4d4a81a9f73 100644 --- a/lib/routes/universities/sjtu/seiee/bjwb/abroad.js +++ b/lib/routes/universities/sjtu/seiee/bjwb/abroad.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.list_box_5 li') - .splice(0, 10) + .slice(0, 10) .map((i, e) => ({ date: $(e) .children('span') diff --git a/lib/routes/universities/sjtu/seiee/bjwb/international.js b/lib/routes/universities/sjtu/seiee/bjwb/international.js index c72c9afab7718f..34f41c635f709f 100644 --- a/lib/routes/universities/sjtu/seiee/bjwb/international.js +++ b/lib/routes/universities/sjtu/seiee/bjwb/international.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.list_box_5 li') - .splice(0, 10) + .slice(0, 10) .map((i, e) => ({ date: $(e) .children('span') diff --git a/lib/routes/universities/sjtu/seiee/bjwb/major_select.js b/lib/routes/universities/sjtu/seiee/bjwb/major_select.js index 30992c53e904bb..aa1577ef5b58e6 100644 --- a/lib/routes/universities/sjtu/seiee/bjwb/major_select.js +++ b/lib/routes/universities/sjtu/seiee/bjwb/major_select.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.list_box_5 li') - .splice(0, 10) + .slice(0, 10) .map((i, e) => ({ date: $(e) .children('span') diff --git a/lib/routes/universities/sjtu/seiee/bjwb/major_transfer.js b/lib/routes/universities/sjtu/seiee/bjwb/major_transfer.js index 13f74643153498..daba64bc88cfe8 100644 --- a/lib/routes/universities/sjtu/seiee/bjwb/major_transfer.js +++ b/lib/routes/universities/sjtu/seiee/bjwb/major_transfer.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.list_box_5 li') - .splice(0, 10) + .slice(0, 10) .map((i, e) => ({ date: $(e) .children('span') diff --git a/lib/routes/universities/sjtu/seiee/bjwb/postgraduate.js b/lib/routes/universities/sjtu/seiee/bjwb/postgraduate.js index 56e9d3778e5a5b..874107e547198f 100644 --- a/lib/routes/universities/sjtu/seiee/bjwb/postgraduate.js +++ b/lib/routes/universities/sjtu/seiee/bjwb/postgraduate.js @@ -11,7 +11,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.list_box_5 li') - .splice(0, 10) + .slice(0, 10) .map((i, e) => ({ date: $(e) .children('span') diff --git a/lib/routes/universities/sjtu/seiee/xsb.js b/lib/routes/universities/sjtu/seiee/xsb.js index 6c93a4c7695631..ee2d37187532e3 100644 --- a/lib/routes/universities/sjtu/seiee/xsb.js +++ b/lib/routes/universities/sjtu/seiee/xsb.js @@ -39,7 +39,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('.list_box_5_2 li') - .splice(0, 10) + .slice(0, 10) .map((i, e) => ({ date: $(e) .children('span') diff --git a/lib/routes/universities/sysu/sdcs.js b/lib/routes/universities/sysu/sdcs.js index aa916c2b1bd7bd..bfe4ea13ee7099 100644 --- a/lib/routes/universities/sysu/sdcs.js +++ b/lib/routes/universities/sysu/sdcs.js @@ -9,7 +9,7 @@ module.exports = async (ctx) => { const $ = load(data); const urls = $('.view-content li > a') - .splice(0, 10) + .slice(0, 10) .map((_, ele) => $(ele).attr('href')) .toArray() .map((path) => path.match(/\/content\/(\d+)/)[1]) // extract article-id diff --git a/lib/routes/universities/tju/sse/notice.js b/lib/routes/universities/tju/sse/notice.js index 8d701fba7c19f3..e972946e77b5c6 100644 --- a/lib/routes/universities/tju/sse/notice.js +++ b/lib/routes/universities/tju/sse/notice.js @@ -24,7 +24,7 @@ module.exports = async (ctx) => { const a = $('ul.data-list') .find('a') - .splice(0, 10); + .slice(0, 10); for (let i = 0; i < a.length; ++i) { const tmp = $(a[i]).attr('href'); diff --git a/lib/routes/universities/uestc/jwc.js b/lib/routes/universities/uestc/jwc.js index 247ecd2dda65b8..352972809ac966 100644 --- a/lib/routes/universities/uestc/jwc.js +++ b/lib/routes/universities/uestc/jwc.js @@ -27,7 +27,7 @@ module.exports = async (ctx) => { title: '电子科技大学教务处通知公告', link: baseUrl, item: $('div[class="textAreo clearfix"] a') - .splice(0, 10) + .slice(0, 10) .map((_, elem) => ({ link: detailUrl + elem.attribs.newsid, title: elem.attribs.title, diff --git a/lib/routes/universities/uestc/news.js b/lib/routes/universities/uestc/news.js index 2eb898296d5f97..7979cbc704fa2d 100644 --- a/lib/routes/universities/uestc/news.js +++ b/lib/routes/universities/uestc/news.js @@ -22,7 +22,7 @@ module.exports = async (ctx) => { title: '电子科技大学新闻中心', link: baseUrl, item: $('div[id="Degas_news_list"] ul li h3 a') - .splice(0, 10) + .slice(0, 10) .map((_, elem) => ({ link: baseUrl + elem.attribs.href, title: $(elem).text(), diff --git a/lib/routes/universities/wzbc/news.js b/lib/routes/universities/wzbc/news.js index 31232ff617178d..bded0f5df885d9 100644 --- a/lib/routes/universities/wzbc/news.js +++ b/lib/routes/universities/wzbc/news.js @@ -4,7 +4,7 @@ const cheerio = require('cheerio'); const host = 'http://www.wzbc.edu.cn'; const parserAbb = ($) => { - const items = $('.newslist li').splice(0, 10); + const items = $('.newslist li').slice(0, 10); return { title: $('title').text(), item: @@ -24,7 +24,7 @@ const parserAbb = ($) => { }; const parserFull = ($) => { - const items = $('.picnewlist li').splice(0, 10); + const items = $('.picnewlist li').slice(0, 10); return { title: $('title').text(), item: From 1c7984272ecc75f87862d1188af84d7df9940a22 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Wed, 13 Mar 2019 12:59:55 +0800 Subject: [PATCH 32/43] fix $ get --- lib/routes/universities/buaa/news/index.js | 4 +++- lib/routes/universities/cpu/home.js | 4 +++- lib/routes/universities/cpu/jwc.js | 4 +++- lib/routes/universities/cpu/yjsy.js | 4 +++- lib/routes/universities/sjtu/gs/tzgg.js | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/routes/universities/buaa/news/index.js b/lib/routes/universities/buaa/news/index.js index 464868be709318..1ec0f01b93af23 100644 --- a/lib/routes/universities/buaa/news/index.js +++ b/lib/routes/universities/buaa/news/index.js @@ -53,7 +53,9 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); - const list = $('.mainleft > .listlefttop > .listleftop1').slice(0, 10); + const list = $('.mainleft > .listlefttop > .listleftop1') + .slice(0, 10) + .get(); const result = await util.ProcessFeed(list, ctx.cache); diff --git a/lib/routes/universities/cpu/home.js b/lib/routes/universities/cpu/home.js index f2a9a267e3e474..885e380a1f7168 100644 --- a/lib/routes/universities/cpu/home.js +++ b/lib/routes/universities/cpu/home.js @@ -15,7 +15,9 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const $list = $('div#wp_news_w3 a').slice(0, 10); + const $list = $('div#wp_news_w3 a') + .slice(0, 10) + .get(); const resultItem = await Promise.all( $list.map(async (item) => { diff --git a/lib/routes/universities/cpu/jwc.js b/lib/routes/universities/cpu/jwc.js index ba5fdcd740a273..3bcb5d933f5730 100644 --- a/lib/routes/universities/cpu/jwc.js +++ b/lib/routes/universities/cpu/jwc.js @@ -15,7 +15,9 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const $list = $('div#wp_news_w6 ul.news_list li a').slice(0, 10); + const $list = $('div#wp_news_w6 ul.news_list li a') + .slice(0, 10) + .get(); const resultItem = await Promise.all( $list.map(async (item) => { diff --git a/lib/routes/universities/cpu/yjsy.js b/lib/routes/universities/cpu/yjsy.js index 82e79acc11a9ab..3b14abf0349a1e 100644 --- a/lib/routes/universities/cpu/yjsy.js +++ b/lib/routes/universities/cpu/yjsy.js @@ -15,7 +15,9 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const $list = $('div.listbox tbody td a').slice(0, 10); + const $list = $('div.listbox tbody td a') + .slice(0, 10) + .get(); const resultItem = await Promise.all( $list.map(async (item) => { diff --git a/lib/routes/universities/sjtu/gs/tzgg.js b/lib/routes/universities/sjtu/gs/tzgg.js index 30fff8746acd0b..7a12f3ca107dc5 100644 --- a/lib/routes/universities/sjtu/gs/tzgg.js +++ b/lib/routes/universities/sjtu/gs/tzgg.js @@ -19,7 +19,9 @@ module.exports = async (ctx) => { const data = response.data; const $ = cheerio.load(data); - const list = $('.comm li').slice(0, 10); + const list = $('.comm li') + .slice(0, 10) + .get(); const result = await util.ProcessFeed(list, ctx.cache, url); From db41c6d25c8915505f8ee2d8d70a663f67a83ff0 Mon Sep 17 00:00:00 2001 From: Chenyang Shi Date: Wed, 13 Mar 2019 18:22:36 +0800 Subject: [PATCH 33/43] update 12306 no item limit (#1743) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 如你所愿 https://github.com/DIYgod/RSSHub/pull/1644#issuecomment-472272476 --- lib/routes/12306/zxdt.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/routes/12306/zxdt.js b/lib/routes/12306/zxdt.js index 49e0162b2a863c..f5fa807e6f209c 100644 --- a/lib/routes/12306/zxdt.js +++ b/lib/routes/12306/zxdt.js @@ -18,7 +18,6 @@ module.exports = async (ctx) => { const name = $('div.nav_center > a:nth-child(4)').text(); const list = $('#newList > ul > li') - .slice(0, 10) .map(function() { const info = { title: $(this) From 58065a39aac0f7224803642e616fb670c5359879 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 14 Mar 2019 10:39:40 +0800 Subject: [PATCH 34/43] fix(deps): update dependency rss-parser to v3.7.0 (#1745) --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 263596b02c56d3..f30aaa3bc56ca4 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "plist": "^3.0.1", "puppeteer": "^1.10.0", "redis": "2.8.0", - "rss-parser": "3.6.3", + "rss-parser": "3.7.0", "sanitize-html": "^1.20.0", "sharp": "^0.21.0", "socks-proxy-agent": "^4.0.1", diff --git a/yarn.lock b/yarn.lock index 6164dfb64d1391..b6be7ce2a9cac6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8858,10 +8858,10 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -rss-parser@3.6.3: - version "3.6.3" - resolved "https://registry.yarnpkg.com/rss-parser/-/rss-parser-3.6.3.tgz#0c2e71ae0e9463a082d5a013b0e939d5a8a6961f" - integrity sha512-HASaMXqkUUw7mS+Sz780ml3Da3dG4ddIA3FRyXE8ae1KIiiDxG+jzrsNk/bpK1zDrDKe2WztjfQ5MRF323Kg3g== +rss-parser@3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/rss-parser/-/rss-parser-3.7.0.tgz#945d82864678a805558c1de68b52f00adeaacd92" + integrity sha512-xN1fwjVxBO0unbrUAOIUK5MAyEaaZTpKWnPY+d3QYigIG4awtbdqxHPOLuOwsTIJFsaKC78nPxIGRJG92p86Hw== dependencies: entities "^1.1.1" xml2js "^0.4.19" From 2a0e9f8431795b5e605ba03f83c038ca107f2e55 Mon Sep 17 00:00:00 2001 From: Jonathan Gongye Date: Fri, 15 Mar 2019 14:20:49 +0800 Subject: [PATCH 35/43] =?UTF-8?q?add:=20=E3=80=8C=E5=88=B7=E5=B1=8F-?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E3=80=8D=E8=B7=AF=E7=94=B1=E6=97=A0=E4=B8=AD?= =?UTF-8?q?=E9=97=B4=E9=A1=B5=E7=89=88=20(#1747)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit item 链接改为 文章原文链接,不看中间页 --- docs/README.md | 2 +- lib/router.js | 1 + lib/routes/weseepro/newest-direct.js | 69 ++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 lib/routes/weseepro/newest-direct.js diff --git a/docs/README.md b/docs/README.md index 15eff5886fc894..c610d5aa203092 100755 --- a/docs/README.md +++ b/docs/README.md @@ -3038,7 +3038,7 @@ board 和 build 可在[这里](http://api.ineal.me/tss/status)查看 ### 刷屏 - + ### 虎嗅 diff --git a/lib/router.js b/lib/router.js index 695ecfda123766..bf4bb8ffba0dc6 100755 --- a/lib/router.js +++ b/lib/router.js @@ -933,6 +933,7 @@ router.get('/testerhome/newest', require('./routes/testerhome/newest')); // 刷屏 router.get('/weseepro/newest', require('./routes/weseepro/newest')); +router.get('/weseepro/newest-direct', require('./routes/weseepro/newest-direct')); router.get('/weseepro/circle', require('./routes/weseepro/circle')); // 玩物志 diff --git a/lib/routes/weseepro/newest-direct.js b/lib/routes/weseepro/newest-direct.js new file mode 100644 index 00000000000000..8c66e01f239d48 --- /dev/null +++ b/lib/routes/weseepro/newest-direct.js @@ -0,0 +1,69 @@ +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: 'https://www.weseepro.com/api/v1/message/ground/spam?pageNumber=1&pageSize=20', + }); + + const data = response.data.data.data; + const generateMessage = (message) => { + let name = ''; + let content = ''; + + if (message.topMessage.account) { + name = message.topMessage.account.name; + content = message.topMessage.content.replace(/\n/g, '
'); + } + + return ` +

+ ${message.link.summary}

+ ${name}: ${content}

+ `; + }; + + ctx.state.data = { + title: '刷屏-最新(无中间页)', + link: 'https://www.weseepro.com', + item: data.map((item) => { + let title; + let link; + let description; + let pubDate; + + if (item.data.spam) { + const spam = item.data.spam; + + title = spam.content; + link = spam.link.url; + description = generateMessage(spam); + pubDate = new Date(spam.spam_add_time).toUTCString(); + } else if (item.data.special) { + const special = item.data.special; + const specialMessages = item.data.special_messages; + const messages = specialMessages.reduce((messages, message) => { + messages += generateMessage(message); + return messages; + }, ''); + + title = special.title; + link = `https://www.weseepro.com/mine/album?uuid=${special.uuid}`; + description = ` +

+ ${special.description}

+ ${messages} + `; + } else { + title = description = '未知类型,请点击链接提交issue'; + } + + return { + title, + link, + description, + pubDate, + }; + }), + }; +}; From 9d08020749efcc645cf0c1da9a379ac7dd272cd0 Mon Sep 17 00:00:00 2001 From: Haoshen Zhong <42088872+ChungZH@users.noreply.github.com> Date: Fri, 15 Mar 2019 14:21:22 +0800 Subject: [PATCH 36/43] Update README.md (#1748) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 即刻主题已更名为圈子。 --- docs/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/README.md b/docs/README.md index c610d5aa203092..da55333bd4f24c 100755 --- a/docs/README.md +++ b/docs/README.md @@ -386,21 +386,21 @@ RSSHub 提供下列 API 接口: ::: warning 注意 -即刻主题较为复杂, 部分主题可能出现不适配的情况. 如出现上述情况请[提 Issue](https://github.com/DIYgod/RSSHub/issues). +即刻圈子较为复杂, 部分圈子可能出现不适配的情况. 如出现上述情况请[提 Issue](https://github.com/DIYgod/RSSHub/issues). ::: - + ::: tip 提示 -部分主题如 `一觉醒来发生了什么: 553870e8e4b0cafb0a1bef68` 提供纯文字内容, 主题-纯文字 /jike/topic/text/:id 可能会提供更好的体验. +部分圈子如 `一觉醒来发生了什么: 553870e8e4b0cafb0a1bef68` 提供纯文字内容, 圈子-纯文字 /jike/topic/text/:id 可能会提供更好的体验. ::: - + - + @@ -414,7 +414,7 @@ RSSHub 提供下列 API 接口: ::: - + From 7b59a6c9e0160f3c5947945ba37c772761783615 Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Fri, 15 Mar 2019 06:23:42 +0000 Subject: [PATCH 37/43] fix: wrong Dcard parameter (#1751) fix #1737 --- lib/routes/dcard/section.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/dcard/section.js b/lib/routes/dcard/section.js index 8c70bda82add71..1526cd6d561d21 100644 --- a/lib/routes/dcard/section.js +++ b/lib/routes/dcard/section.js @@ -22,7 +22,7 @@ module.exports = async (ctx) => { link += '?latest=false'; api += '?popular=true'; title += '熱門'; - } else if (type === 'posts' || !type) { + } else if (type === 'latest' || !type) { link += '?latest=true'; api += '?popular=false'; title += '最新'; From 53145868ebcbe88a6bf108c543c7127f0c756852 Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Fri, 15 Mar 2019 06:25:06 +0000 Subject: [PATCH 38/43] feat: update docker-compose.yml (#1754) 1. bump redis version 1. update docs --- docker-compose.yml | 6 ++++-- docs/en/install/README.md | 13 ++++++++----- docs/install/README.md | 13 ++++++++----- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ac09c15cd5e4d8..3a54071c77435d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: restart: always image: rsshub ports: - - 1200:1200 + - "1200:1200" environment: NODE_ENV: production CACHE_TYPE: redis @@ -27,9 +27,11 @@ services: - db.redis db.redis: - image: redis:4.0.11-alpine + image: redis:5.0.3-alpine volumes: - redis-data:/data + expose: + - "6379" volumes: redis-data: diff --git a/docs/en/install/README.md b/docs/en/install/README.md index 076a3bbb3806b6..4487a6c270fd54 100644 --- a/docs/en/install/README.md +++ b/docs/en/install/README.md @@ -148,22 +148,25 @@ To configure more options please refer to [Settings](#Settings). $ docker volume create redis-data ``` -2. Change `environment` section in [docker-compose.yml](https://github.com/DIYgod/RSSHub/blob/master/docker-compose.yml) to configure the corresponding option +1. Copy `lib/config.js` to `lib/config/config.js`, to avoid conflicts with master branch. Git will ignore this file as it contains sensitive information. + +1. Change `environment` section in [docker-compose.yml](https://github.com/DIYgod/RSSHub/blob/master/docker-compose.yml) to configure the corresponding option - `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1` skips puppeteer Chromium installation. Default to 1, requires `puppeteerWSEndpoint` in `lib/config.js` to be set with a remote Chrome Websocket address, otherwise relevant routes will not work. - `USE_CHINA_NPM_REGISTRY=1` avoids GFW npm registry interference in mainland China. Default to 0. -3. Deploy +1. Deploy ```bash -$ docker-compose up +$ docker-compose up -d ``` -4. Update +1. Update ```bash +$ git pull $ docker-compose build -$ docker-compose up +$ docker-compose up -d ``` ## Heroku Deployment diff --git a/docs/install/README.md b/docs/install/README.md index 19a95c49b81e62..0dbb6398492e96 100644 --- a/docs/install/README.md +++ b/docs/install/README.md @@ -152,22 +152,25 @@ $ docker run -d --name rsshub -p 1200:1200 -e CACHE_EXPIRE=3600 -e GITHUB_ACCESS $ docker volume create redis-data ``` -2. 修改 [docker-compose.yml](https://github.com/DIYgod/RSSHub/blob/master/docker-compose.yml) 中的 `environment` 进行配置 +1. 复制 `lib/config.js` 至 `lib/config/config.js`, 以避免与 master 分支冲突. 由于包含敏感信息, 该配置文件会被 git 忽略. + +1. 修改 [docker-compose.yml](https://github.com/DIYgod/RSSHub/blob/master/docker-compose.yml) 中的 `environment` 进行配置 - `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1` 用以跳过 puppeteer Chromium 的安装. 默认为 1, 需要在 `lib/config.js` 中的 `puppeteerWSEndpoint`中设置相应的远程 Chrome Websocket 地址, 以启用相应路由. - `USE_CHINA_NPM_REGISTRY=1` 防止 npm 受到来自 GFW 的干扰. 默认为 0. -3. 部署 +1. 部署 ```bash -$ docker-compose up +$ docker-compose up -d ``` -4. 更新 +1. 更新 ```bash +$ git pull $ docker-compose build -$ docker-compose up +$ docker-compose up -d ``` ## 部署到 Heroku From ec5d67d268826cd404c653d2a30ce6a51a2bf8e3 Mon Sep 17 00:00:00 2001 From: Chenyang Shi Date: Fri, 15 Mar 2019 14:26:08 +0800 Subject: [PATCH 39/43] =?UTF-8?q?fix=20=E4=BB=8A=E6=97=A5=E5=A4=B4?= =?UTF-8?q?=E6=9D=A1search=20(#1755)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #1750 api更改 --- lib/routes/jinritoutiao/keyword.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/jinritoutiao/keyword.js b/lib/routes/jinritoutiao/keyword.js index bae0e6ba9c471c..29a2cf4dfab84a 100644 --- a/lib/routes/jinritoutiao/keyword.js +++ b/lib/routes/jinritoutiao/keyword.js @@ -5,7 +5,7 @@ module.exports = async (ctx) => { const response = await axios({ method: 'get', - url: `https://www.toutiao.com/search_content/?offset=0&format=json&keyword=${encodeURIComponent(keyword)}&autoload=true&count=20&cur_tab=1&from=search_tab`, + url: `https://www.toutiao.com/api/search/content/?offset=0&format=json&keyword=${encodeURIComponent(keyword)}&autoload=true&count=20&cur_tab=1&from=search_tab`, headers: { Referer: `https://www.toutiao.com/search/?keyword=${encodeURIComponent(keyword)}`, }, From 9ff96364b643fcbbdeb5c0e2b8740c85480e2c18 Mon Sep 17 00:00:00 2001 From: Chenyang Shi Date: Fri, 15 Mar 2019 14:26:32 +0800 Subject: [PATCH 40/43] =?UTF-8?q?fix=20=E5=90=8E=E7=BB=AD=20lives=20(#1756?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #1753 网页结构变化 --- lib/routes/houxu/lives.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/routes/houxu/lives.js b/lib/routes/houxu/lives.js index 247c96af79edaf..f8ca883949baf3 100644 --- a/lib/routes/houxu/lives.js +++ b/lib/routes/houxu/lives.js @@ -7,24 +7,17 @@ module.exports = async (ctx) => { const res = await axios.get(baseUrl); const $ = cheerio.load(res.data); - const list = $('div.container > div'); + const list = $('div.live-realtime'); const out = list .map((_, el) => { const each = $(el); - const p = each.find('p'); return { title: each - .find('h3') + .find('h4 > a') .text() .trim(), - description: p.html() + p.next().html(), - link: - 'https://houxu.app' + - each - .find('h3 > a') - .first() - .attr('href'), + link: 'https://houxu.app' + each.find('h4 > a').attr('href'), }; }) .get(); From 72316638566798cdc36c92228a5fcce99b98b18a Mon Sep 17 00:00:00 2001 From: Chenyang Shi Date: Fri, 15 Mar 2019 14:28:15 +0800 Subject: [PATCH 41/43] =?UTF-8?q?add=20=E7=9F=A5=E4=B9=8E=E5=91=A8?= =?UTF-8?q?=E5=88=8A=20(#1757)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #1722 --- docs/README.md | 2 ++ lib/router.js | 1 + lib/routes/zhihu/weekly.js | 43 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 lib/routes/zhihu/weekly.js diff --git a/docs/README.md b/docs/README.md index da55333bd4f24c..f2117c27e3dd72 100755 --- a/docs/README.md +++ b/docs/README.md @@ -462,6 +462,8 @@ RSSHub 提供下列 API 接口: + + ### pixiv diff --git a/lib/router.js b/lib/router.js index bf4bb8ffba0dc6..f437af2a3a9940 100755 --- a/lib/router.js +++ b/lib/router.js @@ -179,6 +179,7 @@ router.get('/zhihu/topic/:topicId', require('./routes/zhihu/topic')); router.get('/zhihu/people/pins/:id', require('./routes/zhihu/pin/people')); router.get('/zhihu/bookstore/newest', require('./routes/zhihu/bookstore/newest')); router.get('/zhihu/pin/daily', require('./routes/zhihu/pin/daily')); +router.get('/zhihu/weekly', require('./routes/zhihu/weekly')); // 妹子图 router.get('/mzitu/home/:type?', require('./routes/mzitu/home')); diff --git a/lib/routes/zhihu/weekly.js b/lib/routes/zhihu/weekly.js new file mode 100644 index 00000000000000..0b2a17a908afae --- /dev/null +++ b/lib/routes/zhihu/weekly.js @@ -0,0 +1,43 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); +const url = require('url'); + +const host = 'https://www.zhihu.com'; + +module.exports = async (ctx) => { + const link = 'https://www.zhihu.com/pub/weekly'; + const response = await axios.get(link); + const $ = cheerio.load(response.data); + + const description = $('p.Weekly-description').text(); + const out = $('div.Card-section.PubBookListItem') + .slice(0, 10) + .map(function() { + const info = { + title: $(this) + .find('span.PubBookListItem-title') + .text(), + link: url.resolve( + host, + $(this) + .find('a.PubBookListItem-buttonWrapper') + .attr('href') + ), + description: $(this) + .find('div.PubBookListItem-description') + .text(), + author: $(this) + .find('span.PubBookListItem-author') + .text(), + }; + return info; + }) + .get(); + + ctx.state.data = { + title: '知乎周刊', + link: link, + description: description, + item: out, + }; +}; From 6434934a7bf454cbf4701ad70670a666c88a8ff0 Mon Sep 17 00:00:00 2001 From: Chenyang Shi Date: Fri, 15 Mar 2019 14:28:49 +0800 Subject: [PATCH 42/43] =?UTF-8?q?fix=20=E4=BB=80=E4=B9=88=E5=80=BC?= =?UTF-8?q?=E5=BE=97=E4=B9=B0=E6=8E=92=E8=A1=8C=E6=A6=9C=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=8A=A5=E9=94=99=20(#1758)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #1706 --- lib/routes/smzdm/ranking.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/smzdm/ranking.js b/lib/routes/smzdm/ranking.js index 318177fd69d283..92eb44a708bfa3 100644 --- a/lib/routes/smzdm/ranking.js +++ b/lib/routes/smzdm/ranking.js @@ -14,7 +14,7 @@ module.exports = async (ctx) => { const data = response.data.data.list; const list1 = []; const list2 = []; - for (let i = 0; i < 6; i++) { + for (let i = 0; i < Math.min(6, data.length); i++) { list1.push(data[i][0]); list2.push(data[i][1]); } From b9cdc5eac22b0147d5eed690c39607e4e0b065eb Mon Sep 17 00:00:00 2001 From: siva Date: Fri, 15 Mar 2019 14:29:31 +0800 Subject: [PATCH 43/43] =?UTF-8?q?add:=20=E5=A5=BD=E5=A5=87=E5=BF=83?= =?UTF-8?q?=E6=97=A5=E6=8A=A5=E6=94=AF=E6=8C=81=20tag=20=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=20(#1759)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 查看如 https://www.qdaily.com/tags/7294.html 等tag类别的文章 --- docs/README.md | 2 ++ lib/router.js | 1 + lib/routes/qdaily/tag.js | 59 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 lib/routes/qdaily/tag.js diff --git a/docs/README.md b/docs/README.md index f2117c27e3dd72..a232c6ed4a12f2 100755 --- a/docs/README.md +++ b/docs/README.md @@ -662,6 +662,8 @@ RSSHub 提供下列 API 接口: + + ## 编程 ### 掘金 diff --git a/lib/router.js b/lib/router.js index f437af2a3a9940..16236aee6cd526 100755 --- a/lib/router.js +++ b/lib/router.js @@ -283,6 +283,7 @@ router.get('/jiemian/list/:cid', require('./routes/jiemian/list.js')); // 好奇心日报 router.get('/qdaily/column/:id', require('./routes/qdaily/column')); router.get('/qdaily/category/:id', require('./routes/qdaily/category')); +router.get('/qdaily/tag/:id', require('./routes/qdaily/tag')); // 爱奇艺 router.get('/iqiyi/dongman/:id', require('./routes/iqiyi/dongman')); diff --git a/lib/routes/qdaily/tag.js b/lib/routes/qdaily/tag.js new file mode 100644 index 00000000000000..04fbf5c9ecf2ae --- /dev/null +++ b/lib/routes/qdaily/tag.js @@ -0,0 +1,59 @@ +const cheerio = require('cheerio'); +const axios = require('../../utils/axios'); + +module.exports = async (ctx) => { + const url = `https://www.qdaily.com/tags/${ctx.params.id}.html`; + + const res = await axios.get(url); + const $ = cheerio.load(res.data); + const list = $('.article').get(); + + const proList = []; + const indexList = []; + + const out = await Promise.all( + list.map(async (item, i) => { + const $ = cheerio.load(item); + const time = $('.smart-date').attr('data-origindate'); + let title = $('.title').text(); + if (!title) { + title = $('.smart-dotdotdot').text(); + } + const itemUrl = $('a').attr('href'); + const allUrl = `https://www.qdaily.com${itemUrl}`; + const cache = await ctx.cache.get(allUrl); + if (cache) { + return Promise.resolve(JSON.parse(cache)); + } + const single = { + title, + pubDate: new Date(time).toUTCString(), + link: allUrl, + guid: allUrl, + }; + proList.push(axios.get(allUrl)); + indexList.push(i); + return Promise.resolve(single); + }) + ); + const responses = await axios.all(proList); + for (let i = 0; i < responses.length; i++) { + const res = responses[i]; + const $ = cheerio.load(res.data); + $('img').each((index, item) => { + item = $(item); + item.attr('src', item.attr('data-src')); + item.attr('referrerpolicy', 'no-referrer'); + }); + $('.article-detail-bd .author-share').remove(); + $('.article-detail-ft').remove(); + + out[indexList[i]].description = $('.main .com-article-detail').html(); + ctx.cache.set(out[indexList[i]].link, JSON.stringify(out[i]), 24 * 60 * 60); + } + ctx.state.data = { + title: $('title').text(), + link: url, + item: out, + }; +};