• "; $urlparts = parse_url($url); if ($urlparts[path] == "") $url .= "/"; if ($fp = @fopen($url, "r")) { while (!feof($fp)) { $data .= fgets($fp, 128); } fclose($fp); } // print "
        ";
        //  print htmlentities($data);  
        
          eregi("

        (.*)

        ", $data, $title); $channel_title = trim(ereg_replace("","",$title[1])) ; $itemregexp = "%simpleBlogTitle *\" *>(.+?)%is"; $match_count = preg_match_all($itemregexp, $data, $titles); $match_count = ($match_count > 200) ? 200 : $match_count; $itemregexp = "%simpleBlogTitle *\" *>(.+?)%is"; $match_count = preg_match_all($itemregexp, $data, $links); $match_count = ($match_count > 200) ? 200 : $match_count; $itemregexp = "%BlogByLine *\" *>(.+?)%is"; $match_count = preg_match_all($itemregexp, $data, $dates); $match_count = ($match_count > 200) ? 200 : $match_count; $itemregexp = "%description *\" *> *(.*?)
        \n%is"; $match_count = preg_match_all($itemregexp, $data, $texts); $match_count = ($match_count > 200) ? 200 : $match_count; header("Content-Type: text/xml"); $output = ' '.$channel_title.' '.$url.' '.$channel_title.': ultimi post it_IT '.$author.' '.date("Y-m-d\TH:i:s+02:00").' '; for ($i=0; $i< $match_count; $i++) { $link = substr($links[1][$i],strpos($links[1][$i],'"')+1,strpos($links[1][$i],'"',strpos($links[1][$i],'"')+1)-9); $link = get_link($links[0][$i],$url); $output .= ' '."\n"; } $output .=' '; for ($i=0; $i< $match_count; $i++) { $item_url = get_link($desc, $url); $desc = strip_tags($desc, $allowable_tags); $desc = htmlentities($desc); $link = get_link($links[0][$i],$url); $date = get_date($dates[0][$i]); $output .= " \n"; $output .= " ". trim(ereg_replace(" ", " ",htmlspecialchars(strip_tags($titles[1][$i]), ENT_QUOTES, "UTF-8")))."\n"; $output .= " ". $link ."\n"; $output .= " ". date("Y-m-d\TH:i:s+02:00",$date) ."\n"; $output .= " ". $author ."\n"; $output .= " \n"; $output .= " \n"; } $output .= "\n"; print $output; // print htmlentities($output); // print "
        "; } function get_link($desc, $url) { if (stristr($desc, "href")) { $linkurl = stristr($desc, "href"); $linkurl = substr($linkurl, strpos($linkurl, "\"")+1); $linkurl = substr($linkurl, 0, strpos($linkurl, "\"")); $linkurl = trim($linkurl); return $linkurl; } else { return $url; } } function get_date($desc) { $rows = explode("\n", $desc); $myrow = $rows[2]; $day = substr($myrow, 4, 2); $month = substr($myrow, 7, 2); $year = substr($myrow, 10, 4); $hour = substr($myrow, 15, 2); $minute = substr($myrow, 18, 2); if(substr($myrow, 21, 2) == "PM") $hour = $hour + 12; return strtotime($year."-".$month."-".$day." ".$hour.":".$minute.":00"); } ?>