mirror of
https://git.lolcat.ca/lolcat/4get.git
synced 2024-11-14 03:49:48 +01:00
fixed instant answer not showing up
This commit is contained in:
parent
2a1655af9a
commit
029af216d4
|
@ -228,7 +228,7 @@ class startpage{
|
||||||
throw new Exception("Failed to fetch search page");
|
throw new Exception("Failed to fetch search page");
|
||||||
}
|
}
|
||||||
|
|
||||||
$is_first_page = false;
|
$get_instant_answer = false;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
|
@ -237,10 +237,18 @@ class startpage{
|
||||||
$params = [
|
$params = [
|
||||||
"query" => $get["s"],
|
"query" => $get["s"],
|
||||||
"cat" => "web",
|
"cat" => "web",
|
||||||
"pl" => "opensearch",
|
"pl" => "opensearch"
|
||||||
"qadf" => $get["nsfw"] == "yes" ? "none" : "heavy"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if($get["nsfw"] == "no"){
|
||||||
|
|
||||||
|
$params["qadf"] = "heavy";
|
||||||
|
$get_instant_answer = false;
|
||||||
|
}else{
|
||||||
|
|
||||||
|
$get_instant_answer = true;
|
||||||
|
}
|
||||||
|
|
||||||
if($get["country"] !== "any"){
|
if($get["country"] !== "any"){
|
||||||
|
|
||||||
$params["qsr"] = $get["country"];
|
$params["qsr"] = $get["country"];
|
||||||
|
@ -263,8 +271,6 @@ class startpage{
|
||||||
}
|
}
|
||||||
|
|
||||||
//$html = file_get_contents("scraper/startpage.html");
|
//$html = file_get_contents("scraper/startpage.html");
|
||||||
|
|
||||||
$is_first_page = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(
|
if(
|
||||||
|
@ -456,7 +462,7 @@ class startpage{
|
||||||
// parse instant answers
|
// parse instant answers
|
||||||
if(
|
if(
|
||||||
$get["extendedsearch"] == "yes" &&
|
$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
|
// https://www.startpage.com/sp/qi?qimsn=ex&sxap=%2Fv1%2Fquery&sc=BqZ3inqrAgF701&sr=1
|
||||||
|
|
Loading…
Reference in a new issue