Kod
<?php
$gc = json_decode(file_get_contents("https://api.dailymotion.com/videos/?ids=xzmt6i&fields=title,genre,onair,tag,audience&limit=25"), true);
$twitch = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/soushibo'), true);
$twitchkasia = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/brunecia'), true);
$twitchbrot = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/okaybrot'), true);
$gcbrot = json_decode(file_get_contents("https://api.dailymotion.com/videos/?ids=xzmt6i&fields=title,genre,onair,tag,audience&limit=25"), true);
$twitchbonkol = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/bonkol'), true);
$twitchyooguruto = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/yooguruto'), true);
$twitchzmiju = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/zmiju97'), true);
?>
$gc = json_decode(file_get_contents("https://api.dailymotion.com/videos/?ids=xzmt6i&fields=title,genre,onair,tag,audience&limit=25"), true);
$twitch = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/soushibo'), true);
$twitchkasia = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/brunecia'), true);
$twitchbrot = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/okaybrot'), true);
$gcbrot = json_decode(file_get_contents("https://api.dailymotion.com/videos/?ids=xzmt6i&fields=title,genre,onair,tag,audience&limit=25"), true);
$twitchbonkol = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/bonkol'), true);
$twitchyooguruto = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/yooguruto'), true);
$twitchzmiju = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/zmiju97'), true);
?>
odczytuję to tak:
Kod
<?php echo "".$twitch["stream"]["viewers"];
if($twitch["stream"]["viewers"] == null)
echo "OFF";?></font>
<br>
(Dałem tylko 1 echo, żeby zobaczyć jak to wygląda. Odczytywanie reszty wygląda tak samo. Problem w tym, że strona muli. Można to zaobserwować tutaj:if($twitch["stream"]["viewers"] == null)
echo "OFF";?></font>
<br>
Kod
http://monaris.blutu.pl/
. Jest jakaś możliwość optymalizacji tego? Czy przez jquery będzie to działać lepiej?