From b9f61420738e5263e601294e048591cfe3829c6f Mon Sep 17 00:00:00 2001 From: nyaShine <127018961+nyaShine@users.noreply.github.com> Date: Fri, 15 Sep 2023 00:04:09 +0800 Subject: [PATCH 01/12] =?UTF-8?q?feat:=20/lsnu/jiaowc/tzgg=20=E4=B9=90?= =?UTF-8?q?=E5=B1=B1=E5=B8=88=E8=8C=83=E5=AD=A6=E9=99=A2=E6=95=99=E5=AD=A6?= =?UTF-8?q?=E9=83=A8=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=20(#13268)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg/:category? 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * Revert "feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告" This reverts commit 34c9411ef6ef3a5b92eb3f8995db5692fd12e3ec. * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 * feat: /lsnu/jiaowc/tzgg 乐山师范学院教学部通知公告 --------- --- lib/v2/lsnu/jiaowc/tzgg.js | 52 +++++++++++++++++++++++++++++++ lib/v2/lsnu/maintainer.js | 3 ++ lib/v2/lsnu/radar.js | 13 ++++++++ lib/v2/lsnu/router.js | 3 ++ website/docs/routes/university.md | 12 +++++++ 5 files changed, 83 insertions(+) create mode 100644 lib/v2/lsnu/jiaowc/tzgg.js create mode 100644 lib/v2/lsnu/maintainer.js create mode 100644 lib/v2/lsnu/radar.js create mode 100644 lib/v2/lsnu/router.js diff --git a/lib/v2/lsnu/jiaowc/tzgg.js b/lib/v2/lsnu/jiaowc/tzgg.js new file mode 100644 index 00000000000000..ce0b59d005c4f9 --- /dev/null +++ b/lib/v2/lsnu/jiaowc/tzgg.js @@ -0,0 +1,52 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const category = ctx.params.category; + const url = category ? `https://jiaowc.lsnu.edu.cn/tzgg/${category}.htm` : 'https://jiaowc.lsnu.edu.cn/tzgg.htm'; + + const response = await got({ + method: 'get', + url, + }); + + const data = response.data; + + const $ = cheerio.load(data); + const list = $('tr[id^="line_u5_"]').get(); + + const out = await Promise.all( + list.map(async (item) => { + const $ = cheerio.load(item); + const title = $('a').attr('title'); + const link = `https://jiaowc.lsnu.edu.cn/${$('a').attr('href')}`; + const date = $('td[width="80"]').text(); + + const single = await ctx.cache.tryGet(link, async () => { + const response = await got({ + method: 'get', + url: link, + }); + + const articleData = response.data; + const article$ = cheerio.load(articleData); + const description = article$('.v_news_content').html(); + + return { + title, + link, + description, + pubDate: new Date(date).toUTCString(), + }; + }); + + return single; + }) + ); + + ctx.state.data = { + title: '乐山师范学院教学部通知公告', + link: 'https://jiaowc.lsnu.edu.cn/tzgg.htm', + item: out, + }; +}; diff --git a/lib/v2/lsnu/maintainer.js b/lib/v2/lsnu/maintainer.js new file mode 100644 index 00000000000000..42dab90d42465f --- /dev/null +++ b/lib/v2/lsnu/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/jiaowc/tzgg/:category?': ['nyaShine'], +}; diff --git a/lib/v2/lsnu/radar.js b/lib/v2/lsnu/radar.js new file mode 100644 index 00000000000000..f028fb3495d5a8 --- /dev/null +++ b/lib/v2/lsnu/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'lsnu.edu.cn': { + _name: '乐山师范学院', + '.': [ + { + title: '教学部通知公告', + docs: 'https://docs.rsshub.app/university.html#le-shan-shi-fan-xue-yuan', + source: ['/'], + target: '/lsnu/jiaowc/tzgg', + }, + ], + }, +}; diff --git a/lib/v2/lsnu/router.js b/lib/v2/lsnu/router.js new file mode 100644 index 00000000000000..1dbd6b5620c30c --- /dev/null +++ b/lib/v2/lsnu/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/jiaowc/tzgg/:category?', require('./jiaowc/tzgg')); +}; diff --git a/website/docs/routes/university.md b/website/docs/routes/university.md index d4f2906e765581..c4341e2706b642 100644 --- a/website/docs/routes/university.md +++ b/website/docs/routes/university.md @@ -2009,6 +2009,18 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS +## 乐山师范学院 {#le-shan-shi-fan-xue-yuan} + +### 教学部通知公告 {#le-shan-shi-fan-xue-yuan-jiao-xue-bu-tong-zhi-gong-gao} + + + +| 实践教学科 | 教育运行科 | 教研教改科 | 学籍管理科 | 考试科 | 教材建设管理科 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| sjjxk | jxyxk | jyjgk | xjglk | ksk | jcjsglk | + + + ## 辽宁工程技术大学 {#liao-ning-gong-cheng-ji-shu-da-xue} ### 教务公告 {#liao-ning-gong-cheng-ji-shu-da-xue-jiao-wu-gong-gao} From 3273b2770d91b661e83325b9c8c2156b7e31ef61 Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 14 Sep 2023 22:16:55 +0000 Subject: [PATCH 02/12] chore: disable docker release on deps bump --- .github/workflows/docker-release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 234ae8ab7a1781..8e25b730e701c3 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -13,8 +13,6 @@ on: - '!lib/v2/test/**' - '!test/**' - 'Dockerfile' - - 'package.json' - - 'pnpm-lock.yaml' workflow_dispatch: ~ jobs: From e0a1ba5aaafbe6153a9207ca37cc032f1a2c849f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 06:35:16 +0800 Subject: [PATCH 03/12] chore(deps-dev): bump @types/fs-extra from 11.0.1 to 11.0.2 (#13302) * chore(deps-dev): bump @types/fs-extra from 11.0.1 to 11.0.2 Bumps [@types/fs-extra](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/fs-extra) from 11.0.1 to 11.0.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/fs-extra) --- updated-dependencies: - dependency-name: "@types/fs-extra" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore: fix pnpm install --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d212294d5b054b..ec29a602c783d3 100644 --- a/package.json +++ b/package.json @@ -154,7 +154,7 @@ "@types/eslint": "8.44.2", "@types/eslint-config-prettier": "6.11.0", "@types/etag": "1.8.1", - "@types/fs-extra": "11.0.1", + "@types/fs-extra": "11.0.2", "@types/git-rev-sync": "2.0.0", "@types/imapflow": "1.0.13", "@types/jsdom": "21.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3562613fe693c8..68427c2d53c67a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -215,8 +215,8 @@ devDependencies: specifier: 1.8.1 version: 1.8.1 '@types/fs-extra': - specifier: 11.0.1 - version: 11.0.1 + specifier: 11.0.2 + version: 11.0.2 '@types/git-rev-sync': specifier: 2.0.0 version: 2.0.0 @@ -1465,8 +1465,8 @@ packages: '@types/serve-static': 1.15.2 dev: true - /@types/fs-extra@11.0.1: - resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} + /@types/fs-extra@11.0.2: + resolution: {integrity: sha512-c0hrgAOVYr21EX8J0jBMXGLMgJqVf/v6yxi0dLaJboW9aQPh16Id+z6w2Tx1hm+piJOLv8xPfVKZCLfjPw/IMQ==} dependencies: '@types/jsonfile': 6.1.1 '@types/node': 20.5.6 From 0f080deeee781c4fac12efeaa94ad818f13f7485 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 06:36:21 +0800 Subject: [PATCH 04/12] chore(deps-dev): bump @types/koa__router from 12.0.0 to 12.0.1 (#13306) * chore(deps-dev): bump @types/koa__router from 12.0.0 to 12.0.1 Bumps [@types/koa__router](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/koa__router) from 12.0.0 to 12.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/koa__router) --- updated-dependencies: - dependency-name: "@types/koa__router" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore: fix pnpm install --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ec29a602c783d3..470d54827153bb 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,7 @@ "@types/koa-favicon": "2.0.21", "@types/koa-mount": "4.0.2", "@types/koa-static": "4.0.2", - "@types/koa__router": "12.0.0", + "@types/koa__router": "12.0.1", "@types/lint-staged": "13.2.0", "@types/mailparser": "3.4.0", "@types/markdown-it": "13.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 68427c2d53c67a..faefad6bcd5a1d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -245,8 +245,8 @@ devDependencies: specifier: 4.0.2 version: 4.0.2 '@types/koa__router': - specifier: 12.0.0 - version: 12.0.0 + specifier: 12.0.1 + version: 12.0.1 '@types/lint-staged': specifier: 13.2.0 version: 13.2.0 @@ -1598,8 +1598,8 @@ packages: '@types/node': 20.5.6 dev: true - /@types/koa__router@12.0.0: - resolution: {integrity: sha512-S6eHyZyoWCZLNHyy8j0sMW85cPrpByCbGGU2/BO4IzGiI87aHJ92lZh4E9xfsM9DcbCT469/OIqyC0sSJXSIBQ==} + /@types/koa__router@12.0.1: + resolution: {integrity: sha512-uqV+v6pCsfLZwK+Ar6XavKSZ6Cbsgw12bCEX9L0IKHj81LTWXcrayxJWkLtez5vOMQlq+ax+lZcuCyh9CgxYGw==} dependencies: '@types/koa': 2.13.8 dev: true From 235d5f6c4fce39f68c6b8fd228f6066509795cc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 06:36:55 +0800 Subject: [PATCH 05/12] chore(deps-dev): bump @types/koa from 2.13.8 to 2.13.9 (#13304) * chore(deps-dev): bump @types/koa from 2.13.8 to 2.13.9 Bumps [@types/koa](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/koa) from 2.13.8 to 2.13.9. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/koa) --- updated-dependencies: - dependency-name: "@types/koa" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore: fix pnpm install --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 470d54827153bb..e9c5bf7071343b 100644 --- a/package.json +++ b/package.json @@ -159,7 +159,7 @@ "@types/imapflow": "1.0.13", "@types/jsdom": "21.1.2", "@types/json-bigint": "1.0.1", - "@types/koa": "2.13.8", + "@types/koa": "2.13.9", "@types/koa-basic-auth": "2.0.4", "@types/koa-favicon": "2.0.21", "@types/koa-mount": "4.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index faefad6bcd5a1d..aa306818d5d86d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -230,8 +230,8 @@ devDependencies: specifier: 1.0.1 version: 1.0.1 '@types/koa': - specifier: 2.13.8 - version: 2.13.8 + specifier: 2.13.9 + version: 2.13.9 '@types/koa-basic-auth': specifier: 2.0.4 version: 2.0.4 @@ -1551,42 +1551,42 @@ packages: /@types/koa-basic-auth@2.0.4: resolution: {integrity: sha512-PJKvoF5OMGlEEzUnctZDGRQVqV12xB0V4KplDJvHQDX9egh9ADFa456zGXRNnhNr43t3Fe4/VzD6ziM61uM5RQ==} dependencies: - '@types/koa': 2.13.8 + '@types/koa': 2.13.9 dev: true /@types/koa-compose@3.2.5: resolution: {integrity: sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==} dependencies: - '@types/koa': 2.13.8 + '@types/koa': 2.13.9 dev: true /@types/koa-favicon@2.0.21: resolution: {integrity: sha512-paH1nheVhijx/VduoR/RCD/qTCiX+OI/6fHLi3mZae053Ts+gUBOrKtzl3pMTDbdEBqdLolfLje3PZbb6jW0jQ==} dependencies: - '@types/koa': 2.13.8 + '@types/koa': 2.13.9 dev: true /@types/koa-mount@4.0.2: resolution: {integrity: sha512-XnuGwV8bzw22nv2WqOs5a8wCHR2VgSnLLLuBQPzNTmhyiAvH0O6c+994rQVbMaBuwQJKefUInkvKoKuk+21uew==} dependencies: - '@types/koa': 2.13.8 + '@types/koa': 2.13.9 dev: true /@types/koa-send@4.1.3: resolution: {integrity: sha512-daaTqPZlgjIJycSTNjKpHYuKhXYP30atFc1pBcy6HHqB9+vcymDgYTguPdx9tO4HMOqNyz6bz/zqpxt5eLR+VA==} dependencies: - '@types/koa': 2.13.8 + '@types/koa': 2.13.9 dev: true /@types/koa-static@4.0.2: resolution: {integrity: sha512-ns/zHg+K6XVPMuohjpOlpkR1WLa4VJ9czgUP9bxkCDn0JZBtUWbD/wKDZzPGDclkQK1bpAEScufCHOy8cbfL0w==} dependencies: - '@types/koa': 2.13.8 + '@types/koa': 2.13.9 '@types/koa-send': 4.1.3 dev: true - /@types/koa@2.13.8: - resolution: {integrity: sha512-Ugmxmgk/yPRW3ptBTh9VjOLwsKWJuGbymo1uGX0qdaqqL18uJiiG1ZoV0rxCOYSaDGhvEp5Ece02Amx0iwaxQQ==} + /@types/koa@2.13.9: + resolution: {integrity: sha512-tPX3cN1dGrMn+sjCDEiQqXH2AqlPoPd594S/8zxwUm/ZbPsQXKqHPUypr2gjCPhHUc+nDJLduhh5lXI/1olnGQ==} dependencies: '@types/accepts': 1.3.5 '@types/content-disposition': 0.5.5 @@ -1601,7 +1601,7 @@ packages: /@types/koa__router@12.0.1: resolution: {integrity: sha512-uqV+v6pCsfLZwK+Ar6XavKSZ6Cbsgw12bCEX9L0IKHj81LTWXcrayxJWkLtez5vOMQlq+ax+lZcuCyh9CgxYGw==} dependencies: - '@types/koa': 2.13.8 + '@types/koa': 2.13.9 dev: true /@types/linkify-it@3.0.3: From 5e0abaf1216278974c7d0203d93be09bff5aa913 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 06:37:19 +0800 Subject: [PATCH 06/12] chore(deps-dev): bump @types/koa-favicon from 2.0.21 to 2.0.22 (#13303) * chore(deps-dev): bump @types/koa-favicon from 2.0.21 to 2.0.22 Bumps [@types/koa-favicon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/koa-favicon) from 2.0.21 to 2.0.22. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/koa-favicon) --- updated-dependencies: - dependency-name: "@types/koa-favicon" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore: fix pnpm install --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index e9c5bf7071343b..222430d733758c 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,7 @@ "@types/json-bigint": "1.0.1", "@types/koa": "2.13.9", "@types/koa-basic-auth": "2.0.4", - "@types/koa-favicon": "2.0.21", + "@types/koa-favicon": "2.0.22", "@types/koa-mount": "4.0.2", "@types/koa-static": "4.0.2", "@types/koa__router": "12.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa306818d5d86d..7695a801968d92 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -236,8 +236,8 @@ devDependencies: specifier: 2.0.4 version: 2.0.4 '@types/koa-favicon': - specifier: 2.0.21 - version: 2.0.21 + specifier: 2.0.22 + version: 2.0.22 '@types/koa-mount': specifier: 4.0.2 version: 4.0.2 @@ -1560,8 +1560,8 @@ packages: '@types/koa': 2.13.9 dev: true - /@types/koa-favicon@2.0.21: - resolution: {integrity: sha512-paH1nheVhijx/VduoR/RCD/qTCiX+OI/6fHLi3mZae053Ts+gUBOrKtzl3pMTDbdEBqdLolfLje3PZbb6jW0jQ==} + /@types/koa-favicon@2.0.22: + resolution: {integrity: sha512-oyLEtX7JgJ6Fm3luqcuKi6qjTBHWMwS9dQblxkIPgtQiHEyfYm99ow6igqI440yV+k61S+ubnbmv1q0kZWyV/A==} dependencies: '@types/koa': 2.13.9 dev: true From 8a9271dabc45a83a38bbe0b07b657a1cd4f57e73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 08:49:08 +0800 Subject: [PATCH 07/12] chore(deps-dev): bump @types/koa-mount from 4.0.2 to 4.0.3 (#13305) * chore(deps-dev): bump @types/koa-mount from 4.0.2 to 4.0.3 Bumps [@types/koa-mount](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/koa-mount) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/koa-mount) --- updated-dependencies: - dependency-name: "@types/koa-mount" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * chore: fix pnpm install --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 222430d733758c..fb050cdc3d9712 100644 --- a/package.json +++ b/package.json @@ -162,7 +162,7 @@ "@types/koa": "2.13.9", "@types/koa-basic-auth": "2.0.4", "@types/koa-favicon": "2.0.22", - "@types/koa-mount": "4.0.2", + "@types/koa-mount": "4.0.3", "@types/koa-static": "4.0.2", "@types/koa__router": "12.0.1", "@types/lint-staged": "13.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7695a801968d92..8a040320bf9ce1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -239,8 +239,8 @@ devDependencies: specifier: 2.0.22 version: 2.0.22 '@types/koa-mount': - specifier: 4.0.2 - version: 4.0.2 + specifier: 4.0.3 + version: 4.0.3 '@types/koa-static': specifier: 4.0.2 version: 4.0.2 @@ -1566,8 +1566,8 @@ packages: '@types/koa': 2.13.9 dev: true - /@types/koa-mount@4.0.2: - resolution: {integrity: sha512-XnuGwV8bzw22nv2WqOs5a8wCHR2VgSnLLLuBQPzNTmhyiAvH0O6c+994rQVbMaBuwQJKefUInkvKoKuk+21uew==} + /@types/koa-mount@4.0.3: + resolution: {integrity: sha512-WXhyitlW5B6zW31cKZO+RBl38afLmO9847M8PaKmcnO5tqGJy/+XcH5N/69Nsp+vKvFXhDOY9GM5uF34HrWgrw==} dependencies: '@types/koa': 2.13.9 dev: true From c5b96621aaf731855a0d85c895a6a5670912c35c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 09:38:34 +0800 Subject: [PATCH 08/12] chore(deps): bump codecov/codecov-action from 3 to 4 (#13301) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/v3...v4) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 63356b25073d1a..d24453354af213 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,7 @@ jobs: REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}/ - name: Upload coverage to Codecov if: ${{ matrix.node-version == '18' }} - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos as documented, but seems broken From 8a3d9adc76c609628ca1f4fe3d2384db1f367e93 Mon Sep 17 00:00:00 2001 From: TonyRL Date: Fri, 15 Sep 2023 12:02:52 +0000 Subject: [PATCH 09/12] revert: "chore(deps): bump codecov/codecov-action from 3 to 4 (#13301)" This reverts commit c5b96621aaf731855a0d85c895a6a5670912c35c. Refs: https://github.com/codecov/codecov-action/issues/1089 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d24453354af213..63356b25073d1a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,7 @@ jobs: REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}/ - name: Upload coverage to Codecov if: ${{ matrix.node-version == '18' }} - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos as documented, but seems broken From 2cc8a583045d64cf7cb2bba76d31d8dac6bf2ca5 Mon Sep 17 00:00:00 2001 From: lonely <251639692@qq.com> Date: Fri, 15 Sep 2023 20:19:18 +0800 Subject: [PATCH 10/12] =?UTF-8?q?feat(route):=20=E6=B7=BB=E5=8A=A0gamegene?= =?UTF-8?q?=E7=9A=84rss=E8=AE=A2=E9=98=85=20(#13296)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :art: 添加gamegene的rss订阅 * :memo: 添加文档 * Update lib/v2/gamegene/radar.js * Update lib/v2/gamegene/radar.js * Update lib/v2/gamegene/radar.js * Update lib/v2/gamegene/radar.js * fix: docs format * Update lib/v2/gamegene/maintainer.js * Update website/docs/routes/game.md * fix: datetime --------- Co-authored-by: wuyi --- lib/v2/gamegene/maintainer.js | 3 + lib/v2/gamegene/news.js | 50 ++++++++++++++ lib/v2/gamegene/radar.js | 13 ++++ lib/v2/gamegene/router.js | 3 + website/docs/routes/game.md | 121 ++++++++++++++++++---------------- 5 files changed, 132 insertions(+), 58 deletions(-) create mode 100644 lib/v2/gamegene/maintainer.js create mode 100644 lib/v2/gamegene/news.js create mode 100644 lib/v2/gamegene/radar.js create mode 100644 lib/v2/gamegene/router.js diff --git a/lib/v2/gamegene/maintainer.js b/lib/v2/gamegene/maintainer.js new file mode 100644 index 00000000000000..8c0559d270cb89 --- /dev/null +++ b/lib/v2/gamegene/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/news': ['lone1y-51'], +}; diff --git a/lib/v2/gamegene/news.js b/lib/v2/gamegene/news.js new file mode 100644 index 00000000000000..a93fe643be9775 --- /dev/null +++ b/lib/v2/gamegene/news.js @@ -0,0 +1,50 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const url = 'https://gamegene.cn/news'; + const { data: response } = await got({ + method: 'get', + url, + }); + const $ = cheerio.load(response); + const list = $('div.mr245') + .toArray() + .map((item) => { + item = $(item); + const aEle = item.find('a').first(); + const href = aEle.attr('href'); + const title = aEle.find('h3').first().text(); + const author = item.find('a.namenode').text(); + const category = item.find('span.r').text(); + return { + title, + link: href, + author, + category, + }; + }); + const items = await Promise.all( + list.map((item) => + ctx.cache.tryGet(item.link, async () => { + const { data: response } = await got({ + method: 'get', + url: item.link, + }); + const $ = cheerio.load(response); + const dateTime = $('div.meta').find('time').first().text(); + item.pubDate = parseDate(dateTime); + item.description = $('div.content').first().html(); + return item; + }) + ) + ); + + ctx.state.data = { + // 在此处输出您的 RSS + item: items, + link: url, + title: '游戏基因 GameGene', + }; +}; diff --git a/lib/v2/gamegene/radar.js b/lib/v2/gamegene/radar.js new file mode 100644 index 00000000000000..73c2281622eba3 --- /dev/null +++ b/lib/v2/gamegene/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'gamegene.cn': { + _name: '游戏基因', + news: [ + { + title: '资讯', + docs: 'https://docs.rsshub.app/routes/game#you-xi-ji-yin', + source: ['/news'], + target: '/gamegene/news', + }, + ], + }, +}; diff --git a/lib/v2/gamegene/router.js b/lib/v2/gamegene/router.js new file mode 100644 index 00000000000000..69a5972f6a8112 --- /dev/null +++ b/lib/v2/gamegene/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/news', require('./news')); +}; diff --git a/website/docs/routes/game.md b/website/docs/routes/game.md index 968e486ae82b50..47473658688f34 100644 --- a/website/docs/routes/game.md +++ b/website/docs/routes/game.md @@ -76,22 +76,22 @@ Categories Language codes -| Language | Code | -| -------------- | ----- | -| Deutsch | de-de | -| English (US) | en-us | -| English (EU) | en-gb | -| Español (EU) | es-es | -| Español (Latino) | es-mx | -| Français | fr-fr | -| Italiano | it-it | -| Português (Brasil) | pt-br | -| Polski | pl-pl | -| Русский | ru-ru | -| 한국어 | ko-kr | -| ภาษาไทย | th-th | -| 日本語 | ja-jp | -| 繁體中文 | zh-tw | +| Language | Code | +| ------------------ | ----- | +| Deutsch | de-de | +| English (US) | en-us | +| English (EU) | en-gb | +| Español (EU) | es-es | +| Español (Latino) | es-mx | +| Français | fr-fr | +| Italiano | it-it | +| Português (Brasil) | pt-br | +| Polski | pl-pl | +| Русский | ru-ru | +| 한국어 | ko-kr | +| ภาษาไทย | th-th | +| 日本語 | ja-jp | +| 繁體中文 | zh-tw | @@ -143,8 +143,8 @@ Region Category -| all | topics | notices | maintenance | updates | status | developers | -| --- | ------ | ------- | ----------- | ------- | -------- | ---------- | +| all | topics | notices | maintenance | updates | status | developers | +| --- | ------ | ------- | ----------- | ------- | ------ | ---------- | @@ -178,9 +178,9 @@ Category -| Latest News | PC | Playstation | Nintendo | Xbox | Moblie | -| ----------- | -- | ----------- | -------- | ---- | ------ | -| latest-news | pc | playstation | nintendo | xbox | moblie | +| Latest News | PC | Playstation | Nintendo | Xbox | Moblie | +| ----------- | --- | ----------- | -------- | ---- | ------ | +| latest-news | pc | playstation | nintendo | xbox | moblie | Or @@ -303,10 +303,10 @@ So the route is [`/itch/devlogs/teamterrible/the-baby-in-yellow`](https://rsshub | filter | switch | ps4 | ps5 | steam | | ------ | ------ | --- | --- | ----- | | all | ✔ | ✔ | ✔ | ✔ | -| jx | ✔ | ✔ | ❌ | ✔ | +| jx | ✔ | ✔ | ❌ | ✔ | | sd | ✔ | ✔ | ✔ | ✔ | -| dl | ❌ | ✔ | ❌ | ✔ | -| vip | ❌ | ❌ | ✔ | ❌ | +| dl | ❌ | ✔ | ❌ | ✔ | +| vip | ❌ | ❌ | ✔ | ❌ | | 北美 | 欧洲(英语) | 法国 | 德国 | 日本 | | ---- | ------------ | ---- | ---- | ---- | @@ -371,8 +371,8 @@ Sorting types, default to `date`: ### Feed The Beast Modpack Updates {#minecraft-feed-the-beast-modpack-updates} -| param | description | -| ------| ------------ | +| param | description | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | modpackEntry | The entry name of modpack, can be found in modpack\'s page link, for `https://www.feed-the-beast.com/modpack/ftb_presents_direwolf20_1_16`, use `ftb_presents_direwolf20_1_16`. | @@ -518,8 +518,8 @@ Due to the regional restrictions, an RSSHub deployment in China Mainland may not Language Code | English (US) | 繁體中文 | 한국어 | 日本語 | -| ----- | ----- | ----- | ----- | -| en_US | zh_TW | ko_KR | ja_JP | +| ------------ | -------- | ------ | ------ | +| en_US | zh_TW | ko_KR | ja_JP | @@ -529,15 +529,15 @@ Language Code Sort Method -| Most Relevant | Most Recent | -| -------------- | ---- | -| default | new | +| Most Relevant | Most Recent | +| ------------- | ----------- | +| default | new | Language Code | English (US) | 繁體中文 | 한국어 | 日本語 | -| ----- | ----- | ----- | ----- | -| en_US | zh_TW | ko_KR | ja_JP | +| ------------ | -------- | ------ | ------ | +| en_US | zh_TW | ko_KR | ja_JP | @@ -625,9 +625,9 @@ The year, month and day provided under UTC time zone are the same as the officia -| 首頁 | PC | TV 掌機 | 手機遊戲 | 動漫畫 | 主題報導 | 活動展覽 | 電競 | -| ---- | -- | ------- | -------- | ------ | -------- | -------- | ---- | -| 缺省 | 1 | 3 | 4 | 5 | 9 | 11 | 13 | +| 首頁 | PC | TV 掌機 | 手機遊戲 | 動漫畫 | 主題報導 | 活動展覽 | 電競 | +| ---- | --- | ------- | -------- | ------ | -------- | -------- | ---- | +| 缺省 | 1 | 3 | 4 | 5 | 9 | 11 | 13 | | Switch | PS5 | PS4 | XboxOne | XboxSX | PC 單機 | PC 線上 | iOS | Android | Web | 漫畫 | 動畫 | | ------ | --- | --- | ------- | ------ | ------- | ------- | --- | ------- | --- | ----- | ----- | @@ -709,11 +709,11 @@ The year, month and day provided under UTC time zone are the same as the officia | 炉石传说 | 万智牌 | 游戏王 | 昆特牌 | 影之诗 | 符文之地传奇 | 阴阳师百闻牌 | | :------: | :----: | :----: | :----: | :----: | :----------: | :----------: | -| 17 | 18 | 16 | 19 | 20 | 329 | 221 | +| 17 | 18 | 16 | 19 | 20 | 329 | 221 | | 英雄联盟 | 电子游戏 | 桌面游戏 | 卡牌游戏 | 玩家杂谈 | 二次元 | | :------: | :------: | :------: | :------: | :------: | :----: | -| 112 | 389 | 24 | 102 | 23 | 117 | +| 112 | 389 | 24 | 102 | 23 | 117 | @@ -751,12 +751,12 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` -| 键 | 含义 | 接受的值 | 默认值 | -| ----------- | ----------------------------------- | ------------------------------------------------------------ | ------------ | -| forumType | 主榜类型(仅原神、大别野有cos主榜) | tongren/cos | tongren | +| 键 | 含义 | 接受的值 | 默认值 | +| ----------- | ----------------------------------- | -------------------------------------------------------------------- | ------------ | +| forumType | 主榜类型(仅原神、大别野有cos主榜) | tongren/cos | tongren | | cateType | 子榜类型(仅崩坏三、原神有子榜) | 崩坏三:illustration/comic/cos;原神:illustration/comic/qute/manual | illustration | -| rankingType | 排行榜类型(崩坏二没有日榜) | daily/weekly/monthly | daily | -| lastId | 当前页id(用于分页) | 数字 | 1 | +| rankingType | 排行榜类型(崩坏二没有日榜) | daily/weekly/monthly | daily | +| lastId | 当前页id(用于分页) | 数字 | 1 | 游戏缩写(目前绝区零还没有同人榜 @@ -774,9 +774,9 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` 崩坏三 子榜 -| 插画 | 漫画 | COS | -| ------------ | ----- | ---- | -| illustration | comic | cos | +| 插画 | 漫画 | COS | +| ------------ | ----- | --- | +| illustration | comic | cos | 原神 子榜 @@ -847,15 +847,15 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` 平台 -| 安卓服 | iOS 服 | B 服 | +| 安卓服 | iOS 服 | B 服 | | :-----: | :----: | :------: | -| Android | IOS | Bilibili | +| Android | IOS | Bilibili | 分组 -| 全部 | 系统公告 | 活动公告 | -| :--: | :------: | :------: | -| ALL | SYSTEM | ACTIVITY | +| 全部 | 系统公告 | 活动公告 | +| :---: | :------: | :------: | +| ALL | SYSTEM | ACTIVITY | @@ -1001,12 +1001,18 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` -| Switch | PS4 | PC | Xbox | -| ------ | --- | -- | ---- | -| 1 | 2 | 3 | 4 | +| Switch | PS4 | PC | Xbox | +| ------ | --- | --- | ---- | +| 1 | 2 | 3 | 4 | +## 游戏基因 {#you-xi-ji-yin} + +### 资讯 {#you-xi-ji-yin-zi-xun} + + + ## 游戏年轮 {#you-xi-nian-lun} ### 分类 {#you-xi-nian-lun-fen-lei} @@ -1124,9 +1130,9 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` -| 新着 | PS5 | Switch | PS4 | ニュース | ゲームニュース | PR TIMES | 動画 | 特集・企画記事 | インタビュー | 取材・リポート | レビュー | インディーゲーム | -| ----------- | --- | ------ | --- | ---- | --------- | -------- | ------ | --------------- | --------- | ------------ | ------ | ---------- | -| new-article | ps5 | switch | ps4 | news | news-game | prtimes | videos | special-article | interview | event-report | review | indie-game | +| 新着 | PS5 | Switch | PS4 | ニュース | ゲームニュース | PR TIMES | 動画 | 特集・企画記事 | インタビュー | 取材・リポート | レビュー | インディーゲーム | +| ----------- | --- | ------ | --- | -------- | -------------- | -------- | ------ | --------------- | ------------ | -------------- | -------- | ---------------- | +| new-article | ps5 | switch | ps4 | news | news-game | prtimes | videos | special-article | interview | event-report | review | indie-game | @@ -1139,4 +1145,3 @@ Example:`https://www.iyingdi.com/tz/people/55547` ,id 是 `55547` ### 游戏横幅 {#%E3%83%9E%E3%82%AE%E3%82%A2%E3%83%AC%E3%82%B3%E3%83%BC%E3%83%89-magia-record-mo-fa-ji-lu-you-xi-heng-fu} - From 92a376d691546b6a05fbbab8e71e6eb0f5ff6373 Mon Sep 17 00:00:00 2001 From: Derrick Hwechul Cho Date: Fri, 15 Sep 2023 05:29:58 -0700 Subject: [PATCH 11/12] feat(route): add sitemap transform (#13297) * feat(route): add sitemap transform * chore: resolve lint errors * chore: change router order * chore: apply the suggestion (xml2js -> cheerio) * chore: fix errors * chore: add maintainer * fix: sticks to sitemap protocol --------- --- lib/v2/rsshub/maintainer.js | 1 + lib/v2/rsshub/router.js | 1 + lib/v2/rsshub/transform/sitemap.js | 52 ++++++++++++++++++++++++++++++ website/docs/routes/other.md | 19 +++++++++++ 4 files changed, 73 insertions(+) create mode 100644 lib/v2/rsshub/transform/sitemap.js diff --git a/lib/v2/rsshub/maintainer.js b/lib/v2/rsshub/maintainer.js index b0ffddb838814b..5ab179176c3389 100644 --- a/lib/v2/rsshub/maintainer.js +++ b/lib/v2/rsshub/maintainer.js @@ -3,4 +3,5 @@ module.exports = { '/rsshub/sponsors': ['DIYgod'], '/transform/html/:url/:routeParams': ['ttttmr'], '/transform/json/:url/:routeParams': ['ttttmr'], + '/transform/sitemap/:url/:routeParams?': ['flrngel'], }; diff --git a/lib/v2/rsshub/router.js b/lib/v2/rsshub/router.js index 960796dbf4660e..2f90c082f82a93 100644 --- a/lib/v2/rsshub/router.js +++ b/lib/v2/rsshub/router.js @@ -3,4 +3,5 @@ module.exports = (router) => { router.get('/sponsors', require('./sponsors')); router.get('/transform/html/:url/:routeParams', require('./transform/html')); router.get('/transform/json/:url/:routeParams', require('./transform/json')); + router.get('/transform/sitemap/:url/:routeParams?', require('./transform/sitemap')); }; diff --git a/lib/v2/rsshub/transform/sitemap.js b/lib/v2/rsshub/transform/sitemap.js new file mode 100644 index 00000000000000..d4f233e84c518e --- /dev/null +++ b/lib/v2/rsshub/transform/sitemap.js @@ -0,0 +1,52 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const config = require('@/config').value; + +module.exports = async (ctx) => { + if (!config.feature.allow_user_supply_unsafe_domain) { + ctx.throw(403, `This RSS is disabled unless 'ALLOW_USER_SUPPLY_UNSAFE_DOMAIN' is set to 'true'.`); + } + const { url } = ctx.params; + const response = await got({ + method: 'get', + url, + }); + + const routeParams = new URLSearchParams(ctx.params.routeParams); + const $ = cheerio.load(response.data, { xmlMode: true }); + + const rssTitle = routeParams.get('title') ? routeParams.get('title') : ($('urlset url').length && $('urlset url').first().find('loc').text() ? $('urlset url').first().find('loc').text() : 'Sitemap'); + + let items; + const urls = $('urlset url').toArray(); + if (urls && urls.length) { + items = urls.map((item) => { + try { + const title = $(item).find('loc').text() || ''; + const link = $(item).find('loc').text() || ''; + const description = $(item).find('loc').text() || ''; + const pubDate = $(item).find('lastmod').text() || undefined; + + return { + title, + link, + description, + pubDate, + }; + } catch (e) { + return null; + } + }) + .filter(Boolean); + } + else { + items = []; + } + + ctx.state.data = { + title: rssTitle, + link: url, + description: `Proxy ${url}`, + item: items, + }; +}; diff --git a/website/docs/routes/other.md b/website/docs/routes/other.md index 44af8528f01b2e..7dca5e3d3344d5 100644 --- a/website/docs/routes/other.md +++ b/website/docs/routes/other.md @@ -646,6 +646,25 @@ Parsing of `routeParams` parameter: +### Sitemap {#transformation-sitemap} + +Specify options (in the format of query string) in parameter `routeParams` parameter to extract data from Sitemap. (Follows Sitemap Protocol 0.9) + +| Key | Meaning | Accepted Values | Default | +|-----------------|----------------------------------------------------------------|-----------------|------------------------| +| `title` | The title of the RSS | `string` | Extract from `` | + +<Route author="flrngel" example="/rsshub/transform/xml/https%3A%2F%2Fwww.sitemaps.org%2Fsitemap.xml/" path="/rsshub/transform/html/:url/:routeParams?" paramsDesc={['`encodeURIComponent`ed URL address', 'Transformation rules, requires URL encode']} selfhost="1"> + +Parameters parsing in the above example: + +| Parameter | Value | +|---------------|-------------------------------------------| +| `url` | `https://www.sitemaps.org/sitemap.xml` | +| `routeParams` | `title=Example` | + +</Route> + ## TSSstatus (iOS downgrade channel) {#tssstatus-ios-downgrade-channel} ### Status {#tssstatus-ios-downgrade-channel-status} From ad99b02e74346d423ee9523e19a3f66525e96f99 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:32:38 +0000 Subject: [PATCH 12/12] style: auto format --- lib/v2/rsshub/transform/sitemap.js | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/v2/rsshub/transform/sitemap.js b/lib/v2/rsshub/transform/sitemap.js index d4f233e84c518e..9fe1fabef69b67 100644 --- a/lib/v2/rsshub/transform/sitemap.js +++ b/lib/v2/rsshub/transform/sitemap.js @@ -15,31 +15,31 @@ module.exports = async (ctx) => { const routeParams = new URLSearchParams(ctx.params.routeParams); const $ = cheerio.load(response.data, { xmlMode: true }); - const rssTitle = routeParams.get('title') ? routeParams.get('title') : ($('urlset url').length && $('urlset url').first().find('loc').text() ? $('urlset url').first().find('loc').text() : 'Sitemap'); + const rssTitle = routeParams.get('title') ? routeParams.get('title') : $('urlset url').length && $('urlset url').first().find('loc').text() ? $('urlset url').first().find('loc').text() : 'Sitemap'; let items; const urls = $('urlset url').toArray(); if (urls && urls.length) { - items = urls.map((item) => { - try { - const title = $(item).find('loc').text() || ''; - const link = $(item).find('loc').text() || ''; - const description = $(item).find('loc').text() || ''; - const pubDate = $(item).find('lastmod').text() || undefined; + items = urls + .map((item) => { + try { + const title = $(item).find('loc').text() || ''; + const link = $(item).find('loc').text() || ''; + const description = $(item).find('loc').text() || ''; + const pubDate = $(item).find('lastmod').text() || undefined; - return { - title, - link, - description, - pubDate, - }; - } catch (e) { - return null; - } - }) - .filter(Boolean); - } - else { + return { + title, + link, + description, + pubDate, + }; + } catch (e) { + return null; + } + }) + .filter(Boolean); + } else { items = []; }