I lost authentication token, how do i get it. I followed the link
http://code.google.com/apis/gdata/articles/using_ruby.html
In Authentication | Using the Google Spreadsheets API section
detailed explanation
--------------------------------code
starts--------------------------------------
irb(main):008:0> require ''net/https''
=> true
irb(main):009:0> http = Net::HTTP.new(''www.google.com'',
443)
=> #<Net::HTTP www.google.com:443 open=false>
irb(main):010:0> http.use_ssl = true
=> true
irb(main):011:0> path = ''/accounts/ClientLogin''
=> "/accounts/ClientLogin"
# Now we are passing in our actual authentication data.
# Please visit this link for more information
In Authentication | Using the Google Spreadsheets API
section
# about the accountType parameter
irb(main):014:0> data = \
irb(main):015:0* ''accountType=HOSTED_OR_GOOGLE&Email=your
email'' \
irb(main):016:0* ''&Passwd=your password'' \
irb(main):017:0* ''&service=wise''
=> accountType=HOSTED_OR_GOOGLE&Email=your email&Passwd=your
password&service=wise"
# Set up a hash for the headers
irb(main):018:0> headers = \
irb(main):019:0* { ''Content-Type'' =>
''application/x-www-form-
urlencoded''}
=>
{"Content-Type"=>"application/x-www-form-urlencoded"}
# Post the request and print out the response to retrieve our
authentication token
irb(main):020:0> resp, data = http.post(path, data, headers)
warning: peer certificate won''t be verified in this SSL session
=> [#<Net::HTTPOK 200 OK readbody=true>, "SID=DQAAAIIAAADgV7j4F-
QVQjnxdDRjpslHKC3M ... [ snipping out the rest of the authentication
strings ]
-------------------------------------------code
ends---------------------------------------
after executing above steps i got auth token. Now I accidentally
changed some characters. That is the mistake I have done. So, I
startted newly from the beginning, but when I run
this step.
--------------------------------code
starts--------------------------------------
resp, data = http.post(path, data, headers)
-------------------------------------------code
ends---------------------------------------
I am getting error as follows
--------------------------------code
starts--------------------------------------
C:\Documents and Settings\Administrator>irb
irb(main):001:0>
irb(main):002:0* require ''net/https''
=> true
irb(main):003:0> http = Net::HTTP.new(''www.google.com'',
443)
=> #<Net::HTTP www.google.com:443 open=false>
irb(main):004:0> path = ''/accounts/ClientLogin''
=> "/accounts/ClientLogin"
irb(main):005:0> data = \
irb(main):006:0*
''accountType=HOSTED_OR_GOOGLE&Email=aashish.ki...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org''
\
irb(main):007:0* ''&Passwd=aassssaa'' \
irb(main):008:0* ''&service=finance''
=>
"accountType=HOSTED_OR_GOOGLE&Email=aashish.ki...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org&Passwd=aassssaa&service=finance"
irb(main):009:0> headers = \
irb(main):010:0* { ''Content-Type'' =>
''application/x-www-form-
urlencoded''}
=>
{"Content-Type"=>"application/x-www-form-urlencoded"}
irb(main):011:0> resp, data = http.post(path, data, headers)
EOFError: end of file reached
from c:/ruby/lib/ruby/1.8/net/protocol.rb:133:in `sysread''
from c:/ruby/lib/ruby/1.8/net/protocol.rb:133:in `rbuf_fill''
from c:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout''
from c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout''
from c:/ruby/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill''
from c:/ruby/lib/ruby/1.8/net/protocol.rb:116:in `readuntil''
from c:/ruby/lib/ruby/1.8/net/protocol.rb:126:in `readline''
from c:/ruby/lib/ruby/1.8/net/http.rb:2029:in
`read_status_line''
from c:/ruby/lib/ruby/1.8/net/http.rb:2018:in `read_new''
from c:/ruby/lib/ruby/1.8/net/http.rb:1059:in `request''
from c:/ruby/lib/ruby/1.8/net/http.rb:1046:in `request''
from c:/ruby/lib/ruby/1.8/net/http.rb:547:in `start''
from c:/ruby/lib/ruby/1.8/net/http.rb:1044:in `request''
from c:/ruby/lib/ruby/1.8/net/http.rb:854:in `post''
from (irb):11
irb(main):012:0>
-------------------------------------------code
ends---------------------------------------
can anyone help me in solving this
--
Posted via http://www.ruby-forum.com/.