Merge branch 'dev'

This commit is contained in:
ourongxing
2025-04-23 13:40:29 +08:00
6 changed files with 47 additions and 1 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

+1
View File
@@ -13,6 +13,7 @@ declare module 'glob:./sources/{*.ts,**/index.ts}' {
export const ghxi: typeof import('./sources/ghxi')
export const github: typeof import('./sources/github')
export const hackernews: typeof import('./sources/hackernews')
export const ifeng: typeof import('./sources/ifeng')
export const ithome: typeof import('./sources/ithome')
export const jin10: typeof import('./sources/jin10')
export const juejin: typeof import('./sources/juejin')
+27
View File
@@ -0,0 +1,27 @@
import type { NewsItem } from "@shared/types"
export default defineSource(async () => {
const html: string = await myFetch("https://www.ifeng.com/")
const regex = /var\s+allData\s*=\s*(\{[\s\S]*?\});/
const match = regex.exec(html)
const news: NewsItem[] = []
if (match) {
const realData = JSON.parse(match[1])
const rawNews = realData.hotNews1 as {
url: string
title: string
newsTime: string
}[]
rawNews.forEach((hotNews) => {
news.push({
id: hotNews.url,
url: hotNews.url,
title: hotNews.title,
extra: {
date: hotNews.newsTime,
},
})
})
}
return news
})
+2 -1
View File
@@ -41,5 +41,6 @@
"smzdm": "shenmezhidemai",
"nowcoder": "niuke",
"sspai": "shaoshupai",
"juejin": "xitujuejin"
"juejin": "xitujuejin",
"ifeng": "fenghuangwang-redianzixun"
}
+8
View File
@@ -371,6 +371,14 @@ export const originSources = {
type: "hottest",
home: "https://juejin.cn",
},
"ifeng": {
name: "凤凰网",
column: "china",
color: "red",
type: "hottest",
title: "热点资讯",
home: "https://www.ifeng.com",
},
} as const satisfies Record<string, OriginSource>
export function genSources() {
+9
View File
@@ -466,5 +466,14 @@
"home": "https://juejin.cn",
"color": "blue",
"interval": 600000
},
"ifeng": {
"title": "热点资讯",
"name": "凤凰网",
"type": "hottest",
"column": "china",
"home": "https://www.ifeng.com",
"color": "red",
"interval": 600000
}
}