From 53b31c6ea98363871c7c6bdb8e662ad825e3f47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Fri, 2 Feb 2024 12:49:38 +0100 Subject: poprbot --- prog/sear.php/index.php | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) (limited to 'prog/sear.php/index.php') diff --git a/prog/sear.php/index.php b/prog/sear.php/index.php index 4324fba..1f90c9c 100644 --- a/prog/sear.php/index.php +++ b/prog/sear.php/index.php @@ -93,11 +93,14 @@ function query_google ($s, $image = false, $noredirect = false, $bindstring = fa $breadcrumbs = $span->nodeValue; } $table = $a->parentNode->parentNode->getElementsByTagName("table")[0]; - $description = "nisem uspel izluščiti opisa."; + $description = false; if ($table) foreach ($table->getElementsByTagName("span") as $span) if ($span->getAttribute("class") == $descclass) - $description = $span->nodeValue; + if (!$description) + $description = $span->nodeValue; + if (!$description) + $description = "ni mi uspelo izluščiti opisa"; $results[] = ["url" => $hreflink, "title" => $firstspan->nodeValue, "breadcrumbs" => $breadcrumbs, "description" => $description]; } $suggested = []; @@ -113,7 +116,7 @@ function query_google ($s, $image = false, $noredirect = false, $bindstring = fa $suggestion = $suggested[0]; return ["status" => true, "query" => $s, "suggestion" => $suggestion, "results" => $results, "url" => $url]; } -function template ($title, $queryinfo, $body, $query = "", $additionalform = "", $imgfirst = false) { +function template ($title, $queryinfo, $body, $query = "", $additionalform = "", $imgfirst = false, $add_footer = "") { $query = htmlspecialchars($query); $title = htmlspecialchars($title); $buttons = " @@ -151,9 +154,10 @@ function template ($title, $queryinfo, $body, $query = "", $additionalform = "", $body

- sear.php - + sear.php +

+ $add_footer