mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
chore(server): increase number of news
This commit is contained in:
parent
78a289982b
commit
277d502d5c
@ -26,5 +26,5 @@ export default defineSource(async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return news.slice(0, 20)
|
return news.slice(0, 30)
|
||||||
})
|
})
|
||||||
|
@ -20,5 +20,5 @@ export default defineSource(async () => {
|
|||||||
date: tranformToUTC(k.data.publishTime),
|
date: tranformToUTC(k.data.publishTime),
|
||||||
},
|
},
|
||||||
url: k.data.url,
|
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)
|
||||||
})
|
})
|
||||||
|
@ -34,5 +34,5 @@ export default defineSource(async () => {
|
|||||||
info: i.targetRow?.subTitle,
|
info: i.targetRow?.subTitle,
|
||||||
// date: new Date(i.dateline * 1000).getTime(),
|
// date: new Date(i.dateline * 1000).getTime(),
|
||||||
},
|
},
|
||||||
})).slice(0, 20)
|
})).slice(0, 30)
|
||||||
})
|
})
|
||||||
|
@ -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")
|
if (!res?.data?.word_list || res.data.word_list.length === 0) throw new Error("Cannot fetch data")
|
||||||
return res.data.word_list
|
return res.data.word_list
|
||||||
.slice(0, 20)
|
.slice(0, 30)
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
return {
|
return {
|
||||||
id: k.sentence_id,
|
id: k.sentence_id,
|
||||||
|
@ -7,7 +7,7 @@ import zhihu from "./zhihu"
|
|||||||
import cankaoxiaoxi from "./cankaoxiaoxi"
|
import cankaoxiaoxi from "./cankaoxiaoxi"
|
||||||
import coolapk from "./coolapk"
|
import coolapk from "./coolapk"
|
||||||
import sputniknewscn from "./sputniknewscn"
|
import sputniknewscn from "./sputniknewscn"
|
||||||
import kr from "./36kr"
|
import kr36 from "./36kr"
|
||||||
import wallstreetcn from "./wallstreetcn"
|
import wallstreetcn from "./wallstreetcn"
|
||||||
import douyin from "./douyin"
|
import douyin from "./douyin"
|
||||||
import toutiao from "./toutiao"
|
import toutiao from "./toutiao"
|
||||||
@ -24,5 +24,5 @@ export const sourcesFn = {
|
|||||||
wallstreetcn,
|
wallstreetcn,
|
||||||
douyin,
|
douyin,
|
||||||
toutiao,
|
toutiao,
|
||||||
"36kr-quick": kr,
|
"36kr-quick": kr36,
|
||||||
} as Record<SourceID, () => Promise<NewsItem[]>>
|
} as Record<SourceID, () => Promise<NewsItem[]>>
|
||||||
|
@ -28,5 +28,5 @@ export default defineSource(async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return news.sort((m, n) => n.extra!.date > m.extra!.date ? 1 : -1)
|
return news.sort((m, n) => n.extra!.date > m.extra!.date ? 1 : -1)
|
||||||
.slice(0, 20)
|
.slice(0, 30)
|
||||||
})
|
})
|
||||||
|
@ -24,5 +24,5 @@ export default defineSource(async () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return news.slice(0, 20)
|
return news.slice(0, 30)
|
||||||
})
|
})
|
||||||
|
@ -14,7 +14,7 @@ export default defineSource(async () => {
|
|||||||
const res: Res = await $fetch(url)
|
const res: Res = await $fetch(url)
|
||||||
if (!res.data || res.data.length === 0) throw new Error("Cannot fetch data")
|
if (!res.data || res.data.length === 0) throw new Error("Cannot fetch data")
|
||||||
return res.data
|
return res.data
|
||||||
.slice(0, 20)
|
.slice(0, 30)
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
return {
|
return {
|
||||||
id: k.ClusterIdStr,
|
id: k.ClusterIdStr,
|
||||||
|
@ -26,5 +26,5 @@ export default defineSource(async () => {
|
|||||||
date: k.date_modified ?? k.date_published,
|
date: k.date_modified ?? k.date_published,
|
||||||
},
|
},
|
||||||
url: k.url,
|
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)
|
||||||
})
|
})
|
||||||
|
@ -19,7 +19,7 @@ export default defineSource(async () => {
|
|||||||
const res: Res = await $fetch(apiUrl)
|
const res: Res = await $fetch(apiUrl)
|
||||||
if (!res?.data?.items || res.data.items.length === 0) throw new Error("Cannot fetch data")
|
if (!res?.data?.items || res.data.items.length === 0) throw new Error("Cannot fetch data")
|
||||||
return res.data.items
|
return res.data.items
|
||||||
.slice(0, 20)
|
.slice(0, 30)
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
return {
|
return {
|
||||||
id: k.id,
|
id: k.id,
|
||||||
|
@ -30,7 +30,7 @@ export default defineSource(async () => {
|
|||||||
if (!res.ok || res.data.realtime.length === 0) throw new Error("Cannot fetch data")
|
if (!res.ok || res.data.realtime.length === 0) throw new Error("Cannot fetch data")
|
||||||
return res.data.realtime
|
return res.data.realtime
|
||||||
.filter(k => !k.icon_desc || !/[荐促商宣]/.test(k.icon_desc))
|
.filter(k => !k.icon_desc || !/[荐促商宣]/.test(k.icon_desc))
|
||||||
.slice(0, 20)
|
.slice(0, 30)
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
const keyword = k.word_scheme ? k.word_scheme : `#${k.word}#`
|
const keyword = k.word_scheme ? k.word_scheme : `#${k.word}#`
|
||||||
return {
|
return {
|
||||||
|
@ -31,5 +31,5 @@ export default defineSource(async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
return news.sort((m, n) => n.extra!.date > m.extra!.date ? 1 : -1)
|
return news.sort((m, n) => n.extra!.date > m.extra!.date ? 1 : -1)
|
||||||
.slice(0, 20)
|
.slice(0, 30)
|
||||||
})
|
})
|
||||||
|
@ -24,7 +24,7 @@ export default defineSource(async () => {
|
|||||||
const res: Res = await $fetch(url)
|
const res: Res = await $fetch(url)
|
||||||
if (!res.data || res.data.length === 0) throw new Error("Cannot fetch data")
|
if (!res.data || res.data.length === 0) throw new Error("Cannot fetch data")
|
||||||
return res.data
|
return res.data
|
||||||
.slice(0, 20)
|
.slice(0, 30)
|
||||||
.map((k) => {
|
.map((k) => {
|
||||||
return {
|
return {
|
||||||
id: k.target.id,
|
id: k.target.id,
|
||||||
|
@ -30,7 +30,7 @@ export function defineFallbackSource(id: SourceID, option?: SourceOption): () =>
|
|||||||
const url = `https://smzdk.top/api/${id}/new`
|
const url = `https://smzdk.top/api/${id}/new`
|
||||||
const res: FallbackRes = await $fetch(url)
|
const res: FallbackRes = await $fetch(url)
|
||||||
if (res.code !== 200 || !res.data) throw new Error(res.message)
|
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: {
|
extra: {
|
||||||
date: !option?.hiddenDate && item.time,
|
date: !option?.hiddenDate && item.time,
|
||||||
},
|
},
|
||||||
@ -46,7 +46,7 @@ export function defineRSSSource(url: string, option?: SourceOption): () => Promi
|
|||||||
return async () => {
|
return async () => {
|
||||||
const data = await rss2json(url)
|
const data = await rss2json(url)
|
||||||
if (!data?.items.length) throw new Error("Cannot fetch data")
|
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,
|
title: item.title,
|
||||||
url: item.link,
|
url: item.link,
|
||||||
id: item.link,
|
id: item.link,
|
||||||
@ -78,7 +78,7 @@ export function defineRSSHubSource(route: string, RSSHubOptions?: RSSHubOption,
|
|||||||
url.searchParams.set(key, value.toString())
|
url.searchParams.set(key, value.toString())
|
||||||
})
|
})
|
||||||
const data: RSSHubInfo = await $fetch(url)
|
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,
|
title: item.title,
|
||||||
url: item.url,
|
url: item.url,
|
||||||
id: item.id ?? item.url,
|
id: item.id ?? item.url,
|
||||||
|
@ -31,7 +31,7 @@ export const originSources = {
|
|||||||
title: "快讯",
|
title: "快讯",
|
||||||
},
|
},
|
||||||
"sputniknewscn": {
|
"sputniknewscn": {
|
||||||
name: "俄罗斯卫星通讯社",
|
name: "卫星通讯社",
|
||||||
color: "orange",
|
color: "orange",
|
||||||
home: "https://sputniknews.cn",
|
home: "https://sputniknews.cn",
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user