Code Duplication    Length = 22-22 lines in 8 locations

application/models/Site_Model.php 8 locations

@@ 1120-1141 (lines=22) @@
1117
1118
/*** FoolSlide sites ***/
1119
1120
class KireiCake extends Site_Model {
1121
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1122
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1123
1124
	public function getFullTitleURL(string $title_url) : string {
1125
		return "https://reader.kireicake.com/series/{$title_url}";
1126
	}
1127
1128
	public function getChapterData(string $title_url, string $chapter) : array {
1129
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1130
		$chapter_parts = explode('/', $chapter);
1131
		return [
1132
			'url'    => "https://reader.kireicake.com/read/{$title_url}/{$chapter}/",
1133
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1134
		];
1135
	}
1136
1137
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1138
		$fullURL = $this->getFullTitleURL($title_url);
1139
		return $this->parseFoolSlide($fullURL, $title_url);
1140
	}
1141
}
1142
1143
class SeaOtterScans extends Site_Model {
1144
	public $titleFormat   = '/^[a-z0-9_-]+$/';
@@ 1143-1164 (lines=22) @@
1140
	}
1141
}
1142
1143
class SeaOtterScans extends Site_Model {
1144
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1145
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1146
1147
	public function getFullTitleURL(string $title_url) : string {
1148
		return "https://reader.seaotterscans.com/series/{$title_url}";
1149
	}
1150
1151
	public function getChapterData(string $title_url, string $chapter) : array {
1152
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1153
		$chapter_parts = explode('/', $chapter);
1154
		return [
1155
			'url'    => "https://reader.seaotterscans.com/read/{$title_url}/{$chapter}/",
1156
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1157
		];
1158
	}
1159
1160
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1161
		$fullURL = $this->getFullTitleURL($title_url);
1162
		return $this->parseFoolSlide($fullURL, $title_url);
1163
	}
1164
}
1165
1166
class HelveticaScans extends Site_Model {
1167
	public $titleFormat   = '/^[a-z0-9_-]+$/';
@@ 1166-1187 (lines=22) @@
1163
	}
1164
}
1165
1166
class HelveticaScans extends Site_Model {
1167
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1168
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1169
1170
	public function getFullTitleURL(string $title_url) : string {
1171
		return "http://helveticascans.com/r/series/{$title_url}";
1172
	}
1173
1174
	public function getChapterData(string $title_url, string $chapter) : array {
1175
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1176
		$chapter_parts = explode('/', $chapter);
1177
		return [
1178
			'url'    => "http://helveticascans.com/r/read/{$title_url}/{$chapter}/",
1179
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1180
		];
1181
	}
1182
1183
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1184
		$fullURL = $this->getFullTitleURL($title_url);
1185
		return $this->parseFoolSlide($fullURL, $title_url);
1186
	}
1187
}
1188
1189
class SenseScans extends Site_Model {
1190
	public $titleFormat   = '/^[a-z0-9_-]+$/';
@@ 1189-1210 (lines=22) @@
1186
	}
1187
}
1188
1189
class SenseScans extends Site_Model {
1190
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1191
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1192
1193
	public function getFullTitleURL(string $title_url) : string {
1194
		return "http://reader.sensescans.com/series/{$title_url}";
1195
	}
1196
1197
	public function getChapterData(string $title_url, string $chapter) : array {
1198
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1199
		$chapter_parts = explode('/', $chapter);
1200
		return [
1201
			'url'    => "http://reader.sensescans.com/read/{$title_url}/{$chapter}/",
1202
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1203
		];
1204
	}
1205
1206
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1207
		$fullURL = $this->getFullTitleURL($title_url);
1208
		return $this->parseFoolSlide($fullURL, $title_url);
1209
	}
1210
}
1211
1212
class JaiminisBox extends Site_Model {
1213
	public $titleFormat   = '/^[a-z0-9_-]+$/';
@@ 1212-1233 (lines=22) @@
1209
	}
1210
}
1211
1212
class JaiminisBox extends Site_Model {
1213
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1214
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1215
1216
	public function getFullTitleURL(string $title_url) : string {
1217
		return "https://jaiminisbox.com/reader/series/{$title_url}";
1218
	}
1219
1220
	public function getChapterData(string $title_url, string $chapter) : array {
1221
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1222
		$chapter_parts = explode('/', $chapter);
1223
		return [
1224
			'url'    => "https://jaiminisbox.com/reader/read/{$title_url}/{$chapter}/",
1225
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1226
		];
1227
	}
1228
1229
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1230
		$fullURL = $this->getFullTitleURL($title_url);
1231
		return $this->parseFoolSlide($fullURL, $title_url);
1232
	}
1233
}
1234
1235
class DokiFansubs extends Site_Model {
1236
	public $titleFormat   = '/^[a-z0-9_-]+$/';
@@ 1235-1256 (lines=22) @@
1232
	}
1233
}
1234
1235
class DokiFansubs extends Site_Model {
1236
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1237
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1238
1239
	public function getFullTitleURL(string $title_url) : string {
1240
		return "https://kobato.hologfx.com/reader/series/{$title_url}";
1241
	}
1242
1243
	public function getChapterData(string $title_url, string $chapter) : array {
1244
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1245
		$chapter_parts = explode('/', $chapter);
1246
		return [
1247
			'url'    => "https://kobato.hologfx.com/reader/read/{$title_url}/{$chapter}/",
1248
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1249
		];
1250
	}
1251
1252
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1253
		$fullURL = $this->getFullTitleURL($title_url);
1254
		return $this->parseFoolSlide($fullURL, $title_url);
1255
	}
1256
}
1257
1258
class DemonicScans extends Site_Model {
1259
	public $titleFormat   = '/^[a-z0-9_-]+$/';
@@ 1258-1279 (lines=22) @@
1255
	}
1256
}
1257
1258
class DemonicScans extends Site_Model {
1259
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1260
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1261
1262
	public function getFullTitleURL(string $title_url) : string {
1263
		return "http://www.demonicscans.com/FoOlSlide/series/{$title_url}";
1264
	}
1265
1266
	public function getChapterData(string $title_url, string $chapter) : array {
1267
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1268
		$chapter_parts = explode('/', $chapter);
1269
		return [
1270
			'url'    => "http://www.demonicscans.com/FoOlSlide/read/{$title_url}/{$chapter}/",
1271
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1272
		];
1273
	}
1274
1275
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1276
		$fullURL = $this->getFullTitleURL($title_url);
1277
		return $this->parseFoolSlide($fullURL, $title_url);
1278
	}
1279
}
1280
1281
class DeathTollScans extends Site_Model {
1282
	public $titleFormat   = '/^[a-z0-9_-]+$/';
@@ 1281-1302 (lines=22) @@
1278
	}
1279
}
1280
1281
class DeathTollScans extends Site_Model {
1282
	public $titleFormat   = '/^[a-z0-9_-]+$/';
1283
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
1284
1285
	public function getFullTitleURL(string $title_url) : string {
1286
		return "https://reader.deathtollscans.net/series/{$title_url}";
1287
	}
1288
1289
	public function getChapterData(string $title_url, string $chapter) : array {
1290
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
1291
		$chapter_parts = explode('/', $chapter);
1292
		return [
1293
			'url'    => "https://reader.deathtollscans.net/read/{$title_url}/{$chapter}/",
1294
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
1295
		];
1296
	}
1297
1298
	public function getTitleData(string $title_url, bool $firstGet = FALSE) {
1299
		$fullURL = $this->getFullTitleURL($title_url);
1300
		return $this->parseFoolSlide($fullURL, $title_url);
1301
	}
1302
}
1303