mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-01 10:07:24 +01:00
mobile search pog
This commit is contained in:
parent
af5c225976
commit
148175c18d
1 changed files with 23 additions and 0 deletions
23
server.js
23
server.js
|
@ -609,12 +609,35 @@ app.get("/", async function (req, res) {
|
||||||
|
|
||||||
const t = JSON.parse(invtrend);
|
const t = JSON.parse(invtrend);
|
||||||
|
|
||||||
|
if(req.query.mobilesearch) {
|
||||||
|
var query = req.query.mobilesearch;
|
||||||
|
tab = "search"
|
||||||
|
if (req.query.continuation) {
|
||||||
|
var continuation = req.query.continuation;
|
||||||
|
}
|
||||||
|
if (!req.query.continuation) {
|
||||||
|
var continuation = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
const search = await modules.fetch(
|
||||||
|
`https://tube.kuylar.dev/api/search?query=${query}&continuation=${continuation}`
|
||||||
|
);
|
||||||
|
|
||||||
|
const text = await search.text();
|
||||||
|
var j = JSON.parse(modules.toJson(text));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
renderTemplate(res, req, "main.ejs", {
|
renderTemplate(res, req, "main.ejs", {
|
||||||
k: k,
|
k: k,
|
||||||
tab: req.query.tab,
|
tab: req.query.tab,
|
||||||
isMobile: req.useragent.isMobile,
|
isMobile: req.useragent.isMobile,
|
||||||
|
mobilesearch:req.query.mobilesearch,
|
||||||
inv: t,
|
inv: t,
|
||||||
turntomins,
|
turntomins,
|
||||||
|
continuation,
|
||||||
|
j
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue