summaryrefslogtreecommitdiff
path: root/scraper/startpage.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2024-07-14 23:45:24 -0400
committerlolcat <will@lolcat.ca>2024-07-14 23:45:24 -0400
commit029af216d48c56ad310f4ba82ac0ed2fb57d5e32 (patch)
tree756733bb6dcc8a8ab1770144effdefb6fc24c730 /scraper/startpage.php
parent2a1655af9ae7ab6f0a40618914a6346a3c694cbf (diff)
fixed instant answer not showing up
Diffstat (limited to 'scraper/startpage.php')
-rw-r--r--scraper/startpage.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/scraper/startpage.php b/scraper/startpage.php
index 5a10aee..fe63dfd 100644
--- a/scraper/startpage.php
+++ b/scraper/startpage.php
@@ -228,7 +228,7 @@ class startpage{
throw new Exception("Failed to fetch search page");
}
- $is_first_page = false;
+ $get_instant_answer = false;
}else{
@@ -237,10 +237,18 @@ class startpage{
$params = [
"query" => $get["s"],
"cat" => "web",
- "pl" => "opensearch",
- "qadf" => $get["nsfw"] == "yes" ? "none" : "heavy"
+ "pl" => "opensearch"
];
+ if($get["nsfw"] == "no"){
+
+ $params["qadf"] = "heavy";
+ $get_instant_answer = false;
+ }else{
+
+ $get_instant_answer = true;
+ }
+
if($get["country"] !== "any"){
$params["qsr"] = $get["country"];
@@ -263,8 +271,6 @@ class startpage{
}
//$html = file_get_contents("scraper/startpage.html");
-
- $is_first_page = true;
}
if(
@@ -456,7 +462,7 @@ class startpage{
// parse instant answers
if(
$get["extendedsearch"] == "yes" &&
- $is_first_page === true
+ $get_instant_answer === true
){
// https://www.startpage.com/sp/qi?qimsn=ex&sxap=%2Fv1%2Fquery&sc=BqZ3inqrAgF701&sr=1