error_reporting(0); // This program is public domain. Do with this what you want. // // Disclaimer. Don't expect this to be here, to work, or to get fixed. // But if you have a question or comment, email: mailto:julian_bond@voidstar.com // // If you're using Gnews2rss you presumably find it useful. // Please email Google (news-feedback@google.com) asking them to produce RSS // directly out of Google News Search. // // And why not host it yourself to save my bandwidth costs. // Note: This version requires curl support in your php installation $q=$_GET['q']; if ($q) { parse_html($q); } else { show_form(); } //**************** function show_form() { $server = getenv("SERVER_NAME"); $request = getenv("REQUEST_URI"); ?>
An experimental convertor that takes a Google News search and turns it into RSS
"); eregi("
"; $num = ($num) ? $num+1 : 16 ; $url = "http://news.google.com/news?hl=en&num=$num&scoring=d&q=".urlencode($q); if ($fp = @fopen($url, "r")) { while (!feof($fp)) $data .= fgets($fp, 128); fclose($fp); } // ******************* // Some people seem to have problems with google not returning anything // uncomment the following lines and comment out the content-type header // to see what google is returning. // print ""; // print "
"; // print htmlentities($data); header("Content-Type: text/xml"); $data = strstr($data,"Sorted by date
"; // print htmlentities($output); // print ""; } ?>