Code Duplication    Length = 25-26 lines in 2 locations

application/models/Site_Model.php 2 locations

@@ 978-1002 (lines=25) @@
975
		];
976
	}
977
978
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
979
		$titleData = [];
980
981
		$fullURL = $this->getFullTitleURL($title_url);
982
983
		$content = $this->get_content($fullURL);
984
985
		$data = $this->parseTitleDataDOM(
986
			$content,
987
			$title_url,
988
			"//meta[@property='og:title']",
989
			"//ol[@class='discussionListItems']/li[1]/div[@class='home_list']/ul/li/div[@class='list_press_text']",
990
			"p[@class='author']/span|p[@class='author']/abbr",
991
			"p[@class='text_work']/a"
992
		);
993
		if($data) {
994
			$titleData['title'] = trim(html_entity_decode($data['nodes_title']->getAttribute('content')));
995
996
			$titleData['latest_chapter'] = preg_replace('/^projects\/.*?\/(.*?)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
997
998
			$titleData['last_updated'] =  date("Y-m-d H:i:s",(int) $data['nodes_latest']->getAttribute('title'));
999
		}
1000
1001
		return (!empty($titleData) ? $titleData : NULL);
1002
	}
1003
}
1004
1005
class MangaCow extends Site_Model {
@@ 1021-1046 (lines=26) @@
1018
		];
1019
	}
1020
1021
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1022
		$titleData = [];
1023
1024
		$fullURL = $this->getFullTitleURL($title_url);
1025
1026
		$content = $this->get_content($fullURL);
1027
1028
		$data = $this->parseTitleDataDOM(
1029
			$content,
1030
			$title_url,
1031
			"//h4",
1032
			"//ul[contains(@class, 'mng_chp')]/li[1]/a[1]",
1033
			"b[@class='dte']",
1034
			"",
1035
			"404 Page Not Found"
1036
		);
1037
		if($data) {
1038
			$titleData['title'] = trim($data['nodes_title']->textContent);
1039
1040
			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9]+)\/$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
1041
1042
			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime((string) substr($data['nodes_latest']->getAttribute('title'), 13)));
1043
		}
1044
1045
		return (!empty($titleData) ? $titleData : NULL);
1046
	}
1047
}
1048
1049
/*** FoolSlide sites ***/