Code Duplication    Length = 23-23 lines in 5 locations

application/models/Site_Model.php 5 locations

@@ 817-839 (lines=23) @@
814
815
/*** FoolSlide sites ***/
816
817
class KireiCake extends Site_Model {
818
	public $site          = 'KireiCake';
819
	public $titleFormat   = '/^[a-z0-9_-]+$/';
820
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
821
822
	public function getFullTitleURL(string $title_url) : string {
823
		return "https://reader.kireicake.com/series/{$title_url}";
824
	}
825
826
	public function getChapterData(string $title_url, string $chapter) : array {
827
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
828
		$chapter_parts = explode('/', $chapter);
829
		return [
830
			'url'    => "https://reader.kireicake.com/read/{$title_url}/{$chapter}/",
831
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
832
		];
833
	}
834
835
	public function getTitleData(string $title_url) {
836
		$fullURL = $this->getFullTitleURL($title_url);
837
		return $this->parseFoolSlide($fullURL, $title_url);
838
	}
839
}
840
841
class SeaOtterScans extends Site_Model {
842
	public $site          = 'SeaOtterScans';
@@ 841-863 (lines=23) @@
838
	}
839
}
840
841
class SeaOtterScans extends Site_Model {
842
	public $site          = 'SeaOtterScans';
843
	public $titleFormat   = '/^[a-z0-9_-]+$/';
844
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
845
846
	public function getFullTitleURL(string $title_url) : string {
847
		return "https://reader.seaotterscans.com/series/{$title_url}";
848
	}
849
850
	public function getChapterData(string $title_url, string $chapter) : array {
851
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
852
		$chapter_parts = explode('/', $chapter);
853
		return [
854
			'url'    => "https://reader.seaotterscans.com/read/{$title_url}/{$chapter}/",
855
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
856
		];
857
	}
858
859
	public function getTitleData(string $title_url) {
860
		$fullURL = $this->getFullTitleURL($title_url);
861
		return $this->parseFoolSlide($fullURL, $title_url);
862
	}
863
}
864
865
class HelveticaScans extends Site_Model {
866
	public $site          = 'HelveticaScans';
@@ 865-887 (lines=23) @@
862
	}
863
}
864
865
class HelveticaScans extends Site_Model {
866
	public $site          = 'HelveticaScans';
867
	public $titleFormat   = '/^[a-z0-9_-]+$/';
868
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
869
870
	public function getFullTitleURL(string $title_url) : string {
871
		return "http://helveticascans.com/reader/series/{$title_url}";
872
	}
873
874
	public function getChapterData(string $title_url, string $chapter) : array {
875
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
876
		$chapter_parts = explode('/', $chapter);
877
		return [
878
			'url'    => "http://helveticascans.com/reader/read/{$title_url}/{$chapter}/",
879
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
880
		];
881
	}
882
883
	public function getTitleData(string $title_url) {
884
		$fullURL = $this->getFullTitleURL($title_url);
885
		return $this->parseFoolSlide($fullURL, $title_url);
886
	}
887
}
888
889
class SenseScans extends Site_Model {
890
	public $site          = 'SenseScans';
@@ 889-911 (lines=23) @@
886
	}
887
}
888
889
class SenseScans extends Site_Model {
890
	public $site          = 'SenseScans';
891
	public $titleFormat   = '/^[a-z0-9_-]+$/';
892
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
893
894
	public function getFullTitleURL(string $title_url) : string {
895
		return "http://reader.sensescans.com/series/{$title_url}";
896
	}
897
898
	public function getChapterData(string $title_url, string $chapter) : array {
899
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
900
		$chapter_parts = explode('/', $chapter);
901
		return [
902
			'url'    => "http://reader.sensescans.com/read/{$title_url}/{$chapter}/",
903
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
904
		];
905
	}
906
907
	public function getTitleData(string $title_url) {
908
		$fullURL = $this->getFullTitleURL($title_url);
909
		return $this->parseFoolSlide($fullURL, $title_url);
910
	}
911
}
912
913
class JaiminisBox extends Site_Model {
914
	public $site          = 'JaiminisBox';
@@ 913-935 (lines=23) @@
910
	}
911
}
912
913
class JaiminisBox extends Site_Model {
914
	public $site          = 'JaiminisBox';
915
	public $titleFormat   = '/^[a-z0-9_-]+$/';
916
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
917
918
	public function getFullTitleURL(string $title_url) : string {
919
		return "https://jaiminisbox.com/reader/series/{$title_url}";
920
	}
921
922
	public function getChapterData(string $title_url, string $chapter) : array {
923
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
924
		$chapter_parts = explode('/', $chapter);
925
		return [
926
			'url'    => "https://jaiminisbox.com/reader/read/{$title_url}/{$chapter}/",
927
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
928
		];
929
	}
930
931
	public function getTitleData(string $title_url) {
932
		$fullURL = $this->getFullTitleURL($title_url);
933
		return $this->parseFoolSlide($fullURL, $title_url);
934
	}
935
}
936