Forum Discussion
RokuJoel
13 years agoBinge Watcher
Most shoutcast servers have a few places where you can get the song data.
http://server.com:port/7.html will give you the name of the song, you will need to strip out the info there that isn't relevant, and be aware it isn't always the same from one song to the next, you will also have to handle weird characters in song titles like umlauts without crashing your channel.
http://server.com:port/played.html will give you a list of recently played songs usually but not always including the currently playing song (I believe 7.html is the most accurate for what is actually being played on the server). Due to the possibility that there may be a large amount of buffered data on the device, it is possible that the server has already moved on to the next song but the Roku is still playing the last song.
In both these cases you will need to use a few different tools to parse the data, for example the tokenize(",") will convert 7.html to an array. For played.html you will either figure out a way using regex if you are a regex jockey, or you will use left() right() mid() and instr() and also will probably need a replaceSubstring function. There also should be some html tag stripping functions of use in urlUtils.brs and generalUtlis.brs floating around in the Roku SDK.
- Joel
http://server.com:port/7.html will give you the name of the song, you will need to strip out the info there that isn't relevant, and be aware it isn't always the same from one song to the next, you will also have to handle weird characters in song titles like umlauts without crashing your channel.
http://server.com:port/played.html will give you a list of recently played songs usually but not always including the currently playing song (I believe 7.html is the most accurate for what is actually being played on the server). Due to the possibility that there may be a large amount of buffered data on the device, it is possible that the server has already moved on to the next song but the Roku is still playing the last song.
In both these cases you will need to use a few different tools to parse the data, for example the tokenize(",") will convert 7.html to an array. For played.html you will either figure out a way using regex if you are a regex jockey, or you will use left() right() mid() and instr() and also will probably need a replaceSubstring function. There also should be some html tag stripping functions of use in urlUtils.brs and generalUtlis.brs floating around in the Roku SDK.
- Joel