aboutsummaryrefslogtreecommitdiff
path: root/model/Upcoming.php
blob: 6f548144d394e50986b57c032b97e71d25616f99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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;
		}
	}
}