1
Fork 1
mirror of https://git.lolcat.ca/lolcat/4get.git synced 2024-11-08 17:43:07 -05:00

fixed google piece of shit website i hate it so much

This commit is contained in:
lolcat 2024-08-02 21:25:39 -04:00
parent beb08f46e2
commit 36993013e5

View file

@ -799,6 +799,41 @@ class google{
$title = "Notice"; $title = "Notice";
} }
$div =
$this->fuckhtml
->getElementsByTagName(
"div"
);
// probe for related searches div, if found, ignore it cause its shit
$probe =
$this->fuckhtml
->getElementsByAttributeValue(
"role",
"list",
$div
);
// also probe for children
if(count($probe) === 0){
$probe =
$this->fuckhtml
->getElementsByClassName(
$this->getstyle(
[
"flex-shrink" => "0",
"-moz-box-flex" => "0",
"flex-grow" => "0",
"overflow" => "hidden"
]
),
$div
);
}
if(count($probe) === 0){
$description = []; $description = [];
$as = $as =
@ -892,23 +927,6 @@ class google{
) )
]; ];
} }
}else{
// @TODO: Check if this ever gets populated without giving me garbage
/*
$text =
$this->fuckhtml
->getTextContent(
$card
);
if($text != ""){
$description[] = [
"type" => "text",
"value" => $text
];
}*/
} }
if(count($description) !== 0){ if(count($description) !== 0){
@ -923,6 +941,7 @@ class google{
]; ];
} }
} }
}
// reset // reset
$this->fuckhtml->load($html); $this->fuckhtml->load($html);
@ -2451,6 +2470,7 @@ class google{
$this->getstyle( $this->getstyle(
[ [
"outline-offset" => "-1px", "outline-offset" => "-1px",
"outline-width" => "1px",
"display" => "flex", "display" => "flex",
"flex-direction" => "column", "flex-direction" => "column",
"flex-grow" => "1" "flex-grow" => "1"