@@ -1,4 +1,4 @@ discard block |
||
| 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 | abstract class Site_Model extends CI_Model { |
| 4 | 4 | public function __construct() { |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | final protected function get_content(string $url, string $cookie_string = "", string $cookiejar_path = "", bool $follow_redirect = FALSE) { |
| 21 | 21 | $ch = curl_init(); |
| 22 | 22 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 23 | - curl_setopt($ch, CURLOPT_ENCODING , "gzip"); |
|
| 23 | + curl_setopt($ch, CURLOPT_ENCODING, "gzip"); |
|
| 24 | 24 | //curl_setopt($ch, CURLOPT_VERBOSE, 1); |
| 25 | 25 | curl_setopt($ch, CURLOPT_HEADER, 1); |
| 26 | 26 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $nodes_row = $xpath->query($node_row_string); |
| 93 | 93 | if($nodes_title->length === 1 && $nodes_row->length === 1) { |
| 94 | 94 | $firstRow = $nodes_row->item(0); |
| 95 | - $nodes_latest = $xpath->query($node_latest_string, $firstRow); |
|
| 95 | + $nodes_latest = $xpath->query($node_latest_string, $firstRow); |
|
| 96 | 96 | $nodes_chapter = $xpath->query($node_chapter_string, $firstRow); |
| 97 | 97 | |
| 98 | 98 | if($nodes_latest->length === 1 && $nodes_chapter->length === 1) { |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $link = preg_replace('/^(.*\/)(?:[0-9]+\.html)?$/', '$1', (string) $data['nodes_chapter']->getAttribute('href')); |
| 196 | 196 | $chapterURLSegments = explode('/', $link); |
| 197 | - $titleData['latest_chapter'] = $chapterURLSegments[5] . (isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : ""); |
|
| 198 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue)); |
|
| 197 | + $titleData['latest_chapter'] = $chapterURLSegments[5].(isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : ""); |
|
| 198 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue)); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | return (!empty($titleData) ? $titleData : NULL); |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | $link = preg_replace('/^(.*\/)(?:[0-9]+\.html)?$/', '$1', (string) $data['nodes_chapter']->getAttribute('href')); |
| 248 | 248 | $chapterURLSegments = explode('/', $link); |
| 249 | - $titleData['latest_chapter'] = $chapterURLSegments[5] . (isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : ""); |
|
| 250 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue)); |
|
| 249 | + $titleData['latest_chapter'] = $chapterURLSegments[5].(isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : ""); |
|
| 250 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue)); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | return (!empty($titleData) ? $titleData : NULL); |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | $chapter_parts = explode(':--:', $chapter); |
| 288 | 288 | return [ |
| 289 | - 'url' => "http://bato.to/reader#" . $chapter_parts[0], |
|
| 289 | + 'url' => "http://bato.to/reader#".$chapter_parts[0], |
|
| 290 | 290 | 'number' => $chapter_parts[1] |
| 291 | 291 | ]; |
| 292 | 292 | } |
@@ -322,13 +322,13 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | ///^(?:Vol\.(?<volume>\S+) )?(?:Ch.(?<chapter>[^\s:]+)(?:\s?-\s?(?<extra>[0-9]+))?):?.*/ |
| 324 | 324 | preg_match('/^(?:Vol\.(?<volume>\S+) )?(?:Ch.(?<chapter>[^\s:]+)(?:\s?-\s?(?<extra>[0-9]+))?):?.*/', trim($data['nodes_chapter']->nodeValue), $text); |
| 325 | - $titleData['latest_chapter'] = substr($data['nodes_chapter']->getAttribute('href'), 22) . ':--:' . ((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '') . 'c'.$text['chapter'] . (!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
| 325 | + $titleData['latest_chapter'] = substr($data['nodes_chapter']->getAttribute('href'), 22).':--:'.((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '').'c'.$text['chapter'].(!empty($text['extra']) ? '-'.$text['extra'] : '')); |
|
| 326 | 326 | |
| 327 | 327 | $dateString = $data['nodes_latest']->nodeValue; |
| 328 | 328 | if($dateString == 'An hour ago') { |
| 329 | 329 | $dateString = '1 hour ago'; |
| 330 | 330 | } |
| 331 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(preg_replace('/ (-|\[A\]).*$/', '', $dateString))); |
|
| 331 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(preg_replace('/ (-|\[A\]).*$/', '', $dateString))); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | return (!empty($titleData) ? $titleData : NULL); |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | |
| 376 | 376 | $chapterData = [ |
| 377 | - 'url' => 'http://dynasty-scans.com/chapters/' . $title_parts[0].'_'.$chapter, |
|
| 377 | + 'url' => 'http://dynasty-scans.com/chapters/'.$title_parts[0].'_'.$chapter, |
|
| 378 | 378 | 'number' => '' |
| 379 | 379 | ]; |
| 380 | 380 | |
@@ -415,14 +415,14 @@ discard block |
||
| 415 | 415 | |
| 416 | 416 | preg_match('/<b>.*<\/b>/', $data, $matchesT); |
| 417 | 417 | preg_match('/\/doujins\/[^"]+">(.+)?(?=<\/a>)<\/a>/', $data, $matchesD); |
| 418 | - $titleData['title'] = (!empty($matchesD) ? (substr($matchesD[1], 0, -7) !== 'Original' ? substr($matchesD[1], 0, -7).' - ' : '') : '') . substr($matchesT[0], 3, -4); |
|
| 418 | + $titleData['title'] = (!empty($matchesD) ? (substr($matchesD[1], 0, -7) !== 'Original' ? substr($matchesD[1], 0, -7).' - ' : '') : '').substr($matchesT[0], 3, -4); |
|
| 419 | 419 | |
| 420 | 420 | $data = preg_replace('/^[\S\s]*(<dl class=\'chapter-list\'>[\S\s]*<\/dl>)[\S\s]*$/', '$1', $data); |
| 421 | 421 | preg_match_all('/<dd>[\s\S]+?(?=<\/dd>)<\/dd>/', $data, $matches); |
| 422 | 422 | $latest_chapter_html = array_pop($matches[0]); |
| 423 | 423 | |
| 424 | 424 | preg_match('/\/chapters\/([^"]+)/', $latest_chapter_html, $matches); |
| 425 | - $titleData['latest_chapter'] = substr($matches[1], strlen($title_url)+1); |
|
| 425 | + $titleData['latest_chapter'] = substr($matches[1], strlen($title_url) + 1); |
|
| 426 | 426 | //FIXME: THIS IS A TEMP FIX, SEE https://github.com/DakuTree/manga-tracker/issues/58 |
| 427 | 427 | if(!$titleData['latest_chapter']) { |
| 428 | 428 | log_message('error', 'DynastyScans::getTitleData cannot parse title properly as it contains oneshot. || URL: '.$title_url); |
@@ -430,14 +430,14 @@ discard block |
||
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | preg_match('/<small>released (.*)<\/small>/', $latest_chapter_html, $matches); |
| 433 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(str_replace('\'', '', $matches[1]))); |
|
| 433 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(str_replace('\'', '', $matches[1]))); |
|
| 434 | 434 | } elseif($title_parts[1] == '1') { |
| 435 | 435 | $content = $this->get_content('http://dynasty-scans.com/chapters/'.$title_url); |
| 436 | 436 | $data = $content['body']; |
| 437 | 437 | |
| 438 | 438 | preg_match('/<b>.*<\/b>/', $data, $matchesT); |
| 439 | 439 | preg_match('/\/doujins\/[^"]+">(.+)?(?=<\/a>)<\/a>/', $data, $matchesD); |
| 440 | - $titleData['title'] = (!empty($matchesD) ? ($matchesD[1] !== 'Original' ? $matchesD[1].' - ' : '') : '') . substr($matchesT[0], 3, -4); |
|
| 440 | + $titleData['title'] = (!empty($matchesD) ? ($matchesD[1] !== 'Original' ? $matchesD[1].' - ' : '') : '').substr($matchesT[0], 3, -4); |
|
| 441 | 441 | |
| 442 | 442 | $titleData['latest_chapter'] = 'oneshot'; //This will never change |
| 443 | 443 | |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | |
| 499 | 499 | $titleData['latest_chapter'] = preg_replace('/^.*\/([0-9]+)$/', '$1', (string) $data['nodes_chapter']->getAttribute('href')); |
| 500 | 500 | |
| 501 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue)); |
|
| 501 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $data['nodes_latest']->nodeValue)); |
|
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | |
@@ -552,11 +552,11 @@ discard block |
||
| 552 | 552 | $titleData['title'] = $nodes_title->item(0)->nodeValue; |
| 553 | 553 | |
| 554 | 554 | $firstRow = $nodes_row->item(0); |
| 555 | - $nodes_latest = $xpath->query("td[2]", $firstRow); |
|
| 555 | + $nodes_latest = $xpath->query("td[2]", $firstRow); |
|
| 556 | 556 | $nodes_chapter = $xpath->query("td[1]/a", $firstRow); |
| 557 | 557 | |
| 558 | 558 | $titleData['latest_chapter'] = preg_replace('/^.*\/(.*?\/[0-9]+)\/[0-9]+$/', '$1', (string) $nodes_chapter->item(0)->getAttribute('href')); |
| 559 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest->item(0)->nodeValue)); |
|
| 559 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest->item(0)->nodeValue)); |
|
| 560 | 560 | } |
| 561 | 561 | } else { |
| 562 | 562 | log_message('error', "Series missing? (MangaStream): {$title_url}"); |
@@ -623,8 +623,8 @@ discard block |
||
| 623 | 623 | $titleData['title'] = trim((string) $xml->{'channel'}->title); |
| 624 | 624 | |
| 625 | 625 | $chapterURLSegments = explode('/', ((string) $xml->{'channel'}->item[0]->link)); |
| 626 | - $titleData['latest_chapter'] = preg_replace('/^.*?([0-9]+)$/', '$1', $chapterURLSegments[7]) . ':--:' . $chapterURLSegments[6]; |
|
| 627 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $xml->{'channel'}->item[0]->pubDate)); |
|
| 626 | + $titleData['latest_chapter'] = preg_replace('/^.*?([0-9]+)$/', '$1', $chapterURLSegments[7]).':--:'.$chapterURLSegments[6]; |
|
| 627 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $xml->{'channel'}->item[0]->pubDate)); |
|
| 628 | 628 | } |
| 629 | 629 | } else { |
| 630 | 630 | log_message('error', "Series missing? (WebToons): {$title_url}"); |
@@ -702,13 +702,13 @@ discard block |
||
| 702 | 702 | $titleData['title'] = $nodes_title->item(0)->textContent; |
| 703 | 703 | |
| 704 | 704 | $firstRow = $nodes_row->item(0); |
| 705 | - $nodes_latest = $xpath->query("td[2]", $firstRow); |
|
| 705 | + $nodes_latest = $xpath->query("td[2]", $firstRow); |
|
| 706 | 706 | $nodes_chapter = $xpath->query("td[1]/a", $firstRow); |
| 707 | 707 | |
| 708 | 708 | $link = (string) $nodes_chapter->item(0)->getAttribute('href'); |
| 709 | 709 | $chapterURLSegments = explode('/', preg_replace('/\?.*$/', '', $link)); |
| 710 | - $titleData['latest_chapter'] = $chapterURLSegments[3] . ':--:' . preg_replace('/.*?([0-9]+)$/', '$1', $link); |
|
| 711 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest->item(0)->textContent)); |
|
| 710 | + $titleData['latest_chapter'] = $chapterURLSegments[3].':--:'.preg_replace('/.*?([0-9]+)$/', '$1', $link); |
|
| 711 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest->item(0)->textContent)); |
|
| 712 | 712 | } |
| 713 | 713 | } else { |
| 714 | 714 | //TODO: Throw ERRORS; |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | $chapter_parts = explode('/', $chapter); |
| 744 | 744 | return [ |
| 745 | 745 | 'url' => "https://reader.kireicake.com/read/{$title_url}/{$chapter}/", |
| 746 | - 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
| 746 | + 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
| 747 | 747 | ]; |
| 748 | 748 | } |
| 749 | 749 | |
@@ -771,12 +771,12 @@ discard block |
||
| 771 | 771 | $titleData['title'] = trim($nodes_title->item(0)->textContent); |
| 772 | 772 | |
| 773 | 773 | $firstRow = $nodes_row->item(0); |
| 774 | - $nodes_latest = $xpath->query("div[@class='meta_r']", $firstRow); |
|
| 774 | + $nodes_latest = $xpath->query("div[@class='meta_r']", $firstRow); |
|
| 775 | 775 | $nodes_chapter = $xpath->query("div[@class='title']/a", $firstRow); |
| 776 | 776 | |
| 777 | 777 | $link = (string) $nodes_chapter->item(0)->getAttribute('href'); |
| 778 | 778 | $titleData['latest_chapter'] = preg_replace('/.*\/read\/.*?\/(.*?)\/$/', '$1', $link); |
| 779 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest->item(0)->textContent)[1]))); |
|
| 779 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest->item(0)->textContent)[1]))); |
|
| 780 | 780 | } |
| 781 | 781 | } else { |
| 782 | 782 | //TODO: Throw ERRORS; |
@@ -833,11 +833,11 @@ discard block |
||
| 833 | 833 | |
| 834 | 834 | $firstRow = $nodes_row->item(0); |
| 835 | 835 | $nodes_latest = $xpath->query("p[@class='author']/span|p[@class='author']/abbr", $firstRow); |
| 836 | - $nodes_chapter = $xpath->query("p[@class='text_work']/a", $firstRow); |
|
| 836 | + $nodes_chapter = $xpath->query("p[@class='text_work']/a", $firstRow); |
|
| 837 | 837 | |
| 838 | 838 | $link = (string) $nodes_chapter->item(0)->getAttribute('href'); |
| 839 | 839 | $titleData['latest_chapter'] = preg_replace('/^projects\/.*?\/(.*?)\/$/', '$1', $link); |
| 840 | - $titleData['last_updated'] = date("Y-m-d H:i:s", (int) $nodes_latest->item(0)->getAttribute('data-time')); |
|
| 840 | + $titleData['last_updated'] = date("Y-m-d H:i:s", (int) $nodes_latest->item(0)->getAttribute('data-time')); |
|
| 841 | 841 | } else { |
| 842 | 842 | log_message('error', "GameOfScanlation: Unable to find nodes."); |
| 843 | 843 | return NULL; |
@@ -898,7 +898,7 @@ discard block |
||
| 898 | 898 | |
| 899 | 899 | $link = (string) $nodes_chapter->item(0)->getAttribute('href'); |
| 900 | 900 | $titleData['latest_chapter'] = preg_replace('/^.*\/([0-9]+)\/$/', '$1', $link); |
| 901 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) substr($nodes_latest->item(0)->getAttribute('title'), 13))); |
|
| 901 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) substr($nodes_latest->item(0)->getAttribute('title'), 13))); |
|
| 902 | 902 | } else { |
| 903 | 903 | log_message('error', "MangaCow: Unable to find nodes."); |
| 904 | 904 | return NULL; |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | $chapter_parts = explode('/', $chapter); |
| 933 | 933 | return [ |
| 934 | 934 | 'url' => "https://reader.seaotterscans.com/read/{$title_url}/{$chapter}/", |
| 935 | - 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
| 935 | + 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
| 936 | 936 | ]; |
| 937 | 937 | } |
| 938 | 938 | |
@@ -959,18 +959,18 @@ discard block |
||
| 959 | 959 | //SOO sometimes uses volume groups which are above recent chapters (if they haven't been grouped yet), so make sure we check for both. |
| 960 | 960 | $nodes_row = $xpath->query("//div[@class='list']/div[@class='group']/div[@class='title' and text() = 'Chapters']/following-sibling::div[@class='element'][1]"); |
| 961 | 961 | if($nodes_row->length !== 1) { |
| 962 | - $nodes_row = $xpath->query("//div[@class='list']/div[@class='group'][1]/div[@class='element'][1]"); |
|
| 962 | + $nodes_row = $xpath->query("//div[@class='list']/div[@class='group'][1]/div[@class='element'][1]"); |
|
| 963 | 963 | } |
| 964 | 964 | if($nodes_title->length === 1 && $nodes_row->length === 1) { |
| 965 | 965 | $titleData['title'] = trim($nodes_title->item(0)->textContent); |
| 966 | 966 | |
| 967 | 967 | $firstRow = $nodes_row->item(0); |
| 968 | - $nodes_latest = $xpath->query("div[@class='meta_r']", $firstRow); |
|
| 968 | + $nodes_latest = $xpath->query("div[@class='meta_r']", $firstRow); |
|
| 969 | 969 | $nodes_chapter = $xpath->query("div[@class='title']/a", $firstRow); |
| 970 | 970 | |
| 971 | 971 | $link = (string) $nodes_chapter->item(0)->getAttribute('href'); |
| 972 | 972 | $titleData['latest_chapter'] = preg_replace('/.*\/read\/.*?\/(.*?)\/$/', '$1', $link); |
| 973 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest[0]->textContent)[1]))); |
|
| 973 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest[0]->textContent)[1]))); |
|
| 974 | 974 | } |
| 975 | 975 | } else { |
| 976 | 976 | //TODO: Throw ERRORS; |
@@ -1001,7 +1001,7 @@ discard block |
||
| 1001 | 1001 | $chapter_parts = explode('/', $chapter); |
| 1002 | 1002 | return [ |
| 1003 | 1003 | 'url' => "http://helveticascans.com/reader/read/{$title_url}/{$chapter}/", |
| 1004 | - 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
| 1004 | + 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
| 1005 | 1005 | ]; |
| 1006 | 1006 | } |
| 1007 | 1007 | |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | $nodes_title = $xpath->query("//div[@class='large comic']/h1[@class='title']"); |
| 1027 | 1027 | $nodes_row = $xpath->query("//div[@class='list']/div[@class='group']/div[@class='title' and text() = 'Chapters']/following-sibling::div[@class='element'][1]"); |
| 1028 | 1028 | if($nodes_row->length !== 1) { |
| 1029 | - $nodes_row = $xpath->query("//div[@class='list']/div[@class='group'][1]/div[@class='element'][1]"); |
|
| 1029 | + $nodes_row = $xpath->query("//div[@class='list']/div[@class='group'][1]/div[@class='element'][1]"); |
|
| 1030 | 1030 | } |
| 1031 | 1031 | if($nodes_title->length === 1 && $nodes_row->length === 1) { |
| 1032 | 1032 | $titleData['title'] = trim($nodes_title->item(0)->textContent); |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | |
| 1038 | 1038 | $link = (string) $nodes_chapter->item(0)->getAttribute('href'); |
| 1039 | 1039 | $titleData['latest_chapter'] = preg_replace('/.*\/read\/.*?\/(.*?)\/$/', '$1', $link); |
| 1040 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest->item(0)->textContent)[1]))); |
|
| 1040 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest->item(0)->textContent)[1]))); |
|
| 1041 | 1041 | } |
| 1042 | 1042 | } else { |
| 1043 | 1043 | //TODO: Throw ERRORS; |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | $chapter_parts = explode('/', $chapter); |
| 1069 | 1069 | return [ |
| 1070 | 1070 | 'url' => "http://reader.sensescans.com/read/{$title_url}/{$chapter}/", |
| 1071 | - 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
| 1071 | + 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
| 1072 | 1072 | ]; |
| 1073 | 1073 | } |
| 1074 | 1074 | |
@@ -1093,7 +1093,7 @@ discard block |
||
| 1093 | 1093 | $nodes_title = $xpath->query("//div[@class='large comic']/h1[@class='title']"); |
| 1094 | 1094 | $nodes_row = $xpath->query("//div[@class='list']/div[@class='group']/div[@class='title' and text() = 'Chapters']/following-sibling::div[@class='element'][1]"); |
| 1095 | 1095 | if($nodes_row->length !== 1) { |
| 1096 | - $nodes_row = $xpath->query("//div[@class='list']/div[@class='group'][1]/div[@class='element'][1]"); |
|
| 1096 | + $nodes_row = $xpath->query("//div[@class='list']/div[@class='group'][1]/div[@class='element'][1]"); |
|
| 1097 | 1097 | } |
| 1098 | 1098 | if($nodes_title->length === 1 && $nodes_row->length === 1) { |
| 1099 | 1099 | $titleData['title'] = trim($nodes_title->item(0)->textContent); |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | |
| 1104 | 1104 | $link = (string) $nodes_chapter->item(0)->getAttribute('href'); |
| 1105 | 1105 | $titleData['latest_chapter'] = preg_replace('/.*\/read\/.*?\/(.*?)\/$/', '$1', $link); |
| 1106 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest->item(0)->textContent)[1]))); |
|
| 1106 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest->item(0)->textContent)[1]))); |
|
| 1107 | 1107 | } |
| 1108 | 1108 | } else { |
| 1109 | 1109 | //TODO: Throw ERRORS; |
@@ -1,4 +1,4 @@ discard block |
||
| 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 | abstract class Site_Model extends CI_Model { |
| 4 | 4 | public function __construct() { |
@@ -540,9 +540,9 @@ discard block |
||
| 540 | 540 | //$data = preg_replace('/^[\S\s]*(<body id="body">[\S\s]*<\/body>)[\S\s]*$/', '$1', $data); |
| 541 | 541 | |
| 542 | 542 | $dom = new DOMDocument(); |
| 543 | - libxml_use_internal_errors(true); |
|
| 543 | + libxml_use_internal_errors(TRUE); |
|
| 544 | 544 | $dom->loadHTML($data); |
| 545 | - libxml_use_internal_errors(false); |
|
| 545 | + libxml_use_internal_errors(FALSE); |
|
| 546 | 546 | |
| 547 | 547 | $xpath = new DOMXPath($dom); |
| 548 | 548 | |
@@ -690,9 +690,9 @@ discard block |
||
| 690 | 690 | $data = preg_replace('/^[\S\s]*(<div id="leftside">[\S\s]*)<div id="rightside">[\S\s]*$/', '$1', $data); |
| 691 | 691 | |
| 692 | 692 | $dom = new DOMDocument(); |
| 693 | - libxml_use_internal_errors(true); |
|
| 693 | + libxml_use_internal_errors(TRUE); |
|
| 694 | 694 | $dom->loadHTML($data); |
| 695 | - libxml_use_internal_errors(false); |
|
| 695 | + libxml_use_internal_errors(FALSE); |
|
| 696 | 696 | |
| 697 | 697 | $xpath = new DOMXPath($dom); |
| 698 | 698 | |
@@ -759,9 +759,9 @@ discard block |
||
| 759 | 759 | $data = preg_replace('/^[\S\s]*(<article>[\S\s]*)<\/article>[\S\s]*$/', '$1', $data); |
| 760 | 760 | |
| 761 | 761 | $dom = new DOMDocument(); |
| 762 | - libxml_use_internal_errors(true); |
|
| 762 | + libxml_use_internal_errors(TRUE); |
|
| 763 | 763 | $dom->loadHTML($data); |
| 764 | - libxml_use_internal_errors(false); |
|
| 764 | + libxml_use_internal_errors(FALSE); |
|
| 765 | 765 | |
| 766 | 766 | $xpath = new DOMXPath($dom); |
| 767 | 767 | |
@@ -820,9 +820,9 @@ discard block |
||
| 820 | 820 | //$data = preg_replace('/^[\S\s]*(<ol[\S\s]*)<\/ol>[\S\s]*$/', '$1', $data); |
| 821 | 821 | |
| 822 | 822 | $dom = new DOMDocument(); |
| 823 | - libxml_use_internal_errors(true); |
|
| 823 | + libxml_use_internal_errors(TRUE); |
|
| 824 | 824 | $dom->loadHTML($data); |
| 825 | - libxml_use_internal_errors(false); |
|
| 825 | + libxml_use_internal_errors(FALSE); |
|
| 826 | 826 | |
| 827 | 827 | $xpath = new DOMXPath($dom); |
| 828 | 828 | |
@@ -882,9 +882,9 @@ discard block |
||
| 882 | 882 | $data = $content['body']; |
| 883 | 883 | if(strpos($data, '404 Page Not Found') === FALSE) { |
| 884 | 884 | $dom = new DOMDocument(); |
| 885 | - libxml_use_internal_errors(true); |
|
| 885 | + libxml_use_internal_errors(TRUE); |
|
| 886 | 886 | $dom->loadHTML($data); |
| 887 | - libxml_use_internal_errors(false); |
|
| 887 | + libxml_use_internal_errors(FALSE); |
|
| 888 | 888 | |
| 889 | 889 | $xpath = new DOMXPath($dom); |
| 890 | 890 | |
@@ -948,9 +948,9 @@ discard block |
||
| 948 | 948 | $data = preg_replace('/^[\S\s]*(<article[\S\s]*)<\/article>[\S\s]*$/', '$1', $data); |
| 949 | 949 | |
| 950 | 950 | $dom = new DOMDocument(); |
| 951 | - libxml_use_internal_errors(true); |
|
| 951 | + libxml_use_internal_errors(TRUE); |
|
| 952 | 952 | $dom->loadHTML($data); |
| 953 | - libxml_use_internal_errors(false); |
|
| 953 | + libxml_use_internal_errors(FALSE); |
|
| 954 | 954 | |
| 955 | 955 | $xpath = new DOMXPath($dom); |
| 956 | 956 | |
@@ -1017,9 +1017,9 @@ discard block |
||
| 1017 | 1017 | $data = preg_replace('/^[\S\s]*(<article[\S\s]*)<\/article>[\S\s]*$/', '$1', $data); |
| 1018 | 1018 | |
| 1019 | 1019 | $dom = new DOMDocument(); |
| 1020 | - libxml_use_internal_errors(true); |
|
| 1020 | + libxml_use_internal_errors(TRUE); |
|
| 1021 | 1021 | $dom->loadHTML($data); |
| 1022 | - libxml_use_internal_errors(false); |
|
| 1022 | + libxml_use_internal_errors(FALSE); |
|
| 1023 | 1023 | |
| 1024 | 1024 | $xpath = new DOMXPath($dom); |
| 1025 | 1025 | |
@@ -1084,9 +1084,9 @@ discard block |
||
| 1084 | 1084 | $data = preg_replace('/^[\S\s]*(<article[\S\s]*)<\/article>[\S\s]*$/', '$1', $data); |
| 1085 | 1085 | |
| 1086 | 1086 | $dom = new DOMDocument(); |
| 1087 | - libxml_use_internal_errors(true); |
|
| 1087 | + libxml_use_internal_errors(TRUE); |
|
| 1088 | 1088 | $dom->loadHTML($data); |
| 1089 | - libxml_use_internal_errors(false); |
|
| 1089 | + libxml_use_internal_errors(FALSE); |
|
| 1090 | 1090 | |
| 1091 | 1091 | $xpath = new DOMXPath($dom); |
| 1092 | 1092 | |