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) => {
|
.map(async (_, i) => {
|
||||||
return (
|
return (
|
||||||
await searchSearxng(
|
await searchSearxng(
|
||||||
`site:${articleWebsites[i % articleWebsites.length]} ${
|
`site:${articleWebsites[i % articleWebsites.length]} ${topics[i % topics.length]
|
||||||
topics[i % topics.length]
|
|
||||||
}`,
|
}`,
|
||||||
{
|
{
|
||||||
engines: ['bing news'],
|
categories: ['news'],
|
||||||
|
time_range: ['month'],
|
||||||
pageno: 1,
|
pageno: 1,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
@ -49,7 +49,7 @@ export const GET = async (req: Request) => {
|
||||||
data = (
|
data = (
|
||||||
await searchSearxng(
|
await searchSearxng(
|
||||||
`site:${articleWebsites[Math.floor(Math.random() * articleWebsites.length)]} ${topics[Math.floor(Math.random() * topics.length)]}`,
|
`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;
|
).results;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ interface SearxngSearchOptions {
|
||||||
engines?: string[];
|
engines?: string[];
|
||||||
language?: string;
|
language?: string;
|
||||||
pageno?: number;
|
pageno?: number;
|
||||||
|
time_range?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface SearxngSearchResult {
|
interface SearxngSearchResult {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue