|
@@ -295,6 +295,7 @@ class brave{
|
|
|
$html = fread($handle, filesize("scraper/brave.html"));
|
|
$html = fread($handle, filesize("scraper/brave.html"));
|
|
|
fclose($handle);
|
|
fclose($handle);
|
|
|
*/
|
|
*/
|
|
|
|
|
+
|
|
|
try{
|
|
try{
|
|
|
$html =
|
|
$html =
|
|
|
$this->get(
|
|
$this->get(
|
|
@@ -406,9 +407,9 @@ class brave{
|
|
|
|
|
|
|
|
if(!isset($grep[1])){
|
|
if(!isset($grep[1])){
|
|
|
|
|
|
|
|
- throw new Exception("Could not get data JS");
|
|
|
|
|
|
|
+ throw new Exception("Could not grep JavaScript object");
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$data =
|
|
$data =
|
|
|
$this->fuckhtml
|
|
$this->fuckhtml
|
|
|
->parseJsObject(
|
|
->parseJsObject(
|
|
@@ -416,6 +417,11 @@ class brave{
|
|
|
);
|
|
);
|
|
|
unset($grep);
|
|
unset($grep);
|
|
|
|
|
|
|
|
|
|
+ if($data === null){
|
|
|
|
|
+
|
|
|
|
|
+ throw new Exception("Failed to decode JavaScript object");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$data = $data[1]["data"]["body"]["response"];
|
|
$data = $data[1]["data"]["body"]["response"];
|
|
|
|
|
|
|
|
/*
|
|
/*
|