From d1fe4536cc039450b540104e382db0d01d5cf886 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Fri, 19 Jun 2020 02:16:51 +0100 Subject: Initial commit --- app/Console/Commands/ScrapeFile.php | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 app/Console/Commands/ScrapeFile.php (limited to 'app/Console/Commands/ScrapeFile.php') diff --git a/app/Console/Commands/ScrapeFile.php b/app/Console/Commands/ScrapeFile.php new file mode 100644 index 0000000..4cfef90 --- /dev/null +++ b/app/Console/Commands/ScrapeFile.php @@ -0,0 +1,59 @@ +argument('filename'); + + if (!Storage::disk('local')->exists($filename)) { + $this->error('Could not load file at: ' . Storage::disk('local')->path($filename)); + return Command::FAILURE; + } + + $raw_data = Storage::disk('local')->get($filename); + + $service = new Service(new SixnationsrugbyAdapter($raw_data, 'Six Nations')); + + $service->save(); + + return Command::SUCCESS; + } + +} -- cgit v1.2.3