HTTP/1.0 503 Service Unavailable error with Google News feed?
Hello, I am trying to figure out why this is happening. I hope you'll be able to help. :) Here's my site: [url]buygoldusa.org/[/url] An you can see the error messages when trying to access this Google News RSS feed: [url]news.google.com/news?hl=en&q=gold+price&output=rss[/url] Also, when I enter that RSS url into your test page, it works fine: scriptol.com/rss/rss-single.php I am just using this code in my page:
require_once("rsslib.php"); $xml = ('news.google.com/news?hl=en&q=gold+price&output=rss'); echo RSS_Display($xml, 3);Any ideas? Thanks, meeble
Hello, I have tested the reader with this feed on two sites: http://www.scriptol.com/rss/rss-single.php Works fine. http://www.scriptol.fr/rss/rss-simple.php Does not work. It is exactly the same code. But not same servers. I can not figure out what is the difference for now. Not the country apparently since you site is hosted in the USA. Could you try the reader with other feeds? My idea is that some servers allow to load a remote PHP file with parameters while others do not.
Yes, your script works fine for many RSS feeds. When I changed from that Google news feed to several other feeds, the code works fine. I assume that Google is doing something to block the request. At first I tried to change PHP's user-agent, but so far that didn't help. I was hoping that you would have a solution. :\
This is not Google, this is probably parameters (stuff following ? in the URL). Have you tried other feeds with parameters? You may also test the Curl code that is commented in the source. [url=http://wiki.dreamhost.com/index.php/CURL]See the doc[/url]
Yes, I have tried other feeds with parameters. Such as: [url]news.search.yahoo.com/rss?ei=UTF-8&p=gold+news&fr=news-us-ss[/url] which works fine. Several others like this work fine. The ONLY one that doesn't work is that Google News feed.
My last idea is in the doctype. You do not have a doctype in your site. Try to put this in the first line of the page:
<!DOCTYPE html>The doctype is missing in the Google feed, while it is present in other examples.
I added the <!DOCTYPE html> code, but still, the Google News feed doesn't work. Strange. What about on your two sites - one worked for that feed, and one didn't. What are the differences between those sites? - Devin
No, the "http : //" was in the code, somehow it got removed when posting here. Very odd issue...
I have tried the cURL library on the two sites, with this code:
$url="http://news.google.com/news?hl=en&q=gold+price&output=rss"; $hnd=curl_init(); curl_setopt($hnd,CURLOPT_CONNECTTIMEOUT,5); curl_setopt($hnd,CURLOPT_URL,$url); $page=curl_exec($hnd); curl_close($hnd); $doc=new DOMDocument("1.0"); $doc->loadXML($page); echo $doc->saveXML();It works on the first host and not the other. This is definitively how PHP is configured on the server or maybe the version. This same PHP code works perfectly for the feed of Yahoo! on the two hosts.
The difference is in the host. Another point is the http:// missing in the URL of the feed. That could make a difference.