I need PHP script that will parse XML-based (.xspf format) live stream playlist stored on web server, retrieve track data and print it on my web page. Print inside div as scrolling text (one line). The track data on page need be refreshed synchronously to show current track info.
XSPF playlist example:
<?xml version="1.0" encoding="UTF-8"?>
<playlist xmlns="http://xspf.org/ns/0/" version="1">
<title/>
<creator/>
<trackList>
<track>
<location>http://geodesid5.streams.audioveduct.com:80/di_ambient7</location>
<title>Bruno Sanfilippo - Piano Textures 2 II</title>
<annotation>Stream Title: Ambient - DIGITALLY IMPORTED - a blend of ambient, downtempo, and chillout
Content Type:audio/mpeg
Current Listeners: 0
Peak Listeners: 0
Stream Genre: Electronic Ambient Downtempo</annotation>
<info>http://www.di.fm</info>
</track>
</trackList>
</playlist>
I need get data from fields 'title' and 'annotation' (only text between Stream Title and Content Type). Also, after these two, I want scroll small custom text, when required. I searched some close example, but didn't find yet.
Will be DOMDocument method suitable for this task? Can someone show me the right method to do this?