Editing Widgets

Discussion in 'Mac Programming' started by -i2i-, Aug 10, 2005.

  1. -i2i- macrumors newbie

    Joined:
    Sep 4, 2004
    Location:
    UK
    #1
    Hi, I am a noob at programming and apart from a making some calculator at scchool have never done any.

    Anyway I upgraded to Tiger yesterday and am loving the dashboard widgets, one in particular though - BBC Listen Live (http://www.apple.com/downloads/dashboard/radio_podcasts/bbclistenlive.html).

    The thing is that it doesn't have my local BBC radio station, BBC 3 Counties. What I want to do is to try and edit the code and make it so that aswell the included stations it also has my local station. The station is here: http://www.bbc.co.uk/threecounties (Here to listen live: http://www.bbc.co.uk/radio/aod/three.shtml)

    I read on Apple that its in HTML only I had a look and it was just an image. Has anyonw got any hints or can anyone give me a hand in doing this? Thanks,
     
  2. Wes macrumors 68020

    Wes

    Joined:
    Jun 22, 2001
    Location:
    London
    #2
    For some reason I can't get that widget to work, rather irritating but I took a look at it for you. Select the widget file in the finder, right-click, show package contents.

    Then open RadioPlayer.js in a text editor.

    This part is what you'll have to edit by the looks of things:

    Code:
    station_info[0] = new Array("Radio 1", "/radio1/realaudio/media/r1live", "Images/radio1_bg.png",0);
    station_info[1] = new Array("Radio 2", "/radio2/realmedia/fmg2", "Images/radio2_bg.png",1);
    station_info[2] = new Array("Radio 3", "/radio3/ram/r3g2", "Images/radio3_bg.png",2);
    station_info[3] = new Array("Radio 4", "/radio4/realplayer/media/fmg2", "Images/radio4_bg.png",3);
    station_info[4] = new Array("Five Live", "/fivelive/live/surestream", "Images/5live_bg.png",4);
    station_info[5] = new Array("1xtra", "/1xtra/realmedia/1xtralive", "Images/1xtra_bg.png",5);
    station_info[6] = new Array("6 Music", "/6music/ram/dsatg2", "Images/6music_bg.png",6);
    station_info[7] = new Array("BBC 7", "/bbc7/realplayer/dsatg2", "Images/bbc7_bg.png",7);
    station_info[8] = new Array("Asian Network", "/asiannetwork/rams/asiannetwork", "Images/asian_bg.png",8);
    station_info[9] = new Array("World Service", "/worldservice/ram/live_infent", "Images/world_bg.png",9);
    
    I'll give it another look in a couple of minutes and post back with what I find. Looks promising so far though...
     
  3. Wes macrumors 68020

    Wes

    Joined:
    Jun 22, 2001
    Location:
    London
    #3
  4. -i2i- thread starter macrumors newbie

    Joined:
    Sep 4, 2004
    Location:
    UK
    #4
    Man thats awesome, and fast too :eek:. It looks really nice having added the logo on. Cheers mate, I'll use it alot. :)

    Now that you've shown me how to do it I may try and get rid of the stations that I'm never going to use (Asain Network etc.) and replace them with Virgin or Talk Sport. One last question - where did you find the address for the feed from? (I had a look at the page source but couldn't see it?)
     
  5. Wes macrumors 68020

    Wes

    Joined:
    Jun 22, 2001
    Location:
    London
    #5
    There may be a faster way but here is how I did it:

    Go to the website: http://www.bbc.co.uk/radio/aod/mainframe.shtml?http://www.bbc.co.uk/radio/aod/three.shtml

    Menu: View: View source.

    This reveals a frameset. No code about embedding audio here...

    So, right click the frame with the player (anywhere below the real player plugin will do) and click to "open frame in new window". View source on this page and a little bit down you'll see:

    var AudioStream = "/england/realmedia/live/localradio/threecounties";

    There's your URL :). Good luck
     

Share This Page