From cdf958d29333d448f4521f4d2faa2592b58e9b27 Mon Sep 17 00:00:00 2001 From: lolcat Date: Sun, 10 Aug 2025 21:55:15 -0400 Subject: fix wikipedia crash --- images.php | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 images.php (limited to 'images.php') diff --git a/images.php b/images.php new file mode 100644 index 0000000..99fc9d6 --- /dev/null +++ b/images.php @@ -0,0 +1,77 @@ +getscraperfilters("images"); + +$get = $frontend->parsegetfilters($_GET, $filters); + +/* + Captcha +*/ +include "lib/bot_protection.php"; +new bot_protection($frontend, $get, $filters, "images", true); + +$payload = [ + "timetaken" => microtime(true), + "images" => "", + "nextpage" => "" +]; + +try{ + $results = $scraper->image($get); + +}catch(Exception $error){ + + $frontend->drawscrapererror($error->getMessage(), $get, "images", $payload["timetaken"]); +} + +if(count($results["image"]) === 0){ + + $payload["images"] = + '
' . + "

Nobody here but us chickens!

" . + 'Have you tried:' . + '' . + '
'; +} + +foreach($results["image"] as $image){ + + $payload["images"] .= + '
' . + '' . + '
'; +} + +if($results["npt"] !== null){ + + $payload["nextpage"] = + 'Next page >'; +} + +echo $frontend->load("images.html", $payload); -- cgit v1.2.3