<?php
namespace App\Commands;
use Illuminate\Console\Scheduling\Schedule;
use LaravelZero\Framework\Commands\Command;
use Log;
class Collect extends Command
{
/**
* The signature of the command.
*
* @var string
*/
protected $signature = 'collect';
* The description of the command.
protected $description = 'Collect info about new games';
* List of parsers to run.
* @var array
protected $parsers = [
//'Urq',
'Anivisual',
/*
'Kvester',
//'vndb',
'Apero',
'Instory',
// 'instead',
'Hyperbook',
'HyperbookEn',
'Questbook',
'Textadventures',
'IFDB',
'Dashingdon',
'Itch',
'Gamejolt',
'Steam',
];
* Execute the console command.
* @return mixed
public function handle()
foreach ($this->parsers as $parser) {
$cname = 'App\\Sources\\'.$parser;
try {
$parser = new $cname();
$games = $parser->parse();
foreach ($games as $game) {
$parser->saveGame($game);
}
} catch (\Exception $e) {
Log::error($e->getMessage());
Log::debug($e->getTraceAsString());
* Define the command's schedule.
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
public function schedule(Schedule $schedule): void
$schedule->command(static::class)->daily();