Results 1 to 11 of 11

Thread: Now Playing Script for Radio

  1. #1

    Now Playing Script for Radio

    Hi,

    I am looking for a script to show the current show on air with a picture of the dj, to be shown on the site of my radio station. An hourly update is sufficient. Appreciate if anyone can help.

    Thanks.

  2. #2
    Quote Originally Posted by shyamanthi View Post
    Hi,

    I am looking for a script to show the current show on air with a picture of the dj, to be shown on the site of my radio station. An hourly update is sufficient. Appreciate if anyone can help.

    Thanks.
    Just a few questions for you:

    What do you mean by "An hourly update is sufficient"?
    Is this radio show on a regular schedule?, like Monday - Friday, 5am - 10am?

    Also, what are you writing this in? C#, vb.net, classic asp, Javascript... etc?
    Last edited by Raydred; June 2nd, 2008 at 12:14 PM.
    ~Dred

    Website: www.raydred.com
    My Comic: www.thatcomicthing.com
    Twitter: @Raydred http://www.twitter.com/raydred

  3. #3
    Yes, the radio shows are fixed. like every monday 6 am to 10 am-morning cafe. I want it to be updated when the next show starts, along with the picture of th DJ.

    I wrote in this since it relates to scripts. Pardon me i f i am on the wrong thread. I am new here.


    Quote Originally Posted by Raydred View Post
    Just a few questions for you:

    What do you mean by "An hourly update is sufficient"?
    Is this radio show on a regular schedule?, like Monday - Friday, 5am - 10am?

    Also, what are you writing this in? C#, vb.net, classic asp, Javascript... etc?

  4. #4
    No problem this is the right place.

    The way i'd go about scripting this, would be to set a start datetime, and an end datetime, and seeing if the time right now is between those two times.

    What language will you be writing this in? If you tell me, i can write a small sample for you.
    ~Dred

    Website: www.raydred.com
    My Comic: www.thatcomicthing.com
    Twitter: @Raydred http://www.twitter.com/raydred

  5. #5
    Hi Raydred,

    Thanks a lot for your responses. Following is what I have adapted. But the problem is when it comes to weekend it plays hell. This is not a script written by me, but something i found on the net. (I am not much of a techie)

    When tested on sundays it shows all the wrong shows. Coul dyou please tell me if I am to put DH[0] or DH[7] for Sunday? Right now I have put [0].
    please the the script:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <head>
    <title>Station Activity</title>

    <style type="text/css">
    td { font-size:0.6em; } /* temporary for testing purposes */
    #NowOn {
    border: 0px solid black;
    font-size: 11.5px;
    color: black;
    background: transparent;
    height: 55px;
    width: 350px;
    }
    </style>

    <script type="text/javascript">

    /* NOT CURRENTLY USED
    var thedate = new Date();
    var dayofweek = thedate.getDay();
    var hourofday = thedate.getHours();

    var GMT = new Date().getTimezoneOffset();
    var offsetGMT = -5 * new Date().getTimezoneOffset()/60;
    */

    // Sun=0 1 2 3 4 5 Sat=6
    var DayOfWeek = new Array('Weekend','Monday','Tuesday','Wednesday','Th ursday','Friday','Weekend');

    var NoShow = 'No Show Scheduled<br />for KSWH';
    var DH = new Array (7);
    for (d=0; d<7; d++) {
    DH[d] = new Array (24);
    for (h=0; h<24; h++) { DH[d][h] = ''; }
    }

    DH[1][10] = 'Monday at 10 AM<br>Modern Rock<br>with Cody Graves';
    DH[1][12] = 'No Show Name<br>with DJ JT<br>Monday at Noon<br>No Genre';
    DH[1][14] = 'Real Talk<br>with DJ Yella<br>Monday at 2 PM<br>No Genre';
    DH[1][16] = 'No Show Name<br>with Katy Cox<br>Monday at 4 PM<br>Rap';
    DH[1][17] = 'The Greatest<br>with DJ Fresh<br>Monday at 5 PM<br>No Genre';
    DH[1][18] = 'Revolution Corner<br>with Randy Underwood<br>Monday at 6 PM<br>No Genre';
    DH[1][20] = 'Daily Affirmation<br>with DJ Hightower<br>Monday at 8 PM<br>No Genre';
    DH[1][22] = 'No Show Name<br>with David Doggett<br>Monday 10 to Midnight<br>No Genre';
    DH[1][23] = 'No Show Name<br>with David Doggett<br>Monday at 11 PM<br>No Genre';
    DH[2][13] = 'No Show Name<br>with Michelle Caillouet<br>Tuesday at 1 PM<br>Rock';
    DH[2][16] = 'No Show Name<br>with Sweet Action Jackson<br>Tuesday at 4 PM<br>Rock';
    DH[2][20] = 'The Rock Hour<br>with Dan the Man<br>Tuesday at 8 PM<br>No Genre';
    DH[3][10] = 'Love Me! Hate Me!<br>with DJ Nia<br>Wednesday at 10 AM<br>No Genre';
    DH[3][11] = 'Westcoast Wednesdays<br>with DJ Smoove<br>Wednesday at 11 AM<br>No Genre';
    DH[3][15] = 'The Storm Hour<br>with the Weatherman and Reba<br>Wednesday 3 to 5 PM<br>Classic Rock';
    DH[3][16] = 'The Storm Hour<br>with the Weatherman and Reba<br>Wednesday at 4 PM<br>Classic Rock';
    DH[3][22] = 'EZ Does It<br>with DJ EZ<br>Wednesday at 10 PM<br>Rap';
    DH[4][12] = 'The Quad Show<br>with J Bean & LongJohn<br>Thursday Noon to 2 PM<br>Rap/Urban';
    DH[4][13] = 'The Quad Show<br>with J Bean & LongJohn<br>Thursday at 1 PM<br>Rap/Urban';
    DH[4][14] = 'The Hour<br>with DJ V-Jeezy<br>Thursday at 2 PM<br>No Genre';
    DH[4][15] = 'No Show Name<br>with DJ Savana<br>Thursday at 3 PM<br>No Genre';
    DH[5][10] = 'Friday at 10 AM<br>Christian Music<br>with Jammin J';
    DH[5][11] = 'Friday at 11 AM<br>Christian Music<br>with Jammin J';
    DH[5][12] = 'Friday at Noon<br>Modern Rock<br>with Tag and Em';
    DH[5][13] = 'Friday at 1 PM<br>Modern Rock<br>with Tag and Em';
    DH[5][14] = 'Friday at 2 PM<br>Urban Music<br>with Brandon Tabor';
    DH[5][15] = 'Friday at 3 PM<br>Unknown Genre<br>with DJ Kevin';
    DH[5][16] = 'Friday at 4 PM<br>Urban Music<br>with Big Hampton';
    DH[5][17] = 'Friday at 5 PM<br>Urban Music<br>with Big Hampton';
    DH[5][22] = 'Friday at 10 PM<br>Modern Rock<br>with DJ Werewolf';
    DH[5][23] = 'Friday at 11 PM<br>Modern Rock<br>with DJ Werewolf';
    // Add more when schedule is known. Note: there may be better ways to do this when information is known.


    function OnNow() {
    var thedate = new Date();
    var dayofweek = thedate.getDay();
    var hourofday = thedate.getHours();
    // alert(dayofweek+':'+hourofday+'<br />'+DH[dayofweek][hourofday]);
    var showOn = DH[dayofweek][hourofday];
    if (showOn == '') { showOn = thedate+'\n\nNo Show Scheduled'; }
    alert(showOn);
    }

    function NowON() {
    var thedate = new Date();
    var dayofweek = thedate.getDay();
    var hourofday = thedate.getHours();
    var showOn = DH[dayofweek][hourofday];
    if (showOn == '') { showOn = thedate+'<p />No Show Scheduled'; }
    document.getElementById('NowOn').innerHTML = showOn;
    }
    </script>
    </head>
    <BODY onLoad="NowON()">
    <!-- Unhide this if table display desired
    <script type="text/javascript">
    document.write(TableStationSchedule())
    </script>
    -->
    <script type="text/javascript">
    document.write(NowON());
    </script>
    <div id='NowOn' onClick="NowON()">Click For Now On KSWH</div>
    </body>
    </html>

    Thanks

    Quote Originally Posted by Raydred View Post
    No problem this is the right place.

    The way i'd go about scripting this, would be to set a start datetime, and an end datetime, and seeing if the time right now is between those two times.

    What language will you be writing this in? If you tell me, i can write a small sample for you.

  6. #6
    From just looking at the script, Sunday would be dH[0]. Javascript arrays are zero based, meaning they start at 0, so something that has a size of 7 would be 0-6.

    so this might work (i havent tested it, so forgive me if it fails):

    Code:
    DH[0][10] = 'Sunday at 10 AM<br>Easy Listening<br>with John Adams';
    DH[0][12] = 'Sunday at 12 PM<br>The Comedy Hour<br>with Bo-Bo the Clown';
    
    DH[1][10] = 'Monday at 10 AM<br>Modern Rock<br>with Cody Graves';
    DH[1][12] = 'No Show Name<br>with DJ JT<br>Monday at Noon<br>No Genre';
    DH[1][14] = 'Real Talk<br>with DJ Yella<br>Monday at 2 PM<br>No Genre';
    DH[1][16] = 'No Show Name<br>with Katy Cox<br>Monday at 4 PM<br>Rap';
    DH[1][17] = 'The Greatest<br>with DJ Fresh<br>Monday at 5 PM<br>No Genre';
    DH[1][18] = 'Revolution Corner<br>with Randy Underwood<br>Monday at 6 PM<br>No Genre';
    DH[1][20] = 'Daily Affirmation<br>with DJ Hightower<br>Monday at 8 PM<br>No Genre';
    DH[1][22] = 'No Show Name<br>with David Doggett<br>Monday 10 to Midnight<br>No Genre';
    DH[1][23] = 'No Show Name<br>with David Doggett<br>Monday at 11 PM<br>No Genre';
    DH[2][13] = 'No Show Name<br>with Michelle Caillouet<br>Tuesday at 1 PM<br>Rock';
    DH[2][16] = 'No Show Name<br>with Sweet Action Jackson<br>Tuesday at 4 PM<br>Rock';
    DH[2][20] = 'The Rock Hour<br>with Dan the Man<br>Tuesday at 8 PM<br>No Genre';
    DH[3][10] = 'Love Me! Hate Me!<br>with DJ Nia<br>Wednesday at 10 AM<br>No Genre';
    DH[3][11] = 'Westcoast Wednesdays<br>with DJ Smoove<br>Wednesday at 11 AM<br>No Genre';
    DH[3][15] = 'The Storm Hour<br>with the Weatherman and Reba<br>Wednesday 3 to 5 PM<br>Classic Rock';
    DH[3][16] = 'The Storm Hour<br>with the Weatherman and Reba<br>Wednesday at 4 PM<br>Classic Rock';
    DH[3][22] = 'EZ Does It<br>with DJ EZ<br>Wednesday at 10 PM<br>Rap';
    DH[4][12] = 'The Quad Show<br>with J Bean & LongJohn<br>Thursday Noon to 2 PM<br>Rap/Urban';
    DH[4][13] = 'The Quad Show<br>with J Bean & LongJohn<br>Thursday at 1 PM<br>Rap/Urban';
    DH[4][14] = 'The Hour<br>with DJ V-Jeezy<br>Thursday at 2 PM<br>No Genre';
    DH[4][15] = 'No Show Name<br>with DJ Savana<br>Thursday at 3 PM<br>No Genre';
    DH[5][10] = 'Friday at 10 AM<br>Christian Music<br>with Jammin J';
    DH[5][11] = 'Friday at 11 AM<br>Christian Music<br>with Jammin J';
    DH[5][12] = 'Friday at Noon<br>Modern Rock<br>with Tag and Em';
    DH[5][13] = 'Friday at 1 PM<br>Modern Rock<br>with Tag and Em';
    DH[5][14] = 'Friday at 2 PM<br>Urban Music<br>with Brandon Tabor';
    DH[5][15] = 'Friday at 3 PM<br>Unknown Genre<br>with DJ Kevin';
    DH[5][16] = 'Friday at 4 PM<br>Urban Music<br>with Big Hampton';
    DH[5][17] = 'Friday at 5 PM<br>Urban Music<br>with Big Hampton';
    DH[5][22] = 'Friday at 10 PM<br>Modern Rock<br>with DJ Werewolf';
    DH[5][23] = 'Friday at 11 PM<br>Modern Rock<br>with DJ Werewolf';
    
    DH[6][8] = 'Saturday at 8 AM<br>Saturday Morning Radio Theater<br>with Artie Deringer';
    DH[6][14] = 'Saturday at 2 PM<br>Cookin with Mother Sandy<br>with Sandy Perkins';
    Hope this helps.
    ~Dred

    Website: www.raydred.com
    My Comic: www.thatcomicthing.com
    Twitter: @Raydred http://www.twitter.com/raydred

  7. #7
    thanks a lot for your response. Will let you know the results soon.

  8. #8
    Quote Originally Posted by shyamanthi View Post
    thanks a lot for your response. Will let you know the results soon.
    If you need it to look a certain way, send me a link of how it should look and I can help you write a script (or modify the one you have) to make that look good and function well.
    ~Dred

    Website: www.raydred.com
    My Comic: www.thatcomicthing.com
    Twitter: @Raydred http://www.twitter.com/raydred

  9. #9
    sounds great, and i really appreciate your help. Write now this is working for the weekdays. So I will wait to see how it goes on sat & sun. An will get back to u.

    Thanks a load

  10. #10
    Hi Raydred,

    My method doesn't seem to work . The clock takes only the client time, not the server time. So what happens is a person viewing the site from another country sees a different show on air. i called for UTC time, but still no chance. If you have a solution please let me know, else i will look into some other method. since my pages are in html i cannot have this in .asp either.

    Thanks

  11. #11
    Quote Originally Posted by shyamanthi View Post
    Hi Raydred,

    My method doesn't seem to work . The clock takes only the client time, not the server time. So what happens is a person viewing the site from another country sees a different show on air. i called for UTC time, but still no chance. If you have a solution please let me know, else i will look into some other method. since my pages are in html i cannot have this in .asp either.

    Thanks
    Oh duh! Yea of course. Javascript runs on your local computer, so the time is taken from there. I suppose you could try to determine what timezone the local pc is in, and add or subtract hours to convert it to your timezone.

    If that won't work, then the only other option I can think of would be serverside, like asp.
    ~Dred

    Website: www.raydred.com
    My Comic: www.thatcomicthing.com
    Twitter: @Raydred http://www.twitter.com/raydred

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012