33 lines
950 B
PHP
Executable File
33 lines
950 B
PHP
Executable File
<?php
|
|
|
|
$app->get('/shows', function() use($app) {
|
|
|
|
$shows = json_decode(file_get_contents('http://api.bandsintown.com/artists/HALFtone/events.json?api_version=2.0&app_id=shows_halftoneband.com'));
|
|
|
|
foreach ($shows as $show) {
|
|
$show->date = date('M dS', strtotime($show->datetime));
|
|
$show->day = date('D', strtotime($show->datetime));
|
|
$show->time = date('H:i', strtotime($show->datetime));
|
|
}
|
|
|
|
$app->render('shows.twig', [
|
|
'shows' => $shows,
|
|
]);
|
|
|
|
})->name('shows');
|
|
|
|
$app->get('/shows/json', function() use($app) {
|
|
|
|
$shows = json_decode(file_get_contents('http://api.bandsintown.com/artists/HALFtone/events.json?api_version=2.0&app_id=shows_halftoneband.com'));
|
|
|
|
foreach ($shows as $show) {
|
|
$show->date = date('M dS', strtotime($show->datetime));
|
|
$show->day = date('D', strtotime($show->datetime));
|
|
$show->time = date('H:i', strtotime($show->datetime));
|
|
print_r($show);
|
|
echo '<br /><br />';
|
|
}
|
|
die();
|
|
|
|
})->name('shows.json');
|