Jump to content

Shoutcast 'now playing' anyone?


PeterCanessa Oh
 Share

Recommended Posts

I wrote a script for this a couple of years ago but having now had to dig it out again I find it used some proprietary web-service that has since closed.

Anyone know how to get the Shoutcast 'now playing' information? I have'nt got a clue where to look, all I have is a bunch of stream URLs

Link to comment
Share on other sites

Something like this?

string music_url = ""; // leave music_url blank if set in object's descriptionkey HTTPRequest;string feed;string URL;string currSongTitle;string lastSongTitle;string lastSaid;list feedList;integer toggle = FALSE;fetch() { HTTPRequest=llHTTPRequest(URL + "/7.html HTTP/1.0\nUser-Agent: LSL Script (Mozilla Compatible)\n\n",[],""); }output(){    lastSongTitle = currSongTitle;    if ( toggle )    {        llSetText(currSongTitle,<0.7,0.9,0.7>,1.0);        if ( currSongTitle != lastSaid) // don't say the title if it has already been said and somebody gets click happy        {            llSay(0, currSongTitle);            lastSaid = currSongTitle;        }    }    else    {        llSetText(currSongTitle,<1.0,0.1,0.1>,1.0);    }}default{    state_entry()    {        if(music_url) URL = music_url;        else URL = llGetObjectDesc();        fetch();        llSetTimerEvent(15.0);    }    timer() { fetch(); }    touch_start(integer num_detected)    {        toggle = !toggle;        output();    }    http_response(key k,integer status, list meta, string body)    {        if(k != HTTPRequest) return;        feed = llGetSubString(body,llSubStringIndex(body, "<body>") + llStringLength("<body>"), llSubStringIndex(body,"</body>") - 1);        feedList = llParseString2List(feed,[","],[]);        currSongTitle = llList2String(feedList,6);        integer length = llGetListLength(feedList);        if(llList2String(feedList,7)) // in case there are commas in the song title        {            integer a = 7;            for(; a<length; ++a) currSongTitle += ", " + llList2String(feedList,a);        }        if (currSongTitle != lastSongTitle) { output(); } // don't send object updates if title hasn't changed    }}

 

Link to comment
Share on other sites

I just finished a set of scripts for a HUD that manages shoutcast stream info for me.  This is the mother of all shoutcast stream utilities -- it does EVERYTHING.  Because I use different streams depending on which venue I work, it lets me maintain a list of multiple streams and toggle which one(s) to fetch info from.  Because some venues let me set up my own tipjar and some provide one, and some venues already have a song title display but others I need to provide it, my HUD will send the song data to any number of different devices I keep around -- you could also have it send the song data to one of those big scrolling marquees, but I have not tried that.  But wait, there's more... I have some friends who listen to the show in RL, so for them I set up a web page where they can post song requests.  My HUD will pick up those requests and tell me when a new one comes in, plus let me delete them as I play them.

This sucker weighs in at almost 1100 lines of code and more than 50K of script memory.  It has more bells and whistles than Times Square on New Year's Eve.

Anybody interested in trying it out?  It seems a shame to not share it with others, but I have a feeling it may be too complicated for non-programmers so I could use another DJ's opinion of it.

 

Link to comment
Share on other sites


SegmentationFault String wrote:

I just finished a set of scripts for a HUD that manages shoutcast stream info for me.

 

We spoke in IM:

SegmentationFault then said that between writing this post and me contacting him LL changed the way HTTP works (ignore anything but port 80).  Anyone know more about that?

*sigh* I'm not having a good day.  Now SL has decided that my graphics card doesn't meet minimum requirements, despite having been fine for the past 4 years and being listed as compatible (although not recommended) on the sysreqs wiki pages :-(  I'd just put that down to SL giving odd messages since I haven't changed anything but the graphics card actually does stop and recover - throwing me out of SL in the process.

(ETA:  Ok, now I see his new thread on that topic.  Ignore it here)

Link to comment
Share on other sites

Hello, while Ardy Lay´s (hope i spelled your name right!) script is very helpful for DJs and this, more and more internet radio stations make it useless.  They don´t have the 7.html or whatever page to get the infos and alot are forcing you to use their own player.

I´m still working on a way to get this directly from the stream but that stupid thing called RL won´t leave me enough time :smileywink:

This would be an outside solution via PHP .....

Link to comment
Share on other sites

  • 3 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...