xml substitution into http meta refresh
I have an XML document
yourboyvic.com/albumart/now_playing.xml
in this XML doc there is an element
<time>
the objective
use this <time> element
in http meta refresh code
<meta http-equiv="refresh" content="30">
so that <time>+1 injected into content
so that instead of content="30"
content="whatever number is <time>+1 on yourboyvic.com/albumart/now_playing.xml"
in short, a code substitution
the end goal, instead of my page refreshing every thirty seconds,
my page refresh countdown will be equivalent to when the current song ends plus one second
so that the albumart showing is always the current song playing
preferably in php+html
kind of like this…
<?php>
$file = file_get_contents("albumart/now_playing.xml");
$time = "";
preg_match("/<time><!\[CDATA\[([^\]]+)\]\]><\/time>/sim", $file,
$time_matches);
if (isset($time_matches[1])) {
$title = $time_matches[1];
}
<html>
<meta http-equiv="refresh" content="" . $time . "">
</html>
?>
Last edited by yourboyvic; 10-28-2008 at 02:18 PM..
|