@@ -68,15 +68,15 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | |
| 70 | 70 | $ch = $this->init; |
| 71 | - curl_setopt_array($ch, ($this->options() + $this->options)); |
|
| 72 | - if (!$this->content = curl_exec($ch)){ |
|
| 73 | - throw new \Exception( |
|
| 74 | - 'CURL ERROR! Code: ' . curl_errno($ch) . |
|
| 75 | - ' Message: ' . curl_error($ch) |
|
| 76 | - ); |
|
| 77 | - } |
|
| 78 | - $this->header = curl_getinfo($ch); |
|
| 79 | - curl_close($ch); |
|
| 71 | + curl_setopt_array($ch, ($this->options() + $this->options)); |
|
| 72 | + if (!$this->content = curl_exec($ch)){ |
|
| 73 | + throw new \Exception( |
|
| 74 | + 'CURL ERROR! Code: ' . curl_errno($ch) . |
|
| 75 | + ' Message: ' . curl_error($ch) |
|
| 76 | + ); |
|
| 77 | + } |
|
| 78 | + $this->header = curl_getinfo($ch); |
|
| 79 | + curl_close($ch); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | 'headers', $this->connection['headers'], |
| 91 | 91 | 'header', $this->connection['header'], |
| 92 | 92 | 'content', $this->connection['content'], |
| 93 | - ]; |
|
| 93 | + ]; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | return [ |
| 104 | 104 | CURLOPT_RETURNTRANSFER => true, |
| 105 | 105 | CURLOPT_FOLLOWLOCATION => true, |
| 106 | - CURLOPT_ENCODING => '', |
|
| 107 | - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, |
|
| 108 | - ]; |
|
| 106 | + CURLOPT_ENCODING => '', |
|
| 107 | + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, |
|
| 108 | + ]; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | //Grab url id in case $url is not valid as required url |
| 119 | 119 | $id = $url; |
| 120 | 120 | if (strpos($url, 'product') !== false) { |
| 121 | - $id = explode('product',$url); |
|
| 122 | - $id = end($id); |
|
| 123 | - $id = explode('/', $id)[1]; |
|
| 121 | + $id = explode('product',$url); |
|
| 122 | + $id = end($id); |
|
| 123 | + $id = explode('/', $id)[1]; |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | //Set the $id as required url |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | public function username() |
| 100 | 100 | { |
| 101 | 101 | return $this->find('//meta[@name="author"]') |
| 102 | - ->item(0) |
|
| 103 | - ->getAttribute('content'); |
|
| 102 | + ->item(0) |
|
| 103 | + ->getAttribute('content'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | public function userID() |
| 112 | 112 | { |
| 113 | 113 | $query = $this->find( |
| 114 | - '//div[contains(@class,"seller-detail-info")]' . |
|
| 115 | - '/span[contains(@class,"username")]/a' |
|
| 114 | + '//div[contains(@class,"seller-detail-info")]' . |
|
| 115 | + '/span[contains(@class,"username")]/a' |
|
| 116 | 116 | )->item(0) |
| 117 | 117 | ->getAttribute('href'); |
| 118 | 118 | $query = explode('/', $query); |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | public function feedbackPercent() |
| 173 | 173 | { |
| 174 | 174 | $query = $this->find( |
| 175 | - '//div[contains(@class,"seller-detail-info")]' . |
|
| 176 | - '/span[contains(@class,"feedback")]' |
|
| 175 | + '//div[contains(@class,"seller-detail-info")]' . |
|
| 176 | + '/span[contains(@class,"feedback")]' |
|
| 177 | 177 | )->item(0) |
| 178 | 178 | ->getElementsByTagName('strong') |
| 179 | 179 | ->item(0) |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | public function joinDate() |
| 191 | 191 | { |
| 192 | 192 | $query = $this->find( |
| 193 | - '//div[contains(@class,"seller-detail-info")]' . |
|
| 194 | - '/span[not(@class)]' |
|
| 193 | + '//div[contains(@class,"seller-detail-info")]' . |
|
| 194 | + '/span[not(@class)]' |
|
| 195 | 195 | )->item(0) |
| 196 | 196 | ->nodeValue; |
| 197 | 197 | $query = str_replace('join: ', '', strtolower($query)); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | public function threadPublished() |
| 223 | 223 | { |
| 224 | 224 | $query = $this->find( |
| 225 | - '//div[contains(@class,"user-details")]/time' |
|
| 225 | + '//div[contains(@class,"user-details")]/time' |
|
| 226 | 226 | )->item(0) |
| 227 | 227 | ->getAttribute('datetime'); |
| 228 | 228 | $date = new \DateTime($query); |
@@ -260,10 +260,10 @@ discard block |
||
| 260 | 260 | $product['bump'] = trim($content); |
| 261 | 261 | if (strpos(trim($content), 'ago') !== false) { |
| 262 | 262 | $bumpTime = explode(' ', trim($content)); |
| 263 | - $date = new \DateTime; |
|
| 264 | - $date->modify('- '.$bumpTime[0] . ' '. $bumpTime[1]); |
|
| 263 | + $date = new \DateTime; |
|
| 264 | + $date->modify('- '.$bumpTime[0] . ' '. $bumpTime[1]); |
|
| 265 | 265 | |
| 266 | - $this->bump = $date->format('Y-m-d H:i:s'); |
|
| 266 | + $this->bump = $date->format('Y-m-d H:i:s'); |
|
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
@@ -273,6 +273,6 @@ discard block |
||
| 273 | 273 | 'sold' => $this->sold, |
| 274 | 274 | 'cod' => $this->cod, |
| 275 | 275 | 'bump' => $this->bump, |
| 276 | - ]; |
|
| 276 | + ]; |
|
| 277 | 277 | } |
| 278 | 278 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | 3 => 5, |
| 45 | 45 | 1 => 8, |
| 46 | 46 | 0 => 10, |
| 47 | - ]; |
|
| 47 | + ]; |
|
| 48 | 48 | /** |
| 49 | 49 | * @var string $imageCount |
| 50 | 50 | */ |