1

Topic: How about Twitch Stream Network/Community?

Teeworlds Twitch streams list
twitch.tv/phratrydeicide

Hi all,

I was pondering on alternative ways to make Teeworlds more popular. My idea is for everyone sharing their Twitch channels. We would all follow each other and get the followers counts up. Most likely, we'll end up only in the tens and optimistically hundreds of viewers but our goal will be to reach the front page of Twitch, which can be anywhere from 2.000 to 8.000 viewers.

Further, I was also thinking about a site/page using this modified version of this code which shows online status of a stream, taken from here for PHP:

<?php
if( isset( $_GET['streamID'] ) ) $streamID = $_GET['streamID'];
else $streamID = '';

if($streamID) {

    $stream=safe_query("SELECT * FROM ".PREFIX."streams WHERE streamID='".$streamID."'");
    while($ds=mysql_fetch_array($stream)) {

        $streamID = $ds['streamID'];
        $channel = $ds['channel'];
        $title = $ds['title'];
        $type = $ds['type'];
        $status = $ds['status'];
        $viewers = $ds['viewers'];
        $thumb = $ds['thumb'];
        $chat = $ds['chat'];

        if($type == 1) $chatz = '<div style="float:left;"><iframe width="650" height="400" frameborder="0" scrolling="no" id="chat_embed" src="http://twitch.tv/chat/embed?channel='.$chat.'&amp;popout_chat=true"></iframe></div>';

        // Advertising
        $allbanner = safe_query("SELECT * FROM ".PREFIX."bannerrotation WHERE displayed='1' AND bannertype='1' ORDER BY RAND() LIMIT 0,1");
        $total = mysql_num_rows($allbanner);
        if($total) {
            $banner = mysql_fetch_array($allbanner);
            $pub = '<div style="width:650px; height:80px; margin:10px 0px 10px 10px; float:left;"><a href="ads/out/'.$banner['bannerID'].'/" target="_blank"><img style="width:650px;" src="./images/bannerrotation/'.$banner['banner'].'" border="0" alt="'.htmlspecialchars($banner['bannername']).'" /></a></div>';
        }
        else $pub = '';


        eval("\$title_stream = \"".gettemplate("stream_header")."\";");
        echo $title_stream;

        if($type == 1) echo '<object type="application/x-shockwave-flash" height="360" width="670" id="live_embed_player_flash" data="http://en.twitch.tv/widgets/live_embed_player.swf?channel='.$channel.'" bgcolor="#000000"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" /><param name="movie" value="http://en.twitch.tv/widgets/live_embed_player.swf" /><param name="flashvars" value="hostname=en.twitch.tv&channel='.$channel.'&auto_play=true&start_volume=25" /></object>'.$pub.'';
        elseif($type == 2) echo '<iframe frameborder="0" scrolling="no" src="http://www.own3d.tv/liveembed/'.$channel.'?autoPlay=true" height="360" width="670"></iframe>'.$pub.'';

        eval("\$title_stream = \"".gettemplate("stream_bottom")."\";");
        echo $title_stream;

    }

}

else {

    $featured=safe_query("SELECT * FROM ".PREFIX."streams WHERE displayed='1' AND status='1' AND featured='1' ORDER BY viewers DESC");
    if(mysql_num_rows($featured)) {

        eval("\$title_streams = \"".gettemplate("streams_featured_header")."\";");
        echo $title_streams;

        while($ds=mysql_fetch_array($featured)) {

            $streamID = $ds['streamID'];
            $title = $ds['title'];
            $info = $ds['info'];
            $type = $ds['type'];
            $channel = $ds['channel'];
            $status = $ds['status'];
            $viewers = $ds['viewers'];
            $thumb = $ds['thumb'];

            $game = mysql_fetch_array(safe_query("SELECT tag FROM ".PREFIX."games WHERE gameID = '".$ds['gameID']."' LIMIT 0,1"));
            $game = $game['tag'];

            $country = mysql_fetch_array(safe_query("SELECT short FROM ".PREFIX."countries WHERE countryID = '".$ds['countryID']."' LIMIT 0,1"));
            $country = '<img src="images/flags/'.$country['short'].'.gif" width="18" height="12" style="margin: 3px 5px 0px 0px; float:left;" />';

            if($type == 1) $type_img = '<img src="gfx/streams/twitch.png" class="type" />';
            elseif($type == 2) $type_img = '<img src="gfx/streams/own3d.png" class="type" />';

            echo '<div class="sm_gallery" style="background:url('.$thumb.') #12181C; background-size: 249px 142px; width:216px;">
    <div class="gallery_overlay"><img src="images/games/'.$game.'.gif" alt="" />
    <small>'.$viewers.' VIEWERS</small><br/>
    <a href="stream/'.$streamID.'/">'.$title.'</a>
    </div>
</div>';

        }

        eval("\$title_streams = \"".gettemplate("streams_featured_bottom")."\";");
        echo $title_streams;

    }


    eval("\$title_streams = \"".gettemplate("streams_header")."\";");
    echo $title_streams;
    $streams=safe_query("SELECT * FROM ".PREFIX."streams WHERE displayed='1' AND status='1' AND featured='0' ORDER BY viewers DESC");
    if(mysql_num_rows($streams)) {

        while($ds=mysql_fetch_array($streams)) {

            $streamID = $ds['streamID'];
            $title = $ds['title'];
            $info = $ds['info'];
            $type = $ds['type'];
            $channel = $ds['channel'];
            $status = $ds['status'];
            $viewers = $ds['viewers'];
            $thumb = $ds['thumb'];

            $game = mysql_fetch_array(safe_query("SELECT tag FROM ".PREFIX."games WHERE gameID = '".$ds['gameID']."' LIMIT 0,1"));
            $game = $game['tag'];

            $country = mysql_fetch_array(safe_query("SELECT short FROM ".PREFIX."countries WHERE countryID = '".$ds['countryID']."' LIMIT 0,1"));
            $country = '<img src="images/flags/'.$country['short'].'.gif" width="18" height="12" style="margin: 3px 5px 0px 0px; float:left;" />';

            if($type == 1) $type_img = '<img src="gfx/streams/twitch.png" class="type" />';
            elseif($type == 2) $type_img = '<img src="gfx/streams/own3d.png" class="type" />';

            echo '<div class="sm_gallery" style="background:url('.$thumb.') #12181C; background-size: 249px 142px; width:216px;">
       <div class="gallery_overlay"><img src="images/games/'.$game.'.gif" alt="" />
    <small>'.$viewers.' VIEWERS</small><br/>
    <a href="stream/'.$streamID.'/">'.$title.'</a>
    </div>
</div>';

        }

    } else echo '<div style="margin: 7px 0px 0px 0px;float: left;">No Streams Available.</div>';
    eval("\$title_streams = \"".gettemplate("streams_bottom")."\";");
    echo $title_streams;
}
?>

An alternative with WordPress is here. Another alternative with HTML + Javascript is here, though I neither know how this one works or if it works at all, safely.

Of course, we can all go through this list, but the problem is that it doesn't show all channels (it surely doesn't show mine even with proper tagging, titles, etc.) so it could be a bit problematic.

Anyway, reply with your Twitch stream and we can start having some solid following. I'll see what I can do to keep the top post updated with the full list.

(Perhaps this post ought to be moved to Community News subforum. If mods can edit to update the list, that'd be great too.)