mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 12:58:25 +01:00
continuations!!!
This commit is contained in:
parent
5712a5be07
commit
018472e4b4
1 changed files with 11 additions and 11 deletions
20
server.js
20
server.js
|
@ -460,17 +460,10 @@ app.get("/search", async (req, res) => {
|
||||||
const { toJson } = require("xml2json");
|
const { toJson } = require("xml2json");
|
||||||
const query = req.query.query;
|
const query = req.query.query;
|
||||||
|
|
||||||
if(req.query.continuation){
|
if(req.query.continuation){ var continuation = req.query.continuation }
|
||||||
var continuation = req.query.continuation
|
if(!req.query.continuation){ var continuation = "" }
|
||||||
}
|
|
||||||
|
|
||||||
if(!req.query.continuation){
|
const search = await fetch(`https://tube.kuylar.dev/api/search?query=${query}&continuation=${continuation}`);
|
||||||
var continuation = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
const search = await fetch(
|
|
||||||
`https://tube.kuylar.dev/api/search?query=${query}&continuation=${continuation}`
|
|
||||||
);
|
|
||||||
|
|
||||||
const text = await search.text();
|
const text = await search.text();
|
||||||
const j = JSON.parse(toJson(text));
|
const j = JSON.parse(toJson(text));
|
||||||
|
@ -499,6 +492,12 @@ app.get("/channel/", async (req, res) => {
|
||||||
const c = await channel.text();
|
const c = await channel.text();
|
||||||
const tj = JSON.parse(toJson(c));
|
const tj = JSON.parse(toJson(c));
|
||||||
|
|
||||||
|
|
||||||
|
if(req.query.continuation){ var continuation = req.query.continuation }
|
||||||
|
if(!req.query.continuation){ var continuation = "" }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const summary = await wiki.summary(k.Channel.Metadata.Name);
|
const summary = await wiki.summary(k.Channel.Metadata.Name);
|
||||||
|
|
||||||
var w = "";
|
var w = "";
|
||||||
|
@ -522,6 +521,7 @@ app.get("/channel/", async (req, res) => {
|
||||||
tab: tab,
|
tab: tab,
|
||||||
j: k,
|
j: k,
|
||||||
tj: tj,
|
tj: tj,
|
||||||
|
continuation:continuation,
|
||||||
wiki: w,
|
wiki: w,
|
||||||
getFirstLine:getFirstLine,
|
getFirstLine:getFirstLine,
|
||||||
isMobile: req.useragent.isMobile,
|
isMobile: req.useragent.isMobile,
|
||||||
|
|
Loading…
Reference in a new issue