Readme for the parser
first of all be sure in the xml to convert all characters which have special symbols:
& - &
< - <
> - >
" - "
' - '
There is a log file for the parser too. Check if it doesnt work to get more information on the parsing progress.
Here the structure of the xml file for the station (sample):
Radio Hamburg // long radio name
RHH // short radio name used for the direct buttons
auf 103.6 - der Mix macht's // description of the station
http://www.radiohamburg.de // homepage of the station
1 // for later use in the bouquet selection
Radio Hamburg.png // name of the logo png, should be transparent
German // for later use bouquet name
Mixed // for later use category
German // for later use language
de // for the diplay of the country
Good // indicater of quality
http://lsd.newmedia.tiscali-business.com/bb/redirect.lsc?content=live&media=ms&stream=radiohamburg/livestream.wma // stream url
radiohamburg/livestream.wma // special for german tiscali streams
1 // methode of the parser
http://www.radiohamburg.de // this is the request link
>Webradio: // search string
2 // offset of lines
alt=" // start sequence
// alaternate start sequence
" // stop squence
mit // devider of artist / title
src=" // image start sequence
http://www.radiohamburg.de // image url if different
no // swap artist /title
Of course I can not do all websites but my idea was to try to make the parser lexible as much as possible
So here my methods, which are maybe extended later
Method 0 ( no parsing )
Method 1 ( "Artist - Title" is somewhere on a webpage )
Get the url
search in all lines for
add lines
then
take that line and get data from to
use the to split into artist,title
use the same line and search for to to get the image path
if the path not starts with "http" add the to the path
Method 2 ( "Artist" and "Title" somewhere on page or result from php or xml)
Get the url
search in all lines for to ( artist )
search in all lines for to ( title )
only the fist hit will be used. Remember this if there are multiple lines
Method 3 ( "Artist" and "Title" somewhere on page or result from php or xml)
Get the url
search in all lines for to ( title )
search in all lines for to ( artist )
the last hit will be used. Remember this if there are multiple lines
Method 4 ( XML Reader )
get the xml file
is the element for title
is the element for artist
is the element for image. will be added if not starting with "http"
Method 5 ( eperimental right now )