Skip to content

Instantly share code, notes, and snippets.

@vojkny
Last active August 29, 2015 14:07
Show Gist options
  • Save vojkny/089c5065e8944375d725 to your computer and use it in GitHub Desktop.
Save vojkny/089c5065e8944375d725 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
// načtení feedu
$ch = curl_init('https://goout.cz/api/("venue":"3928","scheduled":"true","source":"reznicka.cz","tickets":"true")');
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
curl_setopt($ch, CURLOPT_USERAGENT, 'GoOut API reader');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
// dekodování jsonu
$response = json_decode($response);
// procházení akcí
foreach ($response->events as $event) {
echo '<pre>';
var_dump($event);
echo '</pre>';
$tickets = $event->schedule->tickets;
// pro zobrazení formuláře je nutné přidat /min/ do URL
$tickets = str_replace('/listky/', '/listky/min/', $tickets);
echo "<iframe src='$tickets' frameborder='0' width='100%', height='600'></iframe>\n";
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment