diff --git a/README.md b/README.md
index 00463f7..75dbdbb 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,8 @@
| 稀土掘金 | 热榜 | juejin | 🟢 |
| 腾讯新闻 | 热点榜 | qq-news | 🟢 |
| 网易新闻 | 热点榜 | netease-news | 🟢 |
+| 虎嗅 | 24小时 | huxiu | 🟢 |
+| 爱范儿 | 快讯 | ifanr | 🟢 |
| 英雄联盟 | 更新公告 | lol | 🟢 |
| 原神 | 最新消息 | genshin | 🟢 |
| 崩坏3 | 最新动态 | honkai | 🟢 |
diff --git a/src/index.ts b/src/index.ts
index b15b779..60274fc 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -3,13 +3,13 @@ import { config } from "./config.js";
import logger from "./utils/logger.js";
import app from "./app.js";
-logger.info(`🔥 DailyHot API 成功在端口 ${config.PORT} 上运行`);
-logger.info(`🔗 Local: 👉 http://localhost:${config.PORT}`);
-
// 启动服务器
const server = serve({
fetch: app.fetch,
port: config.PORT,
});
+logger.info(`🔥 DailyHot API 成功在端口 ${config.PORT} 上运行`);
+logger.info(`🔗 Local: 👉 http://localhost:${config.PORT}`);
+
export default server;
diff --git a/src/router.types.ts b/src/router.types.ts
index ff9bd21..40f60d9 100644
--- a/src/router.types.ts
+++ b/src/router.types.ts
@@ -214,4 +214,21 @@ export type RouterType = {
url: string;
pic: string;
};
+ huxiu: {
+ object_id: number;
+ content: string;
+ url: string;
+ user_info: {
+ username: string;
+ };
+ };
+ ifanr: {
+ buzz_original_url: string;
+ id: number;
+ post_content: string;
+ post_id: number;
+ post_title: string;
+ like_count: number;
+ comment_count: number;
+ };
};
diff --git a/src/routes/huxiu.ts b/src/routes/huxiu.ts
new file mode 100644
index 0000000..c953225
--- /dev/null
+++ b/src/routes/huxiu.ts
@@ -0,0 +1,51 @@
+import type { RouterData } from "../types.js";
+import type { RouterType } from "../router.types.js";
+import { get } from "../utils/getData.js";
+
+export const handleRoute = async (_: undefined, noCache: boolean) => {
+ const { fromCache, data, updateTime } = await getList(noCache);
+ const routeData: RouterData = {
+ name: "huxiu",
+ title: "虎嗅",
+ type: "24小时",
+ link: "https://www.huxiu.com/moment/",
+ total: data?.length || 0,
+ updateTime,
+ fromCache,
+ data,
+ };
+ return routeData;
+};
+
+// 标题处理
+const titleProcessing = (text: string) => {
+ const paragraphs = text.split("
");
+ const title = paragraphs.shift().replace(/。$/, "");
+ const intro = paragraphs.join("
");
+ return { title, intro };
+};
+
+const getList = async (noCache: boolean) => {
+ const url = `https://www.huxiu.com/moment/`;
+ const result = await get({
+ url,
+ noCache,
+ });
+ // 正则查找
+ const pattern =
+ /