Hallo ik heb een twitch stream status checker gemaakt en het werkt Xp
nu wil ik in een ander document het script includen maar het probleem is dat het script met Variables werkt
dus nu is mijn vraag hoe kan ik dat doen
Status script:
<?php
$channelName = htmlspecialchars($_GET['channel'], ENT_QUOTES);
$clientId = ''; // Register your application and get a client ID at http://www.twitch.tv/settings?section=applications
$online = 'twitchimg/online.png'; // Set online image here
$offline = 'twitchimg/offline.png'; // Set offline image here
$json_array = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/'.strtolower($channelName).'?client_id='.$clientId), true);
if ($json_array['stream'] != NULL) {
$channelTitle = $json_array['stream']['channel']['display_name'];
$streamTitle = $json_array['stream']['channel']['status'];
$currentGame = $json_array['stream']['channel']['game'];
echo "<a href='http://www.twitch.tv/".$channelTitle."'; style='text-decoration: none'>$channelTitle is <img src='$online' alt='Online' /> playing $currentGame";
} else {
echo "$channelName is <img src='$offline' alt='Offline' />";
}
?>
ik zou het dus zo willen maken dat ik meer dan 1 streamer kan op de pagina can includen/echo
2.093 views