Sidebar widgets

This commit is contained in:
2020-01-24 23:37:19 +01:00
parent 29a447005c
commit d6a3f5e119
12 changed files with 217 additions and 630 deletions

View File

@@ -31,18 +31,19 @@ class Kernel extends ConsoleKernel
// 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));
Storage::disk('local')->put('laatste_nieuws.json', file_get_contents($this->API_URL . 'nieuws/overzicht?pagina=1&aantal=3'));
Storage::disk('local')->put('populair_nieuws.json', file_get_contents($this->API_URL . 'nieuws/populair'));
})->everyMinute();
// Update now / later
$schedule->call(function() {
Storage::disk('local')->put('nu_straks.json', file_get_contents($this->API_URL . 'programma/schema/nustraks'));
})->everyMinute();
// Update latest podcasts (3 items)
$schedule->call(function() {
Storage::disk('local')->put('laatste_podcasts.json', file_get_contents($this->API_URL . 'podcast/overzicht?pagina=1&aantal=3'));
})->everyMinute();
// $schedule->command('inspire')
// ->hourly();
}
/**