PDA

View Full Version : Thread: Countdown to time every day + 'Live' if stream is online



Rubens
12-31-2014, 10:53 PM
Hello people,

I am looking for a script that does the following:
- Will count down to 7.30 PM GMT every day and automatically reset itself back to counting down to 7.30 PM GMT every day.
- I have a script to show if a streamer on Twitch is live or not. When the streamer is live, I would like it to show 'Live now' instead of the countdown to 7.30 PM GMT. When the streamer is offline (or goes from being online to offline), I would like it to countdown to 7.30 PM GMT again.

This is my script for the status of the Twitch streamer:

jQuery(document).ready(function($) {
$('.ltwitch').each(function () {
var tnick = $(this).data('tnick');
var span = $(this).next();
$.getJSON("https://api.twitch.tv/kraken/streams/"+tnick+".json?callback=?", function(c) {
if (c.stream == null) {
span.html('<img style="float:left;margin-right:5px;padding-top:5px;height:100%;" src="images/offline.png" alt="offline" height="25" width="25"><span style="color:red;font-size:25px;">Offline</span>');
} else {
span.html('<img style="float:left;margin-right:5px;padding-top:5px;height:100%;" src="images/online.png" alt="offline" height="25" width="25"><span style="color:green;font-size:25px;">Online</span>');
}
});
});
});

I have looked at scripts to do this, however I can not find anything to suit my needs. I would really appreciate it if any of you could help me. Thank you!