From 0823df23c2dfb908f7a399876dadbe1d4b636da3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:31:28 +0000 Subject: [PATCH 1/3] chore(deps): bump tldts from 6.1.66 to 6.1.67 (#17877) Bumps [tldts](https://github.com/remusao/tldts) from 6.1.66 to 6.1.67. - [Release notes](https://github.com/remusao/tldts/releases) - [Changelog](https://github.com/remusao/tldts/blob/master/CHANGELOG.md) - [Commits](https://github.com/remusao/tldts/compare/v6.1.66...v6.1.67) --- updated-dependencies: - dependency-name: tldts dependency-type: direct:production update-type: version-update:semver-patch ... 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 176bf4ba9fe485..b45892eba46fdb 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "telegram": "2.26.8", "tiny-async-pool": "2.1.0", "title": "4.0.1", - "tldts": "6.1.66", + "tldts": "6.1.67", "tosource": "2.0.0-alpha.3", "tough-cookie": "5.0.0", "tsx": "4.19.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8778aa20e3a42..610d89db7be8cf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -241,8 +241,8 @@ importers: specifier: 4.0.1 version: 4.0.1 tldts: - specifier: 6.1.66 - version: 6.1.66 + specifier: 6.1.67 + version: 6.1.67 tosource: specifier: 2.0.0-alpha.3 version: 2.0.0-alpha.3 @@ -5171,11 +5171,11 @@ packages: resolution: {integrity: sha512-tcwMRIioTcF/FcxLev8MJWxCp+GUALRhFEqbDoZrnowmKSGqPrl5pqS+Sut2m8BgJ6S4FExCSSpGffZ0Tks6Aw==} hasBin: true - tldts-core@6.1.66: - resolution: {integrity: sha512-s07jJruSwndD2X8bVjwioPfqpIc1pDTzszPe9pL1Skbh4bjytL85KNQ3tolqLbCvpQHawIsGfFi9dgerWjqW4g==} + tldts-core@6.1.67: + resolution: {integrity: sha512-12K5O4m3uUW6YM5v45Z7wc6NTSmAYj4Tq3de7eXghZkp879IlfPJrUWeWFwu1FS94U5t2vwETgJ1asu8UGNKVQ==} - tldts@6.1.66: - resolution: {integrity: sha512-l3ciXsYFel/jSRfESbyKYud1nOw7WfhrBEF9I3UiarYk/qEaOOwu3qXNECHw4fHGHGTEOuhf/VdKgoDX5M/dhQ==} + tldts@6.1.67: + resolution: {integrity: sha512-714VbegxoZ9WF5/IsVCy9rWXKUpPkJq87ebWLXQzNawce96l5oRrRf2eHzB4pT2g/4HQU1dYbu+sdXClYxlDKQ==} hasBin: true tmp@0.0.33: @@ -5741,7 +5741,7 @@ snapshots: '@babel/traverse': 7.25.9 '@babel/types': 7.26.0 convert-source-map: 2.0.0 - debug: 4.3.7 + debug: 4.4.0 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -10974,11 +10974,11 @@ snapshots: tlds@1.255.0: {} - tldts-core@6.1.66: {} + tldts-core@6.1.67: {} - tldts@6.1.66: + tldts@6.1.67: dependencies: - tldts-core: 6.1.66 + tldts-core: 6.1.67 tmp@0.0.33: dependencies: @@ -11014,7 +11014,7 @@ snapshots: tough-cookie@5.0.0: dependencies: - tldts: 6.1.66 + tldts: 6.1.67 tr46@0.0.3: {} From 6ffabac65457b23c877069272b73e371c843612c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 01:27:27 -0800 Subject: [PATCH 2/3] chore(deps-dev): bump @types/node from 22.10.1 to 22.10.2 (#17876) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.10.1 to 22.10.2. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 66 +++++++++++++++++++++++++------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index b45892eba46fdb..b3e0622edf5637 100644 --- a/package.json +++ b/package.json @@ -161,7 +161,7 @@ "@types/mailparser": "3.4.5", "@types/markdown-it": "14.1.2", "@types/module-alias": "2.0.4", - "@types/node": "22.10.1", + "@types/node": "22.10.2", "@types/sanitize-html": "2.13.0", "@types/supertest": "6.0.2", "@types/tiny-async-pool": "2.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 610d89db7be8cf..32e911c3d950da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -344,8 +344,8 @@ importers: specifier: 2.0.4 version: 2.0.4 '@types/node': - specifier: 22.10.1 - version: 22.10.1 + specifier: 22.10.2 + version: 22.10.2 '@types/sanitize-html': specifier: 2.13.0 version: 2.13.0 @@ -372,7 +372,7 @@ importers: version: 0.27.9(rollup@4.24.4) '@vitest/coverage-v8': specifier: 2.0.5 - version: 2.0.5(vitest@2.0.5(@types/node@22.10.1)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10))) + version: 2.0.5(vitest@2.0.5(@types/node@22.10.2)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10))) discord-api-types: specifier: 0.37.111 version: 0.37.111 @@ -441,10 +441,10 @@ importers: version: 11.0.5 vite-tsconfig-paths: specifier: 5.1.4 - version: 5.1.4(typescript@5.7.2)(vite@5.4.10(@types/node@22.10.1)) + version: 5.1.4(typescript@5.7.2)(vite@5.4.10(@types/node@22.10.2)) vitest: specifier: 2.0.5 - version: 2.0.5(@types/node@22.10.1)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + version: 2.0.5(@types/node@22.10.2)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)) yaml-eslint-parser: specifier: 1.2.3 version: 1.2.3 @@ -1947,8 +1947,8 @@ packages: '@types/node-fetch@2.6.11': resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} - '@types/node@22.10.1': - resolution: {integrity: sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==} + '@types/node@22.10.2': + resolution: {integrity: sha512-Xxr6BBRCAOQixvonOye19wnzyDiUtTeqldOOmj3CkeblonbccA12PFwlufvRdrpjXxqnmUaeiU5EOA+7s5diUQ==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -6735,7 +6735,7 @@ snapshots: '@inquirer/figures': 1.0.7 '@inquirer/type': 2.0.0 '@types/mute-stream': 0.0.4 - '@types/node': 22.10.1 + '@types/node': 22.10.2 '@types/wrap-ansi': 3.0.0 ansi-escapes: 4.3.2 cli-width: 4.1.0 @@ -7222,12 +7222,12 @@ snapshots: '@types/etag@1.8.3': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 22.10.1 + '@types/node': 22.10.2 '@types/html-to-text@9.0.4': {} @@ -7235,13 +7235,13 @@ snapshots: '@types/imapflow@1.0.19': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 '@types/js-beautify@1.14.3': {} '@types/jsdom@21.1.7': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 '@types/tough-cookie': 4.0.5 parse5: 7.2.1 @@ -7251,7 +7251,7 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 '@types/jsrsasign@10.5.13': {} @@ -7261,7 +7261,7 @@ snapshots: '@types/mailparser@3.4.5': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 iconv-lite: 0.6.3 '@types/markdown-it@14.1.2': @@ -7283,14 +7283,14 @@ snapshots: '@types/mute-stream@0.0.4': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 '@types/node-fetch@2.6.11': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 form-data: 4.0.1 - '@types/node@22.10.1': + '@types/node@22.10.2': dependencies: undici-types: 6.20.0 @@ -7304,7 +7304,7 @@ snapshots: '@types/request@2.48.12': dependencies: '@types/caseless': 0.12.5 - '@types/node': 22.10.1 + '@types/node': 22.10.2 '@types/tough-cookie': 4.0.5 form-data: 2.5.2 @@ -7318,7 +7318,7 @@ snapshots: dependencies: '@types/cookiejar': 2.1.5 '@types/methods': 1.1.4 - '@types/node': 22.10.1 + '@types/node': 22.10.2 form-data: 4.0.1 '@types/supertest@6.0.2': @@ -7342,7 +7342,7 @@ snapshots: '@types/yauzl@2.10.3': dependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 optional: true '@typescript-eslint/eslint-plugin@8.18.0(@typescript-eslint/parser@8.18.0(eslint@9.16.0)(typescript@5.7.2))(eslint@9.16.0)(typescript@5.7.2)': @@ -7448,7 +7448,7 @@ snapshots: - rollup - supports-color - '@vitest/coverage-v8@2.0.5(vitest@2.0.5(@types/node@22.10.1)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)))': + '@vitest/coverage-v8@2.0.5(vitest@2.0.5(@types/node@22.10.2)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -7462,7 +7462,7 @@ snapshots: std-env: 3.7.0 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.0.5(@types/node@22.10.1)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + vitest: 2.0.5(@types/node@22.10.2)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)) transitivePeerDependencies: - supports-color @@ -10282,7 +10282,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 22.10.1 + '@types/node': 22.10.2 long: 5.2.3 proxy-agent@6.4.0: @@ -11207,13 +11207,13 @@ snapshots: '@types/unist': 3.0.3 vfile-message: 4.0.2 - vite-node@2.0.5(@types/node@22.10.1): + vite-node@2.0.5(@types/node@22.10.2): dependencies: cac: 6.7.14 debug: 4.3.7 pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: 5.4.10(@types/node@22.10.1) + vite: 5.4.10(@types/node@22.10.2) transitivePeerDependencies: - '@types/node' - less @@ -11225,27 +11225,27 @@ snapshots: - supports-color - terser - vite-tsconfig-paths@5.1.4(typescript@5.7.2)(vite@5.4.10(@types/node@22.10.1)): + vite-tsconfig-paths@5.1.4(typescript@5.7.2)(vite@5.4.10(@types/node@22.10.2)): dependencies: debug: 4.3.7 globrex: 0.1.2 tsconfck: 3.1.4(typescript@5.7.2) optionalDependencies: - vite: 5.4.10(@types/node@22.10.1) + vite: 5.4.10(@types/node@22.10.2) transitivePeerDependencies: - supports-color - typescript - vite@5.4.10(@types/node@22.10.1): + vite@5.4.10(@types/node@22.10.2): dependencies: esbuild: 0.21.5 postcss: 8.4.47 rollup: 4.24.4 optionalDependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 fsevents: 2.3.3 - vitest@2.0.5(@types/node@22.10.1)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)): + vitest@2.0.5(@types/node@22.10.2)(jsdom@25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10)): dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.5 @@ -11263,11 +11263,11 @@ snapshots: tinybench: 2.9.0 tinypool: 1.0.1 tinyrainbow: 1.2.0 - vite: 5.4.10(@types/node@22.10.1) - vite-node: 2.0.5(@types/node@22.10.1) + vite: 5.4.10(@types/node@22.10.2) + vite-node: 2.0.5(@types/node@22.10.2) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.10.1 + '@types/node': 22.10.2 jsdom: 25.0.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - less From 2a90282da9154cd702f1f5d5c1bb084569cd7d48 Mon Sep 17 00:00:00 2001 From: Geraldxm <115340172+Geraldxm@users.noreply.github.com> Date: Thu, 12 Dec 2024 18:52:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(route):=20=E5=85=85=E7=94=B5=E5=A4=B4?= =?UTF-8?q?=E7=BD=91=20(#17860)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(route): 充电头网 * use REST API * remove cache; use date_gmt * Update lib/routes/chongdiantou/index.ts --- lib/routes/chongdiantou/index.ts | 54 ++++++++++++++++++++++++++++ lib/routes/chongdiantou/namespace.ts | 9 +++++ 2 files changed, 63 insertions(+) create mode 100644 lib/routes/chongdiantou/index.ts create mode 100644 lib/routes/chongdiantou/namespace.ts diff --git a/lib/routes/chongdiantou/index.ts b/lib/routes/chongdiantou/index.ts new file mode 100644 index 00000000000000..3ea95397d04ee5 --- /dev/null +++ b/lib/routes/chongdiantou/index.ts @@ -0,0 +1,54 @@ +import { Route } from '@/types'; +import { namespace } from './namespace'; +import ofetch from '@/utils/ofetch'; +import logger from '@/utils/logger'; + +async function getPosts() { + try { + // Fetch data directly from the API without caching + const response = await ofetch('https://www.chongdiantou.com/wp-json/wp/v2/posts?_embed&per_page=10', { + headers: { + method: 'GET', + }, + }); + return response.map((post) => ({ + title: post.title.rendered, + link: post.link, + pubDate: new Date(post.date_gmt), // Use date_gmt instead of date + category: post._embedded['wp:term'][0].map((term) => term.name).join(', '), + description: post.content.rendered, + author: post._embedded.author[0].name, + image: post._embedded['wp:featuredmedia'] ? post._embedded['wp:featuredmedia'][0].source_url : '', + })); + } catch (error) { + logger.error('Error fetching posts:', error); + return []; + } +} + +export const route: Route = { + path: '/', + categories: namespace.categories, + example: '/chongdiantou', + radar: [ + { + source: ['www.chongdiantou.com'], + }, + ], + name: '最新资讯', + maintainers: ['Geraldxm'], + handler, + url: 'www.chongdiantou.com', +}; + +async function handler() { + const items = await getPosts(); + + return { + title: '充电头网 - 最新资讯', + description: '充电头网新闻资讯', + link: 'https://www.chongdiantou.com/', + image: 'https://static.chongdiantou.com/wp-content/uploads/2021/02/2021021806172389.png', + item: items, + }; +} diff --git a/lib/routes/chongdiantou/namespace.ts b/lib/routes/chongdiantou/namespace.ts new file mode 100644 index 00000000000000..b67d38e1b65017 --- /dev/null +++ b/lib/routes/chongdiantou/namespace.ts @@ -0,0 +1,9 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '充电头网', + url: 'www.chongdiantou.com', + categories: ['new-media'], + lang: 'zh-CN', + description: '充电头网是国内最早进行消费类电源技术及其周边配件(快充、充电头、充电器、无线充、车充、车载充电器、数据线、充电线材、移动电源及电芯、USB插排)评测、拆解的专业机构。', +};