summaryrefslogtreecommitdiff
path: root/app/Console/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'app/Console/Commands')
-rw-r--r--app/Console/Commands/CheckImage.php36
-rw-r--r--app/Console/Commands/SaveSeasonAiring.php43
-rw-r--r--app/Console/Commands/SaveStats.php37
-rw-r--r--app/Console/Commands/SaveTopAnimeEnhance.php43
-rw-r--r--app/Console/Commands/SetWatchingCalender.php41
5 files changed, 200 insertions, 0 deletions
diff --git a/app/Console/Commands/CheckImage.php b/app/Console/Commands/CheckImage.php
new file mode 100644
index 0000000..fcd6d4a
--- /dev/null
+++ b/app/Console/Commands/CheckImage.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use App\Libraries\Background;
+
+class CheckImage extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'anime:checkImage';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Fix broken image links';
+
+ /**
+ * Execute the console command.
+ *
+ * @return int
+ */
+ public function handle()
+ {
+ $background = new Background();
+ echo "checkImage()\n";
+ $background->checkImage();
+ return Command::SUCCESS;
+ }
+}
diff --git a/app/Console/Commands/SaveSeasonAiring.php b/app/Console/Commands/SaveSeasonAiring.php
new file mode 100644
index 0000000..5bee978
--- /dev/null
+++ b/app/Console/Commands/SaveSeasonAiring.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use App\Libraries\Background;
+
+class SaveSeasonAiring extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'anime:saveSeasonAiring';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Save seasonal anime and airing status';
+
+ /**
+ * Execute the console command.
+ *
+ * @return int
+ */
+ public function handle()
+ {
+ $background = new Background();
+ echo "SaveSeason(): \n";
+ $background->saveSeason();
+ sleep(10);
+ echo "\ncheckIfIsAiring(): \n";
+ $background->checkIfIsAiring();
+ sleep(10);
+ echo "\nsaveAiringForAll(): \n";
+ $background->saveAiringForAll();
+
+ return Command::SUCCESS;
+ }
+}
diff --git a/app/Console/Commands/SaveStats.php b/app/Console/Commands/SaveStats.php
new file mode 100644
index 0000000..3466812
--- /dev/null
+++ b/app/Console/Commands/SaveStats.php
@@ -0,0 +1,37 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use App\Libraries\Background;
+
+class SaveStats extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'anime:saveStats';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Daily task to save Stats';
+
+ /**
+ * Execute the console command.
+ *
+ * @return int
+ */
+ public function handle()
+ {
+ $background = new Background();
+ if ( $background->saveAnimeStats() ) {
+ return Command::SUCCESS;
+ }
+ return Command::FAILURE;
+ }
+}
diff --git a/app/Console/Commands/SaveTopAnimeEnhance.php b/app/Console/Commands/SaveTopAnimeEnhance.php
new file mode 100644
index 0000000..f46602b
--- /dev/null
+++ b/app/Console/Commands/SaveTopAnimeEnhance.php
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use App\Libraries\Background;
+
+class SaveTopAnimeEnhance extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'anime:saveTopAnimeEnhance';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Save top/popular anime, enhancements and season details';
+
+ /**
+ * Execute the console command.
+ *
+ * @return int
+ */
+ public function handle()
+ {
+ $background = new Background();
+ echo "saveTopAnime()\n";
+ $background->saveTopAnime();
+ echo "saveTopAnimeByPopularity()\n";
+ $background->saveTopAnimeByPopularity();
+ echo"saveEnhancementForAll()\n";
+ $background->saveEnhancementForAll();
+ echo "addSeasonToAllAnime()\n";
+ $background->addSeasonToAllAnime();
+
+ return Command::SUCCESS;
+ }
+}
diff --git a/app/Console/Commands/SetWatchingCalender.php b/app/Console/Commands/SetWatchingCalender.php
new file mode 100644
index 0000000..9e4bfa7
--- /dev/null
+++ b/app/Console/Commands/SetWatchingCalender.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use App\Libraries\Helper;
+
+class SetWatchingCalender extends Command
+{
+ /**
+ * The name and signature of the console command.
+ *
+ * @var string
+ */
+ protected $signature = 'anime:setWatchingCalender';
+
+ /**
+ * The console command description.
+ *
+ * @var string
+ */
+ protected $description = 'Update anime to set watching status and populate calendar entries';
+
+ /**
+ * Execute the console command.
+ *
+ * @return int
+ */
+ public function handle()
+ {
+ $helper = new Helper();
+ #$helper->createUser( 'll-' );
+ echo "setIsWatchingForAll(): \n";
+ $helper->setIsWatchingForAll();
+ echo "\nsetCalendarForAll(): \n";
+ $helper->setCalendarForAll();
+
+ return Command::SUCCESS;
+
+ }
+}