<?php

include 'functionsTwitchAPI.php';
?>

<?php 
$title = 'Twitch API Top 10 games';
include __DIR__ . '/header.php';
?>
 
<div id="body">



<?php 
//Main body for php code
$returnRequestTop10 = twitchAPIRequest("https://api.twitch.tv/kraken/games/top?limit=10&offset=0");
$top10Html = decodeTop10Games($returnRequestTop10);
echo $top10Html;
echo "<a href='./source.php?path=index.php'>View source</a>";
?>
</div>
 
<?php 
$path = __DIR__;
include __DIR__ . '/footer.php';
<?php

include 'functionsTwitchAPI.php';
?>

<?php 
$title = 'View stream';
include __DIR__ . '/header.php';
?>

<div id="body">

<?php 
$urlString = "https://api.twitch.tv/kraken/channels/" . $_GET["ch"];
$returnRequestChannel = twitchAPIRequest($urlString);
$steamStatus = decodeChannel($returnRequestChannel);
echo $steamStatus;
echo steamViewer();
echo "<a href='index.php'> << Home </a><br><br>";
echo "<a href='./source.php?path=view.php'>View source</a>";
?>







      
 
<?php 
<?php

include 'functionsTwitchAPI.php';
?>

<?php 
$title = 'Top 10 streams ' . $_GET["g"];
include __DIR__ . '/header.php';
?>
 
<div id="body">



<?php 
//Main body for php code
$urlString = "https://api.twitch.tv/kraken/streams?game=" . rawurlencode($_GET["g"]) . "&limit=10";
$returnRequestTop10Streams = twitchAPIRequest($urlString);
$top10Streams = decodeTop10Streams($returnRequestTop10Streams);
echo $top10Streams;
echo "<a href='index.php'> << Previous </a><br><br>";
echo "<a href='./source.php?path=game.php'>View source</a>";
?>
 
<?php 
$path = __DIR__;
include __DIR__ . '/footer.php';