diff --git a/website/app/Console/Kernel.php b/website/app/Console/Kernel.php index 622e774b..0ee5278d 100644 --- a/website/app/Console/Kernel.php +++ b/website/app/Console/Kernel.php @@ -2,11 +2,14 @@ namespace App\Console; +use Illuminate\Support\Facades\Storage; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { + private $API_URL; + /** * The Artisan commands provided by your application. * @@ -24,6 +27,20 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { + $this->API_URL = env('API_URL', 'http://api.6fm.nl/'); + + // Update latest news (3 items) + $schedule->call(function() { + $latest_news = json_decode(file_get_contents($this->API_URL . 'nieuws/overzicht?pagina=1&aantal=3')); + + $news = []; + foreach($latest_news->news as $item_data) + { + $news[] = new \Model\NewsItem($item_data); + } + + Storage::disk('local')->put('laatste_nieuws.json', json_encode($news)); + })->everyMinute(); // $schedule->command('inspire') // ->hourly(); } diff --git a/website/public/css/nhgooi.css b/website/public/css/nhgooi.css index e8861c0a..0efd24fb 100644 --- a/website/public/css/nhgooi.css +++ b/website/public/css/nhgooi.css @@ -59,6 +59,16 @@ button[disabled]:hover cursor: default; } +.posted_by abbr.when +{ + float: right; + color: #7C7C7C; + font-size: 12px; + margin-top: 7px; + text-decoration: none; +} + + .blog_grid .post img { height: 100%; } diff --git a/website/resources/views/layouts/master.blade.php b/website/resources/views/layouts/master.blade.php index efbb616c..9211bd2f 100644 --- a/website/resources/views/layouts/master.blade.php +++ b/website/resources/views/layouts/master.blade.php @@ -249,31 +249,7 @@ --> -
+ @include('widgets/laatstenieuws')