Hi,
   I'm a new bee to Ruby and I'm trying to parse the html content from a
website using net/http. All urls work fine except for
"https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2%2Fwww.google.com%2Fcalendar%2Ffeeds%2F&session=0&secure=0&next=http%3A%2F%2Fwww.google.com";.
When I try to access this url I get an error like this :

/usr/lib/ruby/1.8/net/protocol.rb:135:in `sysread': Connection reset by
peer (Errno::ECONNRESET)
  from /usr/lib/ruby/1.8/net/protocol.rb:135:in `rbuf_fill'
  from /usr/lib/ruby/1.8/timeout.rb:62:in `timeout'
  from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
  from /usr/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
  from /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
  from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
  from /usr/lib/ruby/1.8/net/http.rb:2020:in `read_status_line'
  from /usr/lib/ruby/1.8/net/http.rb:2009:in `read_new'
  from /usr/lib/ruby/1.8/net/http.rb:1050:in `request'
  from ./rssModule.rb:40:in `extractor'
  from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
  from ./rssModule.rb:38:in `extractor'
  from ./rssModule.rb:19:in `each'
  from ./rssModule.rb:19:in `extractor'
  from rss.rb:38

I don't know exactly about the problem ie. whether it is OS dependent or
browser dependent etc.. My code snippet is shown below :
uri =
URI.parse("https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2%2Fwww.google.com%2Fcalendar%2Ffeeds%2F&session=0&secure=0&next=http%3A%2F%2Fwww.google.com";)
header = { "User-Agent"=>"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT
5.0)" }
http = Net::HTTP.new(uri.host, uri.port)
                         http.use_ssl()
                            http.start do |https|
                                request = Net::HTTP::Get.new(uri.path,
header)
                                response = https.request(request,
header)
                                response.value
                            end

Please help me. I'm in big trouble if I can't solve it.

Regards
Arun
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to