diff options
Diffstat (limited to '')
-rw-r--r-- | model/Upcoming.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/model/Upcoming.php b/model/Upcoming.php new file mode 100644 index 0000000..6f54814 --- /dev/null +++ b/model/Upcoming.php @@ -0,0 +1,19 @@ +<?php + +class Upcoming +{ + public function getNextEvent() + { + try { + $events = file_get_contents('https://c3voc.de/eventkalender/events.json?filter=upcoming'); + $events = json_decode($events, true); + $names = array_keys($events['voc_events']); + + return $events['voc_events'][$names[0]]; + } + catch(ErrorException $e) + { + return null; + } + } +} |