Problem of trying to get gmail atom feed in ruby

Discussion in 'Ruby' started by Carfield Yim, May 30, 2008.

  1. Carfield Yim

    Carfield Yim Guest

    I write some simple ruby code to try to get gmail atom feed:

    http = Net::HTTP::new('mail.google.com', 443);
    http.use_ssl = true ;
    http.start {
    request = Net::HTTP::Get.new('/mail/feed/atom"');
    request.basic_auth(USERNAME,PASSWORD);
    response = http.request(request)
    response.value
    puts response.body
    }

    But it is fail...

    warning: peer certificate won't be verified in this SSL session
    /usr/lib/ruby/1.8/net/http.rb:2097:in `error!': 400 "Bad
    Request" (Net::HTTPServerException)
    from /usr/lib/ruby/1.8/net/http.rb:2106:in `value'
    from /home/carfield/respository/atomtest.rb:13
    from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
    from /home/carfield/respository/atomtest.rb:9

    Anyone know how can I solve it? Done a brief google search doesn't
    help...
     
    Carfield Yim, May 30, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marc  Dugger

    JSTL and Atom feed parsing

    Marc Dugger, Dec 15, 2004, in forum: Java
    Replies:
    0
    Views:
    472
    Marc Dugger
    Dec 15, 2004
  2. chlori
    Replies:
    1
    Views:
    559
  3. =?Utf-8?B?bWF2cmlja18xMDE=?=

    Problem reading ATOM Feed.

    =?Utf-8?B?bWF2cmlja18xMDE=?=, May 8, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    380
    =?Utf-8?B?bWF2cmlja18xMDE=?=
    May 8, 2007
  4. Brian Kaplan
    Replies:
    0
    Views:
    416
    Brian Kaplan
    Feb 10, 2009
  5. Lucas Nussbaum
    Replies:
    0
    Views:
    157
    Lucas Nussbaum
    Nov 15, 2005
Loading...

Share This Page