Code Duplication    Length = 25-26 lines in 2 locations

application/models/Site_Model.php 2 locations

@@ 736-760 (lines=25) @@
733
		];
734
	}
735
736
	public function getTitleData(string $title_url) {
737
		$titleData = [];
738
739
		$fullURL = $this->getFullTitleURL($title_url);
740
741
		$content = $this->get_content($fullURL);
742
743
		$data = $this->parseTitleDataDOM(
744
			$content,
745
			$title_url,
746
			"//meta[@property='og:title']",
747
			"//ol[@class='discussionListItems']/li[1]/div[@class='home_list']/ul/li/div[@class='list_press_text']",
748
			"p[@class='author']/span|p[@class='author']/abbr",
749
			"p[@class='text_work']/a"
750
		);
751
		if($data) {
752
			$titleData['title'] = trim(html_entity_decode($data['nodes_title']->getAttribute('content')));
753
754
			$titleData['latest_chapter'] = preg_replace('/^projects\/.*?\/(.*?)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
755
756
			$titleData['last_updated'] =  date("Y-m-d H:i:s",(int) $data['nodes_latest']->getAttribute('title'));
757
		}
758
759
		return (!empty($titleData) ? $titleData : NULL);
760
	}
761
}
762
763
class MangaCow extends Site_Model {
@@ 779-804 (lines=26) @@
776
		];
777
	}
778
779
	public function getTitleData(string $title_url) {
780
		$titleData = [];
781
782
		$fullURL = $this->getFullTitleURL($title_url);
783
784
		$content = $this->get_content($fullURL);
785
786
		$data = $this->parseTitleDataDOM(
787
			$content,
788
			$title_url,
789
			"//h4",
790
			"//ul[contains(@class, 'mng_chp')]/li[1]/a[1]",
791
			"b[@class='dte']",
792
			"",
793
			"404 Page Not Found"
794
		);
795
		if($data) {
796
			$titleData['title'] = trim($data['nodes_title']->textContent);
797
798
			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9]+)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
799
800
			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) substr($data['nodes_latest']->getAttribute('title'), 13)));
801
		}
802
803
		return (!empty($titleData) ? $titleData : NULL);
804
	}
805
}
806
807
class KireiCake extends Site_Model {