From 14bbdc4e865c4441db5b97d800bccf6a5b694d66 Mon Sep 17 00:00:00 2001 From: HyperCherry Date: Fri, 26 Apr 2024 22:32:38 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix(route):=20=E5=9B=9B=E5=B7=9D=E5=B7=A5?= =?UTF-8?q?=E5=95=86=E5=AD=A6=E9=99=A2=20-=20=E5=AD=A6=E9=99=A2=E6=96=B0?= =?UTF-8?q?=E9=97=BB=20(#15381)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(route): fixed stbu docs & radar * fix(route): removed target properties in radar --- lib/routes/stbu/jsjxy.ts | 6 +++--- lib/routes/stbu/xyxw.ts | 17 ++++++++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/routes/stbu/jsjxy.ts b/lib/routes/stbu/jsjxy.ts index 81f739a9ffb11a..2f4a8333f8187d 100644 --- a/lib/routes/stbu/jsjxy.ts +++ b/lib/routes/stbu/jsjxy.ts @@ -15,17 +15,17 @@ export const route: Route = { features: { requireConfig: false, requirePuppeteer: false, - antiCrawler: false, + antiCrawler: true, supportBT: false, supportPodcast: false, supportScihub: false, }, radar: [ { - source: ['jsjxy.stbu.edu.cn/news', 'jsjxy.stbu.edu.cn/'], + source: ['jsjxy.stbu.edu.cn/news', 'jsjxy.stbu.edu.cn', 'stbu.edu.cn'], }, ], - name: '计算机学院通知公告', + name: '计算机学院 - 通知公告', maintainers: ['HyperCherry'], handler, url: 'jsjxy.stbu.edu.cn/news', diff --git a/lib/routes/stbu/xyxw.ts b/lib/routes/stbu/xyxw.ts index ec9a75c1062b99..a93e25bedafd03 100644 --- a/lib/routes/stbu/xyxw.ts +++ b/lib/routes/stbu/xyxw.ts @@ -9,19 +9,30 @@ import timezone from '@/utils/timezone'; const gbk2utf8 = (s) => iconv.decode(s, 'gbk'); export const route: Route = { path: '/xyxw', + categories: ['university'], + example: '/stbu/xyxw', + parameters: {}, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: true, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, radar: [ { - source: ['stbu.edu.cn/html/news/xueyuan', 'stbu.edu.cn/'], + source: ['stbu.edu.cn/html/news/xueyuan', 'stbu.edu.cn'], }, ], - name: 'Unknown', + name: '学院新闻', maintainers: ['HyperCherry'], handler, url: 'stbu.edu.cn/html/news/xueyuan', }; async function handler() { - const baseUrl = 'https://www.stbu.edu.cn'; + const baseUrl = 'http://www.stbu.edu.cn'; const requestUrl = `${baseUrl}/html/news/xueyuan/`; const { data: response } = await got(requestUrl, { responseType: 'buffer', From 472073d2fc0e392d5c99cd38cf1126324804341e Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 26 Apr 2024 23:45:32 +0800 Subject: [PATCH 2/4] chore: use cache in tsx dev --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 49347779594825..00b11ad9c93d9c 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "scripts": { "build": "tsx scripts/workflow/build-routes.ts", "build:docs": "tsx scripts/workflow/build-docs.ts", - "dev": "cross-env NODE_ENV=dev tsx watch --no-cache lib/index.ts", - "dev:cache": "cross-env NODE_ENV=production tsx watch lib/index.ts", + "dev": "cross-env NODE_ENV=dev tsx watch --clear-screen=false lib/index.ts", + "dev:cache": "cross-env NODE_ENV=production tsx watch --clear-screen=false lib/index.ts", "format": "prettier \"**/*.{ts,tsx,js,json}\" --write && eslint --cache --fix \"**/*.{ts,tsx,js,yml}\"", "format:check": "prettier \"**/*.{ts,tsx,js,json}\" --check && eslint --cache \"**/*.{ts,tsx,js,yml}\"", "format:staged": "lint-staged", From 80e3ceda53f7c074f84ee107f125aa9e8e2f8616 Mon Sep 17 00:00:00 2001 From: Nick22nd Date: Sat, 27 Apr 2024 02:59:13 +0800 Subject: [PATCH 3/4] feat(route): add ollama models (#15383) * feat(route): add ollama models * fix some problems --- lib/routes/ollama/models.ts | 39 ++++++++++++++++++++++++++++++++++ lib/routes/ollama/namespace.ts | 6 ++++++ 2 files changed, 45 insertions(+) create mode 100644 lib/routes/ollama/models.ts create mode 100644 lib/routes/ollama/namespace.ts diff --git a/lib/routes/ollama/models.ts b/lib/routes/ollama/models.ts new file mode 100644 index 00000000000000..335fe40424258f --- /dev/null +++ b/lib/routes/ollama/models.ts @@ -0,0 +1,39 @@ +import { Route } from '@/types'; +import ofetch from '@/utils/ofetch'; +import { load } from 'cheerio'; + +export const route: Route = { + path: '/library', + categories: ['programming'], + example: '/ollama/library', + radar: [ + { + source: ['ollama.com/library'], + }, + ], + name: 'Models', + maintainers: ['Nick22nd'], + handler, +}; +async function handler() { + const response = await ofetch('https://ollama.com/library'); + const $ = load(response); + const items = $('#repo > ul > li > a') + .toArray() + .map((item) => { + const name = $(item).children('h2').first(); + const link = $(item).attr('href'); + const description = $(item).children('p').first(); + + return { + title: name.text(), + link, + description: description.text(), + }; + }); + return { + title: 'ollama library', + link: 'https://ollama.com/library', + item: items, + }; +} diff --git a/lib/routes/ollama/namespace.ts b/lib/routes/ollama/namespace.ts new file mode 100644 index 00000000000000..1e60b826e13473 --- /dev/null +++ b/lib/routes/ollama/namespace.ts @@ -0,0 +1,6 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'Ollama', + url: 'ollama.com', +}; From 827850860b9f0255ab13977e5670ed8cb3f9928a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 22:11:59 +0000 Subject: [PATCH 4/4] chore(deps): bump @hono/node-server from 1.11.0 to 1.11.1 (#15386) * chore(deps): bump @hono/node-server from 1.11.0 to 1.11.1 Bumps [@hono/node-server](https://github.com/honojs/node-server) from 1.11.0 to 1.11.1. - [Release notes](https://github.com/honojs/node-server/releases) - [Commits](https://github.com/honojs/node-server/compare/v1.11.0...v1.11.1) --- updated-dependencies: - dependency-name: "@hono/node-server" dependency-type: direct:production 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 00b11ad9c93d9c..febe040a2548ee 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "*.yml": "eslint --cache --fix" }, "dependencies": { - "@hono/node-server": "1.11.0", + "@hono/node-server": "1.11.1", "@hono/swagger-ui": "0.2.1", "@hono/zod-openapi": "0.11.0", "@notionhq/client": "2.2.15", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e687ceee2a9aaa..5a468e3bd35455 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: '@hono/node-server': - specifier: 1.11.0 - version: 1.11.0 + specifier: 1.11.1 + version: 1.11.1 '@hono/swagger-ui': specifier: 0.2.1 version: 0.2.1(hono@4.2.7) @@ -2129,8 +2129,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@hono/node-server@1.11.0: - resolution: {integrity: sha512-TLIJq9TMtD1NEG1mVoqNUn1Ita0qSaB5XboZErjFBcO/GJYXwWY4dVdTi9G0lbxtu0x+hJXDItcLaFHb7rlFTw==} + /@hono/node-server@1.11.1: + resolution: {integrity: sha512-GW1Iomhmm1o4Z+X57xGby8A35Cu9UZLL7pSMdqDBkD99U5cywff8F+8hLk5aBTzNubnsFAvWQ/fZjNwPsEn9lA==} engines: {node: '>=18.14.1'} dev: false