Forum: Ruby Cannot parseWikipedia Atom feed....

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Arun K. (Guest)
on 2009-04-28 13:01
Hi,
   I'm using net/http to parse the rss and atom feeds of various sites.
So far I was successful in that process except for wikipedia. When I try
to access the feed url related to a particular topic, a wikipedia eror
page is displayed showing an access denied error. I dont know whether it
is the problem related to my code or whether I need any API to parse the
feeds. My code to parse the feed is:

http = Net::HTTP.start(uri.host, uri.port)
         #making a request to the server
        if uri.query != nil
            response = http.get(uri.path+'?'+uri.query, 'User-Agent' =>
'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; Windows XP)')
        else
            response = http.get(uri.path, 'User-Agent' => 'Mozilla/4.0
(compatible; MSIE 5.5; Windows NT 5.0; Windows XP)')
        end

and this is the error :
Request: POST
http://www.wikipedia.com/w/index.php?title=Special...,
from 61.17.18.34 via sq16.wikimedia.org (squid/2.7.STABLE6) to ()
Error: ERR_ACCESS_DENIED, errno [No Error] at Tue, 28 Apr 2009 08:07:28
GMT

Can somebody please give me a suggestion.

Thanks
Arun
This topic is locked and can not be replied to.