feat(discover): update searxng query options to include categories and time range
This commit is contained in:
parent
0b7989c3d3
commit
740372c59b
2 changed files with 5 additions and 4 deletions
|
|
@ -30,11 +30,11 @@ export const GET = async (req: Request) => {
|
|||
.map(async (_, i) => {
|
||||
return (
|
||||
await searchSearxng(
|
||||
`site:${articleWebsites[i % articleWebsites.length]} ${
|
||||
topics[i % topics.length]
|
||||
`site:${articleWebsites[i % articleWebsites.length]} ${topics[i % topics.length]
|
||||
}`,
|
||||
{
|
||||
engines: ['bing news'],
|
||||
categories: ['news'],
|
||||
time_range: ['month'],
|
||||
pageno: 1,
|
||||
},
|
||||
)
|
||||
|
|
@ -49,7 +49,7 @@ export const GET = async (req: Request) => {
|
|||
data = (
|
||||
await searchSearxng(
|
||||
`site:${articleWebsites[Math.floor(Math.random() * articleWebsites.length)]} ${topics[Math.floor(Math.random() * topics.length)]}`,
|
||||
{ engines: ['bing news'], pageno: 1 },
|
||||
{ categories: ['news'], time_range: ['month'], pageno: 1 },
|
||||
)
|
||||
).results;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ interface SearxngSearchOptions {
|
|||
engines?: string[];
|
||||
language?: string;
|
||||
pageno?: number;
|
||||
time_range?: string[];
|
||||
}
|
||||
|
||||
interface SearxngSearchResult {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue