mobile search pog

This commit is contained in:
Ashley 2022-11-03 18:44:29 +01:00
parent fd8c8d2591
commit 35af3566c4

View file

@ -609,12 +609,35 @@ app.get("/", async function (req, res) {
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", {
k: k,
tab: req.query.tab,
isMobile: req.useragent.isMobile,
mobilesearch:req.query.mobilesearch,
inv: t,
turntomins,
continuation,
j
});
});