summaryrefslogtreecommitdiff
path: root/scraper/brave.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2023-11-27 01:01:56 -0500
committerlolcat <will@lolcat.ca>2023-11-27 01:01:56 -0500
commit2519666e1c831f85836f9ce6d975d3ceb975c09d (patch)
tree86c68604aff9c7a0a430e70ef082195a4c3a717f /scraper/brave.php
parent9fd993b47b8c1b6e3c9d9f0e8d43a85860230f59 (diff)
google web, videos and news, various other fixes
Diffstat (limited to 'scraper/brave.php')
-rw-r--r--scraper/brave.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/scraper/brave.php b/scraper/brave.php
index bd1cd80..8be55ac 100644
--- a/scraper/brave.php
+++ b/scraper/brave.php
@@ -857,7 +857,9 @@ class brave{
// parse ratings
if(
isset($info["ratings"]) &&
- $info["ratings"] != "void 0"
+ $info["ratings"] != "void 0" &&
+ is_array($info["ratings"]) &&
+ count($info["ratings"]) !== 0
){
$description[] = [
@@ -1183,7 +1185,7 @@ class brave{
"title" => $news["title"],
"author" => null,
"description" => $news["description"],
- "date" => !isset($news["age"]) || $news["age"] == "void 0" ? null : strtotime($news["age"]),
+ "date" => !isset($news["age"]) || $news["age"] == "void 0" || $news["age"] == "null" ? null : strtotime($news["age"]),
"thumb" => $thumb,
"url" => $news["url"]
];