diff --git a/public/icons/smzdm.png b/public/icons/smzdm.png new file mode 100644 index 0000000..b074991 Binary files /dev/null and b/public/icons/smzdm.png differ diff --git a/server/glob.d.ts b/server/glob.d.ts index 7e06641..5e4ba07 100644 --- a/server/glob.d.ts +++ b/server/glob.d.ts @@ -21,6 +21,7 @@ declare module 'glob:./sources/{*.ts,**/index.ts}' { export const nowcoder: typeof import('./sources/nowcoder') export const pcbeta: typeof import('./sources/pcbeta') export const producthunt: typeof import('./sources/producthunt') + export const smzdm: typeof import('./sources/smzdm') export const solidot: typeof import('./sources/solidot') export const sputniknewscn: typeof import('./sources/sputniknewscn') export const thepaper: typeof import('./sources/thepaper') diff --git a/server/sources/smzdm.ts b/server/sources/smzdm.ts new file mode 100644 index 0000000..403fb41 --- /dev/null +++ b/server/sources/smzdm.ts @@ -0,0 +1,21 @@ +import * as cheerio from "cheerio" +import type { NewsItem } from "@shared/types" + +export default defineSource(async () => { + const baseURL = "https://post.smzdm.com/hot_1/" + const html: any = await myFetch(baseURL) + const $ = cheerio.load(html) + const $main = $("#feed-main-list .z-feed-title") + const news: NewsItem[] = [] + $main.each((_, el) => { + const a = $(el).find("a") + const url = a.attr("href")! + const title = a.text() + news.push({ + url, + title, + id: url, + }) + }) + return news +}) diff --git a/shared/pinyin.json b/shared/pinyin.json index 7905315..00f7177 100644 --- a/shared/pinyin.json +++ b/shared/pinyin.json @@ -33,8 +33,9 @@ "kaopu": "kaopuxinwen", "jin10": "jinshishuju", "baidu": "baiduresou", - "nowcoder": "niuke", "linuxdo-latest": "LINUX DO-zuixin", "linuxdo-hot": "LINUX DO-jinrizuire", - "ghxi": "guoheboke" + "ghxi": "guoheboke", + "smzdm": "shenmezhidemai", + "nowcoder": "niuke" } \ No newline at end of file diff --git a/shared/pre-sources.ts b/shared/pre-sources.ts index de3cddb..79ccd63 100644 --- a/shared/pre-sources.ts +++ b/shared/pre-sources.ts @@ -304,13 +304,6 @@ export const originSources = { type: "hottest", home: "https://www.baidu.com", }, - "nowcoder": { - name: "牛客", - column: "china", - color: "blue", - type: "hottest", - home: "https://www.nowcoder.com", - }, "linuxdo": { name: "LINUX DO", column: "tech", @@ -337,6 +330,20 @@ export const originSources = { disable: "cf", home: "https://www.ghxi.com/", }, + "smzdm": { + name: "什么值得买", + column: "china", + color: "red", + type: "hottest", + home: "https://www.smzdm.com", + }, + "nowcoder": { + name: "牛客", + column: "china", + color: "blue", + type: "hottest", + home: "https://www.nowcoder.com", + }, } as const satisfies Record export function genSources() { diff --git a/shared/sources.json b/shared/sources.json index 1f18884..e2edf60 100644 --- a/shared/sources.json +++ b/shared/sources.json @@ -378,14 +378,6 @@ "color": "blue", "interval": 600000 }, - "nowcoder": { - "name": "牛客", - "type": "hottest", - "column": "china", - "home": "https://www.nowcoder.com", - "color": "blue", - "interval": 600000 - }, "linuxdo": { "redirect": "linuxdo-latest", "name": "LINUX DO", @@ -422,5 +414,21 @@ "home": "https://www.ghxi.com/", "color": "yellow", "interval": 600000 + }, + "smzdm": { + "name": "什么值得买", + "type": "hottest", + "column": "china", + "home": "https://www.smzdm.com", + "color": "red", + "interval": 600000 + }, + "nowcoder": { + "name": "牛客", + "type": "hottest", + "column": "china", + "home": "https://www.nowcoder.com", + "color": "blue", + "interval": 600000 } } \ No newline at end of file