@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | class Helper |
9 | 9 | { |
10 | - /** |
|
10 | + /** |
|
11 | 11 | * Convert return result into easy-to-read result. |
12 | 12 | * |
13 | 13 | * @param string|array $response |
@@ -85,138 +85,138 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return string |
87 | 87 | */ |
88 | - public static function getTopAnimeType($type) |
|
89 | - { |
|
90 | - $converted_type = ''; |
|
91 | - switch ($type) { |
|
92 | - case '0': |
|
93 | - $converted_type = ''; |
|
94 | - break; |
|
95 | - case '1': |
|
96 | - $converted_type = 'airing'; |
|
97 | - break; |
|
98 | - case '2': |
|
99 | - $converted_type = 'upcoming'; |
|
100 | - break; |
|
101 | - case '3': |
|
102 | - $converted_type = 'tv'; |
|
103 | - break; |
|
104 | - case '4': |
|
105 | - $converted_type = 'movie'; |
|
106 | - break; |
|
107 | - case '5': |
|
108 | - $converted_type = 'ova'; |
|
109 | - break; |
|
110 | - case '6': |
|
111 | - $converted_type = 'special'; |
|
112 | - break; |
|
113 | - case '7': |
|
114 | - $converted_type = 'bypopularity'; |
|
115 | - break; |
|
116 | - case '8': |
|
117 | - $converted_type = 'favorite'; |
|
118 | - break; |
|
119 | - default: |
|
120 | - $converted_type = ''; |
|
121 | - } |
|
122 | - |
|
123 | - return $converted_type; |
|
124 | - } |
|
125 | - |
|
126 | - /** |
|
127 | - * Get top manga code. |
|
128 | - * |
|
129 | - * @param string|int $type |
|
130 | - * |
|
131 | - * @return string |
|
132 | - */ |
|
133 | - public static function getTopMangaType($type) |
|
134 | - { |
|
135 | - $converted_type = ''; |
|
136 | - switch ($type) { |
|
137 | - case '0': |
|
138 | - $converted_type = ''; |
|
139 | - break; |
|
140 | - case '1': |
|
141 | - $converted_type = 'manga'; |
|
142 | - break; |
|
143 | - case '2': |
|
144 | - $converted_type = 'novels'; |
|
145 | - break; |
|
146 | - case '3': |
|
147 | - $converted_type = 'oneshots'; |
|
148 | - break; |
|
149 | - case '4': |
|
150 | - $converted_type = 'doujin'; |
|
151 | - break; |
|
152 | - case '5': |
|
153 | - $converted_type = 'manhwa'; |
|
154 | - break; |
|
155 | - case '6': |
|
156 | - $converted_type = 'manhua'; |
|
157 | - break; |
|
158 | - case '7': |
|
159 | - $converted_type = 'bypopularity'; |
|
160 | - break; |
|
161 | - case '8': |
|
162 | - $converted_type = 'favorite'; |
|
163 | - break; |
|
164 | - default: |
|
165 | - $converted_type = ''; |
|
166 | - } |
|
167 | - |
|
168 | - return $converted_type; |
|
169 | - } |
|
170 | - |
|
171 | - /** |
|
172 | - * Get current season. |
|
173 | - * |
|
174 | - * @return string |
|
175 | - */ |
|
176 | - public static function getCurrentSeason() |
|
177 | - { |
|
178 | - $day = new DateTime(); |
|
179 | - |
|
180 | - // Days of spring |
|
181 | - $spring_starts = new DateTime('April 1'); |
|
182 | - $spring_ends = new DateTime('June 30'); |
|
183 | - |
|
184 | - // Days of summer |
|
185 | - $summer_starts = new DateTime('July 1'); |
|
186 | - $summer_ends = new DateTime('September 30'); |
|
187 | - |
|
188 | - // Days of autumn |
|
189 | - $autumn_starts = new DateTime('October 1'); |
|
190 | - $autumn_ends = new DateTime('December 31'); |
|
191 | - |
|
192 | - // If $day is between the days of spring, summer, autumn, and winter |
|
193 | - if ($day >= $spring_starts && $day <= $spring_ends) : |
|
194 | - $season = 'spring'; elseif ($day >= $summer_starts && $day <= $summer_ends) : |
|
195 | - $season = 'summer'; elseif ($day >= $autumn_starts && $day <= $autumn_ends) : |
|
196 | - $season = 'fall'; else : |
|
197 | - $season = 'winter'; |
|
198 | - endif; |
|
199 | - |
|
200 | - return $season; |
|
201 | - } |
|
202 | - |
|
203 | - /** |
|
204 | - * Clean image URL. |
|
205 | - * |
|
206 | - * @param string $str |
|
207 | - * |
|
208 | - * @return string |
|
209 | - */ |
|
210 | - public static function imageUrlCleaner($str) |
|
211 | - { |
|
212 | - preg_match('/(questionmark)|(qm_50)/', $str, $temp_image); |
|
213 | - $str = $temp_image ? '' : $str; |
|
214 | - $str = str_replace('v.jpg', '.jpg', $str); |
|
215 | - $str = str_replace('_thumb.jpg', '.jpg', $str); |
|
216 | - $str = str_replace('userimages/thumbs', 'userimages', $str); |
|
217 | - $str = preg_replace('/r\/\d{1,3}x\d{1,3}\//', '', $str); |
|
218 | - $str = preg_replace('/\?.+/', '', $str); |
|
219 | - |
|
220 | - return $str; |
|
221 | - } |
|
88 | + public static function getTopAnimeType($type) |
|
89 | + { |
|
90 | + $converted_type = ''; |
|
91 | + switch ($type) { |
|
92 | + case '0': |
|
93 | + $converted_type = ''; |
|
94 | + break; |
|
95 | + case '1': |
|
96 | + $converted_type = 'airing'; |
|
97 | + break; |
|
98 | + case '2': |
|
99 | + $converted_type = 'upcoming'; |
|
100 | + break; |
|
101 | + case '3': |
|
102 | + $converted_type = 'tv'; |
|
103 | + break; |
|
104 | + case '4': |
|
105 | + $converted_type = 'movie'; |
|
106 | + break; |
|
107 | + case '5': |
|
108 | + $converted_type = 'ova'; |
|
109 | + break; |
|
110 | + case '6': |
|
111 | + $converted_type = 'special'; |
|
112 | + break; |
|
113 | + case '7': |
|
114 | + $converted_type = 'bypopularity'; |
|
115 | + break; |
|
116 | + case '8': |
|
117 | + $converted_type = 'favorite'; |
|
118 | + break; |
|
119 | + default: |
|
120 | + $converted_type = ''; |
|
121 | + } |
|
122 | + |
|
123 | + return $converted_type; |
|
124 | + } |
|
125 | + |
|
126 | + /** |
|
127 | + * Get top manga code. |
|
128 | + * |
|
129 | + * @param string|int $type |
|
130 | + * |
|
131 | + * @return string |
|
132 | + */ |
|
133 | + public static function getTopMangaType($type) |
|
134 | + { |
|
135 | + $converted_type = ''; |
|
136 | + switch ($type) { |
|
137 | + case '0': |
|
138 | + $converted_type = ''; |
|
139 | + break; |
|
140 | + case '1': |
|
141 | + $converted_type = 'manga'; |
|
142 | + break; |
|
143 | + case '2': |
|
144 | + $converted_type = 'novels'; |
|
145 | + break; |
|
146 | + case '3': |
|
147 | + $converted_type = 'oneshots'; |
|
148 | + break; |
|
149 | + case '4': |
|
150 | + $converted_type = 'doujin'; |
|
151 | + break; |
|
152 | + case '5': |
|
153 | + $converted_type = 'manhwa'; |
|
154 | + break; |
|
155 | + case '6': |
|
156 | + $converted_type = 'manhua'; |
|
157 | + break; |
|
158 | + case '7': |
|
159 | + $converted_type = 'bypopularity'; |
|
160 | + break; |
|
161 | + case '8': |
|
162 | + $converted_type = 'favorite'; |
|
163 | + break; |
|
164 | + default: |
|
165 | + $converted_type = ''; |
|
166 | + } |
|
167 | + |
|
168 | + return $converted_type; |
|
169 | + } |
|
170 | + |
|
171 | + /** |
|
172 | + * Get current season. |
|
173 | + * |
|
174 | + * @return string |
|
175 | + */ |
|
176 | + public static function getCurrentSeason() |
|
177 | + { |
|
178 | + $day = new DateTime(); |
|
179 | + |
|
180 | + // Days of spring |
|
181 | + $spring_starts = new DateTime('April 1'); |
|
182 | + $spring_ends = new DateTime('June 30'); |
|
183 | + |
|
184 | + // Days of summer |
|
185 | + $summer_starts = new DateTime('July 1'); |
|
186 | + $summer_ends = new DateTime('September 30'); |
|
187 | + |
|
188 | + // Days of autumn |
|
189 | + $autumn_starts = new DateTime('October 1'); |
|
190 | + $autumn_ends = new DateTime('December 31'); |
|
191 | + |
|
192 | + // If $day is between the days of spring, summer, autumn, and winter |
|
193 | + if ($day >= $spring_starts && $day <= $spring_ends) : |
|
194 | + $season = 'spring'; elseif ($day >= $summer_starts && $day <= $summer_ends) : |
|
195 | + $season = 'summer'; elseif ($day >= $autumn_starts && $day <= $autumn_ends) : |
|
196 | + $season = 'fall'; else : |
|
197 | + $season = 'winter'; |
|
198 | + endif; |
|
199 | + |
|
200 | + return $season; |
|
201 | + } |
|
202 | + |
|
203 | + /** |
|
204 | + * Clean image URL. |
|
205 | + * |
|
206 | + * @param string $str |
|
207 | + * |
|
208 | + * @return string |
|
209 | + */ |
|
210 | + public static function imageUrlCleaner($str) |
|
211 | + { |
|
212 | + preg_match('/(questionmark)|(qm_50)/', $str, $temp_image); |
|
213 | + $str = $temp_image ? '' : $str; |
|
214 | + $str = str_replace('v.jpg', '.jpg', $str); |
|
215 | + $str = str_replace('_thumb.jpg', '.jpg', $str); |
|
216 | + $str = str_replace('userimages/thumbs', 'userimages', $str); |
|
217 | + $str = preg_replace('/r\/\d{1,3}x\d{1,3}\//', '', $str); |
|
218 | + $str = preg_replace('/\?.+/', '', $str); |
|
219 | + |
|
220 | + return $str; |
|
221 | + } |
|
222 | 222 | } |
223 | 223 | \ No newline at end of file |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | class MalScraper2 |
35 | 35 | { |
36 | - /** |
|
36 | + /** |
|
37 | 37 | * Cache class. |
38 | 38 | * |
39 | 39 | * @var Cache |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | |
105 | 105 | // if cache function enabled |
106 | 106 | if ($this->_enable_cache === true) { |
107 | - $this->_cache->setCache(str_replace('get', '', $method)); |
|
108 | - $this->_cache->eraseExpired($this->_cache_time); |
|
107 | + $this->_cache->setCache(str_replace('get', '', $method)); |
|
108 | + $this->_cache->eraseExpired($this->_cache_time); |
|
109 | 109 | |
110 | 110 | $cacheName = $method.'('.implode(',', $arguments).')'; |
111 | 111 | $isCached = $this->_cache->isCached($cacheName); |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | * |
137 | 137 | * @return array |
138 | 138 | */ |
139 | - private function getInfo($type, $id) |
|
140 | - { |
|
141 | - return (new Info($type, $id))->getAllInfo(); |
|
142 | - } |
|
139 | + private function getInfo($type, $id) |
|
140 | + { |
|
141 | + return (new Info($type, $id))->getAllInfo(); |
|
142 | + } |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Get character information. |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string |
16 | 16 | */ |
17 | - private $_type; |
|
17 | + private $_type; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Id of the anime or manga. |
21 | 21 | * |
22 | 22 | * @var string|int |
23 | 23 | */ |
24 | - private $_id; |
|
24 | + private $_id; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Default constructor. |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
35 | - public function __construct($type, $id, $parserArea = '#content') |
|
35 | + public function __construct($type, $id, $parserArea = '#content') |
|
36 | 36 | { |
37 | - $this->_type = $type; |
|
38 | - $this->_id = $id; |
|
37 | + $this->_type = $type; |
|
38 | + $this->_id = $id; |
|
39 | 39 | $this->_url = $this->_myAnimeListUrl.'/'.$type.'/'.$id; |
40 | - $this->_parserArea = $parserArea; |
|
40 | + $this->_parserArea = $parserArea; |
|
41 | 41 | |
42 | 42 | parent::errorCheck($this); |
43 | 43 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | private function getId() |
66 | 66 | { |
67 | - return $this->_id; |
|
67 | + return $this->_id; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -463,6 +463,6 @@ discard block |
||
463 | 463 | |
464 | 464 | $data = array_merge($data, $data2); |
465 | 465 | |
466 | - return $data; |
|
466 | + return $data; |
|
467 | 467 | } |
468 | 468 | } |
469 | 469 | \ No newline at end of file |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string|int |
16 | 16 | */ |
17 | - private $_id; |
|
17 | + private $_id; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Default constructor. |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @return void |
26 | 26 | */ |
27 | - public function __construct($id, $parserArea = '#contentWrapper') |
|
27 | + public function __construct($id, $parserArea = '#contentWrapper') |
|
28 | 28 | { |
29 | - $this->_id = $id; |
|
29 | + $this->_id = $id; |
|
30 | 30 | $this->_url = $this->_myAnimeListUrl.'/character/'.$id; |
31 | - $this->_parserArea = $parserArea; |
|
31 | + $this->_parserArea = $parserArea; |
|
32 | 32 | |
33 | 33 | parent::errorCheck($this); |
34 | 34 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string|int |
16 | 16 | */ |
17 | - private $_id; |
|
17 | + private $_id; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Biodata area. |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | * |
32 | 32 | * @return void |
33 | 33 | */ |
34 | - public function __construct($id, $parserArea = '#contentWrapper') |
|
34 | + public function __construct($id, $parserArea = '#contentWrapper') |
|
35 | 35 | { |
36 | - $this->_id = $id; |
|
36 | + $this->_id = $id; |
|
37 | 37 | $this->_url = $this->_myAnimeListUrl.'/people/'.$id; |
38 | - $this->_parserArea = $parserArea; |
|
38 | + $this->_parserArea = $parserArea; |
|
39 | 39 | |
40 | 40 | parent::errorCheck($this); |
41 | 41 |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string |
16 | 16 | */ |
17 | - private $_type; |
|
17 | + private $_type; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Id of the anime or manga. |
21 | 21 | * |
22 | 22 | * @var string|int |
23 | 23 | */ |
24 | - private $_id; |
|
24 | + private $_id; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Default constructor. |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
35 | - public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel') |
|
35 | + public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel') |
|
36 | 36 | { |
37 | - $this->_type = $type; |
|
38 | - $this->_id = $id; |
|
37 | + $this->_type = $type; |
|
38 | + $this->_id = $id; |
|
39 | 39 | $this->_url = $this->_myAnimeListUrl.'/'.$type.'/'.$id; |
40 | - $this->_parserArea = $parserArea; |
|
40 | + $this->_parserArea = $parserArea; |
|
41 | 41 | |
42 | 42 | parent::errorCheck($this); |
43 | 43 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | private function getId() |
76 | 76 | { |
77 | - return $this->_id; |
|
77 | + return $this->_id; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string |
16 | 16 | */ |
17 | - private $_type; |
|
17 | + private $_type; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Id of the anime or manga. |
21 | 21 | * |
22 | 22 | * @var string|int |
23 | 23 | */ |
24 | - private $_id; |
|
24 | + private $_id; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Default constructor. |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
35 | - public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel') |
|
35 | + public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel') |
|
36 | 36 | { |
37 | - $this->_type = $type; |
|
38 | - $this->_id = $id; |
|
37 | + $this->_type = $type; |
|
38 | + $this->_id = $id; |
|
39 | 39 | $this->_url = $this->_myAnimeListUrl.'/'.$type.'/'.$id; |
40 | - $this->_parserArea = $parserArea; |
|
40 | + $this->_parserArea = $parserArea; |
|
41 | 41 | |
42 | 42 | parent::errorCheck($this); |
43 | 43 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | private function getId() |
76 | 76 | { |
77 | - return $this->_id; |
|
77 | + return $this->_id; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -14,14 +14,14 @@ discard block |
||
14 | 14 | * |
15 | 15 | * @var string |
16 | 16 | */ |
17 | - private $_type; |
|
17 | + private $_type; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * Id of the anime or manga. |
21 | 21 | * |
22 | 22 | * @var string|int |
23 | 23 | */ |
24 | - private $_id; |
|
24 | + private $_id; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Default constructor. |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @return void |
34 | 34 | */ |
35 | - public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel') |
|
35 | + public function __construct($type, $id, $parserArea = '.js-scrollfix-bottom-rel') |
|
36 | 36 | { |
37 | - $this->_type = $type; |
|
38 | - $this->_id = $id; |
|
37 | + $this->_type = $type; |
|
38 | + $this->_id = $id; |
|
39 | 39 | $this->_url = $this->_myAnimeListUrl.'/'.$type.'/'.$id; |
40 | - $this->_parserArea = $parserArea; |
|
40 | + $this->_parserArea = $parserArea; |
|
41 | 41 | |
42 | 42 | parent::errorCheck($this); |
43 | 43 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | private function getId() |
76 | 76 | { |
77 | - return $this->_id; |
|
77 | + return $this->_id; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
@@ -13,21 +13,21 @@ discard block |
||
13 | 13 | */ |
14 | 14 | class MainModel |
15 | 15 | { |
16 | - /** |
|
16 | + /** |
|
17 | 17 | * MyAnimeList main URL |
18 | 18 | * |
19 | 19 | * @var string |
20 | 20 | */ |
21 | - protected $_myAnimeListUrl = 'https://myanimelist.net'; |
|
21 | + protected $_myAnimeListUrl = 'https://myanimelist.net'; |
|
22 | 22 | |
23 | - /** |
|
23 | + /** |
|
24 | 24 | * Trimmed HtmlDomParser. |
25 | 25 | * |
26 | 26 | * @var \simplehtmldom_1_5\simple_html_dom |
27 | 27 | */ |
28 | - protected $_parser; |
|
28 | + protected $_parser; |
|
29 | 29 | |
30 | - /** |
|
30 | + /** |
|
31 | 31 | * Area to be parsed. |
32 | 32 | * |
33 | 33 | * @var string |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return int |
57 | 57 | */ |
58 | - static function getHeader($url) |
|
59 | - { |
|
60 | - $file_headers = @get_headers($url); |
|
61 | - if (empty($file_headers) || $file_headers[0] == 'HTTP/1.1 404 Not Found') { |
|
62 | - return 404; |
|
63 | - } |
|
64 | - return 200; |
|
65 | - } |
|
58 | + static function getHeader($url) |
|
59 | + { |
|
60 | + $file_headers = @get_headers($url); |
|
61 | + if (empty($file_headers) || $file_headers[0] == 'HTTP/1.1 404 Not Found') { |
|
62 | + return 404; |
|
63 | + } |
|
64 | + return 200; |
|
65 | + } |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Get trimmed HtmlDomParser class. |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | * |
73 | 73 | * @return \simplehtmldom_1_5\simple_html_dom |
74 | 74 | */ |
75 | - static function getParser($url,$contentDiv, $additionalSetting = false) |
|
76 | - { |
|
77 | - $html = HtmlDomParser::file_get_html($url)->find($contentDiv, 0); |
|
78 | - $html = !$additionalSetting ? $html : $html->next_sibling(); |
|
79 | - $html = $html->outertext; |
|
80 | - $html = str_replace('"', '\"', $html); |
|
81 | - $html = html_entity_decode($html, ENT_QUOTES, 'UTF-8'); |
|
82 | - $html = HtmlDomParser::str_get_html($html); |
|
83 | - |
|
84 | - return $html; |
|
85 | - } |
|
75 | + static function getParser($url,$contentDiv, $additionalSetting = false) |
|
76 | + { |
|
77 | + $html = HtmlDomParser::file_get_html($url)->find($contentDiv, 0); |
|
78 | + $html = !$additionalSetting ? $html : $html->next_sibling(); |
|
79 | + $html = $html->outertext; |
|
80 | + $html = str_replace('"', '\"', $html); |
|
81 | + $html = html_entity_decode($html, ENT_QUOTES, 'UTF-8'); |
|
82 | + $html = HtmlDomParser::str_get_html($html); |
|
83 | + |
|
84 | + return $html; |
|
85 | + } |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * Header error check. |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | if (!$model->_error) { |
105 | 105 | $header = self::getHeader($model->_url); |
106 | 106 | if ($header == 200) { |
107 | - $additionalSetting = ($className == 'CharacterPeoplePictureModel'); |
|
107 | + $additionalSetting = ($className == 'CharacterPeoplePictureModel'); |
|
108 | 108 | $model->_parser = self::getParser(self::getAbsoluteUrl($model), $model->_parserArea, $additionalSetting); |
109 | 109 | } else { |
110 | 110 | $model->_error = $header; |
@@ -121,31 +121,31 @@ discard block |
||
121 | 121 | */ |
122 | 122 | static function getAbsoluteUrl($model) |
123 | 123 | { |
124 | - $className = self::getCleanClassName($model); |
|
125 | - $additionalUrl = ''; |
|
126 | - |
|
127 | - switch ($className) { |
|
128 | - case 'CharacterStaffModel': |
|
129 | - $area = 'li a[href$=characters]'; |
|
130 | - break; |
|
131 | - case 'StatModel': |
|
132 | - $area = 'li a[href$=stats]'; |
|
133 | - $additionalUrl = '?m=all&show=1'; |
|
134 | - break; |
|
135 | - case 'PictureModel': |
|
136 | - $area = 'li a[href$=pics]'; |
|
137 | - break; |
|
138 | - case 'CharacterPeoplePictureModel': |
|
139 | - $area = 'li a[href$=pictures]'; |
|
140 | - break; |
|
141 | - default: |
|
142 | - return $model->_url; |
|
143 | - } |
|
144 | - |
|
145 | - $html = HtmlDomParser::file_get_html($model->_url)->find($area, 0)->href; |
|
146 | - |
|
147 | - if ($model->getType() == 'manga') |
|
148 | - return 'https://myanimelist.net'.$html.$additionalUrl; |
|
124 | + $className = self::getCleanClassName($model); |
|
125 | + $additionalUrl = ''; |
|
126 | + |
|
127 | + switch ($className) { |
|
128 | + case 'CharacterStaffModel': |
|
129 | + $area = 'li a[href$=characters]'; |
|
130 | + break; |
|
131 | + case 'StatModel': |
|
132 | + $area = 'li a[href$=stats]'; |
|
133 | + $additionalUrl = '?m=all&show=1'; |
|
134 | + break; |
|
135 | + case 'PictureModel': |
|
136 | + $area = 'li a[href$=pics]'; |
|
137 | + break; |
|
138 | + case 'CharacterPeoplePictureModel': |
|
139 | + $area = 'li a[href$=pictures]'; |
|
140 | + break; |
|
141 | + default: |
|
142 | + return $model->_url; |
|
143 | + } |
|
144 | + |
|
145 | + $html = HtmlDomParser::file_get_html($model->_url)->find($area, 0)->href; |
|
146 | + |
|
147 | + if ($model->getType() == 'manga') |
|
148 | + return 'https://myanimelist.net'.$html.$additionalUrl; |
|
149 | 149 | return $html.$additionalUrl; |
150 | 150 | } |
151 | 151 |