1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
    header('content-type: image/png');
    
    $stream = $_GET['stream'];
    
    $json_file = @file_get_contents("http://api.justin.tv/api/stream/list.json?channel={$stream}", 0, null, null);
    $json_array = json_decode($json_file, true);
    
    if ($json_array[0]['name'] == "live_user_{$stream}") {
        echo file_get_contents("online.png");
    }else{
        echo file_get_contents("offline.png");
    }

?>