aboutsummaryrefslogtreecommitdiff
path: root/model/Upcoming.php
diff options
context:
space:
mode:
authorMaZderMind2015-04-04 20:11:25 +0200
committerMaZderMind2015-04-04 20:12:49 +0200
commit0fb8904157ea87997fa662ad2c975d773dd75455 (patch)
tree9d3f1c505fd499f637bc4926a7feb19fffce4c5e /model/Upcoming.php
parent69c2ec30e6131a2ad205a4a1b77abcbed40c7670 (diff)
Implement Close-Down Page with Upcoming Event
Diffstat (limited to 'model/Upcoming.php')
-rw-r--r--model/Upcoming.php19
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;
+ }
+ }
+}