well, i got bored one day and tried some xml parsing based on some examples i found on the web for Listen-to. don't know if anyone is interested. Prolly not very efficient but hey. I basically just made it output an image (which you can already do) but you could do anything you want with the data. comments are good
PHP Code:
<?php
$file= "http://www.listen-to.com/xml.php/trashed20";
$depth = array();
$data1=array();
function startElement($parser, $name, $attrs) {
global $name;
global $depth;
for ($i = 0; $i < $depth[$parser]; $i++) {}
$depth[$parser]++;
}
function endElement($parser, $name) {
global $depth;
$depth[$parser]--;
}
function characterData($parser, $data) {
global $data1;
if ($data!=" "){$data1[] =$data;}}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
if (!($fp = fopen($file, "r"))) {
die("could not open XML input");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
}
xml_parser_free($xml_parser);
header ("Content-type: image/jpeg");
$im = @imagecreatefromjpeg ("temp2.jpg");
$tc = imagecolorallocate ($im, 255, 255, 255);
$time=date("m/d/y g:i a",$data1[11]);
$track=$data1[7];
$group=$data1[3];
imagestring ($im, 3, 230, 7, $time, black);
imagestring ($im, 3, 126, 31, $group, black);
imagestring ($im, 3, 136, 52, $track, black);
imagejpeg ($im,"",85);
?>