Results 1 to 7 of 7

Thread: No idea what I am looking for...

  1. #1
    Member
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    174

    No idea what I am looking for...

    Hey everyone!

    I am looking for a JavaScript to use on a site I made for my friend who does a radio program once a week. His show is on Friday nights from 11pm - 3am.

    The script I need will need to identify the users time zone and then if the correct time zone is shown, the page will display an "on air" button where the user can click on, and tune into the live streaming.

    I have no idea what or where to start looking, so I'd appreciate any kind of help!

    Thanks

    Griff

  2. #2
    Member
    Join Date
    Aug 2000
    Location
    Upstate, NY
    Posts
    227
    How about something like this?

    <script language="javascript" type="text/javascript">
    var doc = window.document;
    var dt = new Date();
    var utc = dt.getUTCHours();
    if(utc > 12 && utc < 17){
    doc.write("On Air");
    //doc.wiite('<img src="../images/onair.gif" alt="On Air" width="100" height="100">');
    }else{
    doc.write("Off Air");
    //doc.wiite('<img src="../images/onair.gif" alt="On Air" width="100" height="100">');
    }

    </script>

    The 12 and 17 are a guess based on your location in your profile. You can go to http://greenwichmeantime.com/ to get the correct time difference. I based this on Queensland which is +10.

    RnK

  3. #3
    Member
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    174
    RnK,
    Thanx dude! I'm not entirely sure that is what I'm after... It's a start though, and looks like what I need, but tell me... does the user have to be in the Queensland time zone for the example you gave me?
    I haven't quite got my head around this you see!
    I need something that will look up the users' location, time zone, date and then time. Then determine of the radio show is airing or not.

    Griff

  4. #4
    Member
    Join Date
    Aug 2000
    Location
    Upstate, NY
    Posts
    227
    No, the person who views the page can be anywhere. The show would have to be broadcasted from Queensland in order for the script to be correct (if it doesn't work check my math). UTC stands for Universal Time, which means when its 14:00 here in NY it's also 14:00 in Queensland. So if you find out what time the show is on in UTC, it will be the same time every where. If the show is not broadcast from Queensland (+10) you will need to adjust the 12 and 17 accordingly. You can use the URL I provided in my original post to find the correct times.

    RnK

  5. #5
    Senior Member
    United States kc's Avatar
    Join Date
    Jul 2000
    Location
    Just a wee bit too close to the guy with the Porsche.
    Posts
    924
    rnk,

    In your example, how is the day of the week added to it?
    As in Griffs example of Friday.

    Thanks
    A man sooner or later discovers that he is the master-gardener of his soul, the director of his life.
    ~ James Allen

  6. #6
    Member
    Join Date
    Mar 2002
    Location
    Australia
    Posts
    174
    RnK,

    Just another quick question regarding the code example you gave me... If the radio show goes for not four hours, but four and a half, how would I put that into the script?

    Griff

  7. #7
    Senior Member
    United States kc's Avatar
    Join Date
    Jul 2000
    Location
    Just a wee bit too close to the guy with the Porsche.
    Posts
    924
    Found a SSI script (free) named DJ Rotator.

    http://www.caseytechinc.com/djrotator.shtml

    Just thought you may be interested.
    A man sooner or later discovers that he is the master-gardener of his soul, the director of his life.
    ~ James Allen

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Looking for idea
    By Timx1981 in forum Client-side forum
    Replies: 2
    Last Post: 7th April 2004, 21:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •