chore(server): increase number of news

This commit is contained in:
Ou 2024-10-13 13:59:23 +08:00
parent 78a289982b
commit 277d502d5c
15 changed files with 18 additions and 18 deletions

View File

@ -26,5 +26,5 @@ export default defineSource(async () => {
}
})
return news.slice(0, 20)
return news.slice(0, 30)
})

View File

@ -20,5 +20,5 @@ export default defineSource(async () => {
date: tranformToUTC(k.data.publishTime),
},
url: k.data.url,
})).sort((m, n) => m.extra.date < n.extra.date ? 1 : -1).slice(0, 20)
})).sort((m, n) => m.extra.date < n.extra.date ? 1 : -1).slice(0, 30)
})

View File

@ -34,5 +34,5 @@ export default defineSource(async () => {
info: i.targetRow?.subTitle,
// date: new Date(i.dateline * 1000).getTime(),
},
})).slice(0, 20)
})).slice(0, 30)
})

View File

@ -35,7 +35,7 @@ export default defineSource(async () => {
})
if (!res?.data?.word_list || res.data.word_list.length === 0) throw new Error("Cannot fetch data")
return res.data.word_list
.slice(0, 20)
.slice(0, 30)
.map((k) => {
return {
id: k.sentence_id,

View File

@ -7,7 +7,7 @@ import zhihu from "./zhihu"
import cankaoxiaoxi from "./cankaoxiaoxi"
import coolapk from "./coolapk"
import sputniknewscn from "./sputniknewscn"
import kr from "./36kr"
import kr36 from "./36kr"
import wallstreetcn from "./wallstreetcn"
import douyin from "./douyin"
import toutiao from "./toutiao"
@ -24,5 +24,5 @@ export const sourcesFn = {
wallstreetcn,
douyin,
toutiao,
"36kr-quick": kr,
"36kr-quick": kr36,
} as Record<SourceID, () => Promise<NewsItem[]>>

View File

@ -28,5 +28,5 @@ export default defineSource(async () => {
}
})
return news.sort((m, n) => n.extra!.date > m.extra!.date ? 1 : -1)
.slice(0, 20)
.slice(0, 30)
})

View File

@ -24,5 +24,5 @@ export default defineSource(async () => {
})
}
})
return news.slice(0, 20)
return news.slice(0, 30)
})

View File

@ -14,7 +14,7 @@ export default defineSource(async () => {
const res: Res = await $fetch(url)
if (!res.data || res.data.length === 0) throw new Error("Cannot fetch data")
return res.data
.slice(0, 20)
.slice(0, 30)
.map((k) => {
return {
id: k.ClusterIdStr,

View File

@ -26,5 +26,5 @@ export default defineSource(async () => {
date: k.date_modified ?? k.date_published,
},
url: k.url,
})).sort((m, n) => m.extra.date < n.extra.date ? 1 : -1).slice(0, 20)
})).sort((m, n) => m.extra.date < n.extra.date ? 1 : -1).slice(0, 30)
})

View File

@ -19,7 +19,7 @@ export default defineSource(async () => {
const res: Res = await $fetch(apiUrl)
if (!res?.data?.items || res.data.items.length === 0) throw new Error("Cannot fetch data")
return res.data.items
.slice(0, 20)
.slice(0, 30)
.map((k) => {
return {
id: k.id,

View File

@ -30,7 +30,7 @@ export default defineSource(async () => {
if (!res.ok || res.data.realtime.length === 0) throw new Error("Cannot fetch data")
return res.data.realtime
.filter(k => !k.icon_desc || !/[荐促商宣]/.test(k.icon_desc))
.slice(0, 20)
.slice(0, 30)
.map((k) => {
const keyword = k.word_scheme ? k.word_scheme : `#${k.word}#`
return {

View File

@ -31,5 +31,5 @@ export default defineSource(async () => {
}
})
return news.sort((m, n) => n.extra!.date > m.extra!.date ? 1 : -1)
.slice(0, 20)
.slice(0, 30)
})

View File

@ -24,7 +24,7 @@ export default defineSource(async () => {
const res: Res = await $fetch(url)
if (!res.data || res.data.length === 0) throw new Error("Cannot fetch data")
return res.data
.slice(0, 20)
.slice(0, 30)
.map((k) => {
return {
id: k.target.id,

View File

@ -30,7 +30,7 @@ export function defineFallbackSource(id: SourceID, option?: SourceOption): () =>
const url = `https://smzdk.top/api/${id}/new`
const res: FallbackRes = await $fetch(url)
if (res.code !== 200 || !res.data) throw new Error(res.message)
return res.data.slice(0, 20).map(item => ({
return res.data.slice(0, 30).map(item => ({
extra: {
date: !option?.hiddenDate && item.time,
},
@ -46,7 +46,7 @@ export function defineRSSSource(url: string, option?: SourceOption): () => Promi
return async () => {
const data = await rss2json(url)
if (!data?.items.length) throw new Error("Cannot fetch data")
return data.items.slice(0, 20).map(item => ({
return data.items.slice(0, 30).map(item => ({
title: item.title,
url: item.link,
id: item.link,
@ -78,7 +78,7 @@ export function defineRSSHubSource(route: string, RSSHubOptions?: RSSHubOption,
url.searchParams.set(key, value.toString())
})
const data: RSSHubInfo = await $fetch(url)
return data.items.slice(0, 20).map(item => ({
return data.items.slice(0, 30).map(item => ({
title: item.title,
url: item.url,
id: item.id ?? item.url,

View File

@ -31,7 +31,7 @@ export const originSources = {
title: "快讯",
},
"sputniknewscn": {
name: "俄罗斯卫星通讯社",
name: "卫星通讯社",
color: "orange",
home: "https://sputniknews.cn",
},