Hola de Nuevo,
He visto que en php no puedo hacer que cada minuto consulte el documento xml...
Asi que necesitaria saber como hacer la lectura del documento en javascript...?
He desarrollado este codigo pero no me funciona.
Código Javascript
:
Ver originalfunction cargarXML()
{
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load("http://www.radiocarmelo.eu/temas.xml");
document.write("<html>");
document.write("<body >");
$song = xmlDoc.getElementsByTagName("Event")[0].("Song")[0].firstChild.nodeValue
}
document.write("</body>");
document.write("</html>");
Y este es el xml
- <Schedule System="Jazler">
- <Event status="happening" startTime="12:47:29" eventType="song">
<Announcement Display="Estas escuchandor:" />
- <Song title="Comadre">
<Album title="20 aros de Carlotas" />
- <Artist name="Las Carlotas">
<Media runTime="216.958" />
<Expire Time="12:51:05" />
<TrackID AUID="11243" />
</Artist>
</Song>
</Event>
</Schedule>
Y este el codigo bueno en php:
Código PHP:
Ver original<?php
$xml = new SimpleXMLElement('http://www.radiocarmelo.eu/temas.xml', null, true);
$song = $xml->Event->Song['title'];
$album = $xml->Event->Song->Album['title'];
$artist = $xml->Event->Song->Artist['name'];
$status = $xml->Event->Announcement['Display'];
$temaonline = "ARTISTA: ".$artist." - TEMA: ".$song." - ALBUM: ".$album."";
?>