$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, 'startElement', 'endElement');
xml_set_character_data_handler($xml_parser, "characterData");
$title = ("Rugby");
$exclude = array ('www.','.ecatalog.it');
$title = str_replace ($exclude, '', $title);
$title = str_replace ('-', ' ', $title);
// Title of your site
$sitetitle = $title;
$sitetitle2 = str_replace (' ', '+', $sitetitle);
$ciccio = ("http://search.msn.it:80/results.aspx?q=$sitetitle2&format=rss&FORM=R0RE");
$fp = fopen($ciccio,'r')
or die('Error reading RSS data.');
while ($data = fread($fp, 4096)) {
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf('XML error: %s at line %d',
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
}
fclose($fp);
xml_parser_free($xml_parser);
?>
|