Code Duplication    Length = 23-23 lines in 5 locations

application/models/Site_Model.php 5 locations

@@ 968-990 (lines=23) @@
965
966
/*** FoolSlide sites ***/
967
968
class KireiCake extends Site_Model {
969
	public $site          = 'KireiCake';
970
	public $titleFormat   = '/^[a-z0-9_-]+$/';
971
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
972
973
	public function getFullTitleURL(string $title_url) : string {
974
		return "https://reader.kireicake.com/series/{$title_url}";
975
	}
976
977
	public function getChapterData(string $title_url, string $chapter) : array {
978
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
979
		$chapter_parts = explode('/', $chapter);
980
		return [
981
			'url'    => "https://reader.kireicake.com/read/{$title_url}/{$chapter}/",
982
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
983
		];
984
	}
985
986
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
987
		$fullURL = $this->getFullTitleURL($title_url);
988
		return $this->parseFoolSlide($fullURL, $title_url);
989
	}
990
}
991
992
class SeaOtterScans extends Site_Model {
993
	public $site          = 'SeaOtterScans';
@@ 992-1014 (lines=23) @@
989
	}
990
}
991
992
class SeaOtterScans extends Site_Model {
993
	public $site          = 'SeaOtterScans';
994
	public $titleFormat   = '/^[a-z0-9_-]+$/';
995
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
996
997
	public function getFullTitleURL(string $title_url) : string {
998
		return "https://reader.seaotterscans.com/series/{$title_url}";
999
	}
1000
1001
	public function getChapterData(string $title_url, string $chapter) : array {
1002
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1003
		$chapter_parts = explode('/', $chapter);
1004
		return [
1005
			'url'    => "https://reader.seaotterscans.com/read/{$title_url}/{$chapter}/",
1006
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1007
		];
1008
	}
1009
1010
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1011
		$fullURL = $this->getFullTitleURL($title_url);
1012
		return $this->parseFoolSlide($fullURL, $title_url);
1013
	}
1014
}
1015
1016
class HelveticaScans extends Site_Model {
1017
	public $site          = 'HelveticaScans';
@@ 1016-1038 (lines=23) @@
1013
	}
1014
}
1015
1016
class HelveticaScans extends Site_Model {
1017
	public $site          = 'HelveticaScans';
1018
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1019
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1020
1021
	public function getFullTitleURL(string $title_url) : string {
1022
		return "http://helveticascans.com/reader/series/{$title_url}";
1023
	}
1024
1025
	public function getChapterData(string $title_url, string $chapter) : array {
1026
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1027
		$chapter_parts = explode('/', $chapter);
1028
		return [
1029
			'url'    => "http://helveticascans.com/reader/read/{$title_url}/{$chapter}/",
1030
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1031
		];
1032
	}
1033
1034
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1035
		$fullURL = $this->getFullTitleURL($title_url);
1036
		return $this->parseFoolSlide($fullURL, $title_url);
1037
	}
1038
}
1039
1040
class SenseScans extends Site_Model {
1041
	public $site          = 'SenseScans';
@@ 1040-1062 (lines=23) @@
1037
	}
1038
}
1039
1040
class SenseScans extends Site_Model {
1041
	public $site          = 'SenseScans';
1042
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1043
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1044
1045
	public function getFullTitleURL(string $title_url) : string {
1046
		return "http://reader.sensescans.com/series/{$title_url}";
1047
	}
1048
1049
	public function getChapterData(string $title_url, string $chapter) : array {
1050
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1051
		$chapter_parts = explode('/', $chapter);
1052
		return [
1053
			'url'    => "http://reader.sensescans.com/read/{$title_url}/{$chapter}/",
1054
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1055
		];
1056
	}
1057
1058
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1059
		$fullURL = $this->getFullTitleURL($title_url);
1060
		return $this->parseFoolSlide($fullURL, $title_url);
1061
	}
1062
}
1063
1064
class JaiminisBox extends Site_Model {
1065
	public $site          = 'JaiminisBox';
@@ 1064-1086 (lines=23) @@
1061
	}
1062
}
1063
1064
class JaiminisBox extends Site_Model {
1065
	public $site          = 'JaiminisBox';
1066
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1067
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1068
1069
	public function getFullTitleURL(string $title_url) : string {
1070
		return "https://jaiminisbox.com/reader/series/{$title_url}";
1071
	}
1072
1073
	public function getChapterData(string $title_url, string $chapter) : array {
1074
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1075
		$chapter_parts = explode('/', $chapter);
1076
		return [
1077
			'url'    => "https://jaiminisbox.com/reader/read/{$title_url}/{$chapter}/",
1078
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1079
		];
1080
	}
1081
1082
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1083
		$fullURL = $this->getFullTitleURL($title_url);
1084
		return $this->parseFoolSlide($fullURL, $title_url);
1085
	}
1086
}
1087