mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-22 06:37:58 +01:00
test this
This commit is contained in:
parent
57777182c0
commit
13a37b7b69
1 changed files with 8 additions and 5 deletions
|
@ -176,10 +176,13 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
|
|
||||||
const { fetch } = await import("undici");
|
const { fetch } = await import("undici");
|
||||||
|
|
||||||
const search = await fetch(
|
let allResults = [];
|
||||||
`https://search.zeroish.xyz/api.php?q=${query}&p=1&t=0`
|
|
||||||
);
|
for (let page = 1; page <= 3; page++) {
|
||||||
const web = getJson(await search.text());
|
const search = await fetch(`https://search.zeroish.xyz/api.php?q=${query}&p=${page}&t=0`);
|
||||||
|
const results = await search.json();
|
||||||
|
allResults = allResults.concat(results);
|
||||||
|
}
|
||||||
|
|
||||||
if (req.query.lucky === "true") {
|
if (req.query.lucky === "true") {
|
||||||
res.redirect("/im-feeling-lucky?query=" + query);
|
res.redirect("/im-feeling-lucky?query=" + query);
|
||||||
|
@ -218,7 +221,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
let continuation = req.query.continuation || "";
|
let continuation = req.query.continuation || "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const results = web;
|
const results = allResults;
|
||||||
|
|
||||||
renderTemplate(res, req, "search-web.ejs", {
|
renderTemplate(res, req, "search-web.ejs", {
|
||||||
j: "",
|
j: "",
|
||||||
|
|
Loading…
Reference in a new issue