Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $cachefile2 = "/tmp/website_cache/stream_moosh";
- if (!cachePre($cachefile2, 300)) {
- $ch = curl_init('https://api.twitch.tv/kraken/streams/the_mushroomcow');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_NOSIGNAL, 1);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);
- curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1000);
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- $data = curl_exec($ch);
- $curl_errno = curl_errno($ch);
- if ($curl_errno == 0) {
- $meta = json_decode($data);
- if (json_last_error() == 0 && $meta !== FALSE) {
- if($meta->stream != NULL) {
- ?>
- <div class="newsPost">
- <div class="bgFrame">
- <div class="lightBG newsHeader">
- <div class="newsSubject cufonreplace" style="<?=$imageTwitch?>">
- Mooshrooms Stream
- </div>
- </div>
- <div class="newsContent compact">
- <object type="application/x-shockwave-flash" height="208" width="244" id="live_embed_player_flash" data="http://www.twitch.tv/widgets/live_embed_player.swf?channel=the_mushroomcow" bgcolor="#000000">
- <param name="allowFullScreen" value="true" />
- <param name="allowScriptAccess" value="always" /><param name="allowNetworking" value="all" />
- <param name="movie" value="http://www.twitch.tv/widgets/live_embed_player.swf" />
- <param name="flashvars" value="hostname=www.twitch.tv&channel=the_mushroomcow&auto_play=true&start_volume=25" />
- </object>
- </div>
- </div>
- </div>
- <?
- }
- }
- }
- cachePost($cachefile2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement