diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad5a7e6..302cfb7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3262,6 +3262,9 @@ packages: destr@2.0.3: resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} + destr@2.0.5: + resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==} + destroy@1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} @@ -4021,8 +4024,8 @@ packages: resolution: {integrity: sha512-O1Ld7Dr+nqPnmGpdhzLmMTQ4vAsD+rHwMm1NLUmoUFFymBOMKxCCrtDxqdBRYXdeEPEi3SyoR4TizJLQrnKBNA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - h3-nightly@1.15.1-20250222-111608-d1c00fc: - resolution: {integrity: sha512-V2DeFol/CJ4QLimURS59juWk4b+XY2qhSlyhi0U3WnqN3PKLAIpLtRn340MHQf53ldMhP4oQA/SrJG9hPOcnLA==} + h3-nightly@1.15.2-20250418-133010-0c9b276: + resolution: {integrity: sha512-s7CE2w7A7EqAdC/0WIAbNDAuvZB3afNCLXyv3Yvflcih3uKki4mRXMuw1Mq4bvykh0uJfAPZTF1GpOeca4xQ6A==} h3@1.15.1: resolution: {integrity: sha512-+ORaOBttdUm1E2Uu/obAyCguiI7MbBvsLTndc3gyK3zU+SYLoZXlyCP9Xgy0gikkGufFLTZXCXD6+4BsufnmHA==} @@ -5862,6 +5865,9 @@ packages: ufo@1.5.4: resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} + ufo@1.6.1: + resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==} + unbox-primitive@1.1.0: resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==} engines: {node: '>= 0.4'} @@ -9426,6 +9432,8 @@ snapshots: destr@2.0.3: {} + destr@2.0.5: {} + destroy@1.2.0: {} detect-libc@1.0.3: {} @@ -10439,16 +10447,16 @@ snapshots: dependencies: duplexer: 0.1.2 - h3-nightly@1.15.1-20250222-111608-d1c00fc: + h3-nightly@1.15.2-20250418-133010-0c9b276: dependencies: cookie-es: 1.2.2 crossws: 0.3.4 defu: 6.1.4 - destr: 2.0.3 + destr: 2.0.5 iron-webcrypto: 1.2.1 node-mock-http: 1.0.0 radix3: 1.1.2 - ufo: 1.5.4 + ufo: 1.6.1 uncrypto: 0.1.3 h3@1.15.1: @@ -11178,7 +11186,7 @@ snapshots: fs-extra: 11.3.0 globby: 14.1.0 gzip-size: 7.0.0 - h3: h3-nightly@1.15.1-20250222-111608-d1c00fc + h3: h3-nightly@1.15.2-20250418-133010-0c9b276 hookable: 5.5.3 httpxy: 0.1.7 ioredis: 5.5.0 @@ -12472,6 +12480,8 @@ snapshots: ufo@1.5.4: {} + ufo@1.6.1: {} + unbox-primitive@1.1.0: dependencies: call-bound: 1.0.4 @@ -12743,7 +12753,7 @@ snapshots: dependencies: consola: 3.4.0 defu: 6.1.4 - h3: h3-nightly@1.15.1-20250222-111608-d1c00fc + h3: h3-nightly@1.15.2-20250418-133010-0c9b276 nitropack: nitro-go@0.0.1(better-sqlite3@11.8.1)(typescript@5.8.2) vite: 6.2.0(@types/node@22.13.9)(jiti@2.4.2)(terser@5.39.0)(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: diff --git a/public/icons/chongbuluo.png b/public/icons/chongbuluo.png new file mode 100644 index 0000000..eee2aaf Binary files /dev/null and b/public/icons/chongbuluo.png differ diff --git a/server/glob.d.ts b/server/glob.d.ts index 94311df..dab77e1 100644 --- a/server/glob.d.ts +++ b/server/glob.d.ts @@ -5,6 +5,7 @@ declare module 'glob:./sources/{*.ts,**/index.ts}' { export const baidu: typeof import('./sources/baidu') export const bilibili: typeof import('./sources/bilibili') export const cankaoxiaoxi: typeof import('./sources/cankaoxiaoxi') + export const chongbuluo: typeof import('./sources/chongbuluo') export const cls: typeof import('./sources/cls/index') export const coolapk: typeof import('./sources/coolapk/index') export const douyin: typeof import('./sources/douyin') diff --git a/server/sources/chongbuluo.ts b/server/sources/chongbuluo.ts new file mode 100644 index 0000000..d3d812a --- /dev/null +++ b/server/sources/chongbuluo.ts @@ -0,0 +1,32 @@ +import type { NewsItem } from "@shared/types" +import * as cheerio from "cheerio" + +const hot = defineSource(async () => { + const baseUrl = "https://www.chongbuluo.com/" + const html: string = await myFetch(`${baseUrl}forum.php?mod=guide&view=hot`) + const $ = cheerio.load(html) + const news: NewsItem[] = [] + + $(".bmw table tr").each((_, elem) => { + const xst = $(elem).find(".common .xst").text() + const url = $(elem).find(".common a").attr("href") + news.push({ + id: baseUrl + url, + url: baseUrl + url, + title: xst, + extra: { + hover: xst, + }, + }) + }) + + return news +}) + +const latest = defineRSSSource("https://www.chongbuluo.com/forum.php?mod=rss&view=newthread") + +export default defineSource({ + "chongbuluo": hot, + "chongbuluo-hot": hot, + "chongbuluo-latest": latest, +}) diff --git a/shared/pinyin.json b/shared/pinyin.json index 153b23a..445c1df 100644 --- a/shared/pinyin.json +++ b/shared/pinyin.json @@ -42,5 +42,7 @@ "nowcoder": "niuke", "sspai": "shaoshupai", "juejin": "xitujuejin", - "ifeng": "fenghuangwang-redianzixun" + "ifeng": "fenghuangwang-redianzixun", + "chongbuluo-latest": "chongbuluo-zuixin", + "chongbuluo-hot": "chongbuluo-zuire" } \ No newline at end of file diff --git a/shared/pre-sources.ts b/shared/pre-sources.ts index d7dddd9..efe00a3 100644 --- a/shared/pre-sources.ts +++ b/shared/pre-sources.ts @@ -379,6 +379,25 @@ export const originSources = { title: "热点资讯", home: "https://www.ifeng.com", }, + "chongbuluo": { + name: "虫部落", + column: "china", + color: "green", + home: "https://www.chongbuluo.com", + sub: { + latest: { + title: "最新", + interval: Time.Common, + home: "https://www.chongbuluo.com/forum.php?mod=guide&view=newthread", + }, + hot: { + title: "最热", + type: "hottest", + interval: Time.Common, + home: "https://www.chongbuluo.com/forum.php?mod=guide&view=hot", + }, + }, + }, } as const satisfies Record export function genSources() { diff --git a/shared/sources.json b/shared/sources.json index 0ffe8f4..4b1da60 100644 --- a/shared/sources.json +++ b/shared/sources.json @@ -475,5 +475,31 @@ "home": "https://www.ifeng.com", "color": "red", "interval": 600000 + }, + "chongbuluo": { + "redirect": "chongbuluo-latest", + "name": "虫部落", + "column": "china", + "home": "https://www.chongbuluo.com/forum.php?mod=guide&view=newthread", + "color": "green", + "interval": 1800000, + "title": "最新" + }, + "chongbuluo-latest": { + "name": "虫部落", + "column": "china", + "home": "https://www.chongbuluo.com/forum.php?mod=guide&view=newthread", + "color": "green", + "interval": 1800000, + "title": "最新" + }, + "chongbuluo-hot": { + "name": "虫部落", + "type": "hottest", + "column": "china", + "home": "https://www.chongbuluo.com/forum.php?mod=guide&view=hot", + "color": "green", + "interval": 1800000, + "title": "最热" } } \ No newline at end of file