Code Duplication    Length = 25-26 lines in 2 locations

application/models/Site_Model.php 2 locations

@@ 1007-1031 (lines=25) @@
1004
		];
1005
	}
1006
1007
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1008
		$titleData = [];
1009
1010
		$fullURL = $this->getFullTitleURL($title_url);
1011
1012
		$content = $this->get_content($fullURL);
1013
1014
		$data = $this->parseTitleDataDOM(
1015
			$content,
1016
			$title_url,
1017
			"//meta[@property='og:title']",
1018
			"//ol[@class='discussionListItems']/li[1]/div[@class='home_list']/ul/li/div[@class='list_press_text']",
1019
			"p[@class='author']/span|p[@class='author']/abbr",
1020
			"p[@class='text_work']/a"
1021
		);
1022
		if($data) {
1023
			$titleData['title'] = trim(html_entity_decode($data['nodes_title']->getAttribute('content')));
1024
1025
			$titleData['latest_chapter'] = preg_replace('/^projects\/.*?\/(.*?)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
1026
1027
			$titleData['last_updated'] =  date("Y-m-d H:i:s",(int) $data['nodes_latest']->getAttribute('title'));
1028
		}
1029
1030
		return (!empty($titleData) ? $titleData : NULL);
1031
	}
1032
}
1033
1034
class MangaCow extends Site_Model {
@@ 1049-1074 (lines=26) @@
1046
		];
1047
	}
1048
1049
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1050
		$titleData = [];
1051
1052
		$fullURL = $this->getFullTitleURL($title_url);
1053
1054
		$content = $this->get_content($fullURL);
1055
1056
		$data = $this->parseTitleDataDOM(
1057
			$content,
1058
			$title_url,
1059
			"//h4",
1060
			"//ul[contains(@class, 'mng_chp')]/li[1]/a[1]",
1061
			"b[@class='dte']",
1062
			"",
1063
			"404 Page Not Found"
1064
		);
1065
		if($data) {
1066
			$titleData['title'] = trim($data['nodes_title']->textContent);
1067
1068
			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9]+)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
1069
1070
			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) substr($data['nodes_latest']->getAttribute('title'), 13)));
1071
		}
1072
1073
		return (!empty($titleData) ? $titleData : NULL);
1074
	}
1075
}
1076
1077
class EGScans extends Site_Model {