Skip to content

Instantly share code, notes, and snippets.

Created November 20, 2015 21:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Code4Lib Chicago LibCal API demo
$holidays = json_decode(file_get_contents('your unique URL with your own API key and other settings goes here'),true);
if (!empty($holidays['events'])) {
echo "<p>The library will be closed for the following:</p>\n
foreach($holidays['events'] as $event) {
$holiday_date = date('D. M. j', strtotime($event['start']));
echo '<li><strong>'.$holiday_date.'</strong> '.$event['title'].'</li>';
$today_array = json_decode(file_get_contents(''),true);
foreach($today_array['locations'] as $p)
if ($p['category']=='library') {
echo '<strong>'.$p['name'].'</strong>: '.$p['rendered'].' ';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment