mauricioarango Posted February 22, 2008 Share Posted February 22, 2008 Hi, I have a script that downloads rss news feeds, and then classifies and stores them based on a given criteria. Everything works well on my local machine, but on the final server the script just stops working half way through. It doesn't give any error messages or anything that can help pin point the problem. if anyone has any idea I would greatly appreciate it. // at the beginning of my code: error_reporting(E_ALL); ini_set('error_reporting', E_ALL); set_time_limit(1800); // this section downloads each of the rss feeds for($ii = 1; $ii <= $rss_parser->newspapercount; $ii++) { $xml_parser = xml_parser_create('UTF-8'); xml_set_object($xml_parser,&$rss_parser); $rss_parser->setURL($ii); // url of rss feed xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_character_data_handler($xml_parser, "characterData"); echo "<br>Trying to connect to $rss_parser->server ... "; // gets the full rss feed if ($f = @fopen($rss_parser->url, 'r')) { $rss_content = ''; while (!feof($f)) { $rss_content .= fgets($f, 4096); } fclose($f); // once rss is downloaded processes the feed xml_parse($xml_parser, $rss_content, true) or 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); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.