|
@@ -1,4 +1,4 @@ discard block |
|
|
block discarded – undo |
|
1
|
|
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
|
1
|
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2
|
2
|
|
|
3
|
3
|
class Tracker_Sites_Model extends CI_Model { |
|
4
|
4
|
public function __construct() { |
|
@@ -56,7 +56,7 @@ discard block |
|
|
block discarded – undo |
|
56
|
56
|
final protected function get_content(string $url, string $cookie_string = "", string $cookiejar_path = "", bool $follow_redirect = FALSE, bool $isPost = FALSE, array $postFields = []) { |
|
57
|
57
|
$ch = curl_init(); |
|
58
|
58
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
59
|
|
- curl_setopt($ch, CURLOPT_ENCODING , "gzip"); |
|
|
59
|
+ curl_setopt($ch, CURLOPT_ENCODING, "gzip"); |
|
60
|
60
|
//curl_setopt($ch, CURLOPT_VERBOSE, 1); |
|
61
|
61
|
curl_setopt($ch, CURLOPT_HEADER, 1); |
|
62
|
62
|
|
|
@@ -74,8 +74,8 @@ discard block |
|
|
block discarded – undo |
|
74
|
74
|
curl_setopt($ch, CURLOPT_URL, $url); |
|
75
|
75
|
|
|
76
|
76
|
if($isPost) { |
|
77
|
|
- curl_setopt($ch,CURLOPT_POST, count($postFields)); |
|
78
|
|
- curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($postFields)); |
|
|
77
|
+ curl_setopt($ch, CURLOPT_POST, count($postFields)); |
|
|
78
|
+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields)); |
|
79
|
79
|
} |
|
80
|
80
|
|
|
81
|
81
|
$response = curl_exec($ch); |
|
@@ -131,7 +131,7 @@ discard block |
|
|
block discarded – undo |
|
131
|
131
|
|
|
132
|
132
|
$dom = new DOMDocument(); |
|
133
|
133
|
libxml_use_internal_errors(TRUE); |
|
134
|
|
- $dom->loadHTML('<?xml encoding="utf-8" ?>' . $data); |
|
|
134
|
+ $dom->loadHTML('<?xml encoding="utf-8" ?>'.$data); |
|
135
|
135
|
libxml_use_internal_errors(FALSE); |
|
136
|
136
|
|
|
137
|
137
|
$xpath = new DOMXPath($dom); |
|
@@ -139,7 +139,7 @@ discard block |
|
|
block discarded – undo |
|
139
|
139
|
$nodes_row = $xpath->query($node_row_string); |
|
140
|
140
|
if($nodes_title->length === 1 && $nodes_row->length === 1) { |
|
141
|
141
|
$firstRow = $nodes_row->item(0); |
|
142
|
|
- $nodes_latest = $xpath->query($node_latest_string, $firstRow); |
|
|
142
|
+ $nodes_latest = $xpath->query($node_latest_string, $firstRow); |
|
143
|
143
|
|
|
144
|
144
|
if($node_chapter_string !== '') { |
|
145
|
145
|
$nodes_chapter = $xpath->query($node_chapter_string, $firstRow); |