hi all, i have the code below; require ''rexml/document'' require ''open-uri'' open(''http://api.evdb.com/rest/users/login?app_key=ct2hJqTCg4XLCP5h'') { |f| $res = REXML::Document.new(f.read) } the xml data that is read is; <?xml version="1.0" encoding="UTF-8"?> <error string="Authorization Required"> <nonce>6984053721</nonce> <description>Please supply a user authentication response using the nonce provided.</description> </error> QUESTIONS 1. how do i get the value of nonce (i.e. 6984053721 ) 2. is there another way of visiting the url "http://api.evdb.com/ rest/ users/login?app_key=ct2hJqTCg4XLCP5h" without using open-uri as in above thoughts?? -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
kevid <alumsimportant-FFYn/CNdgSA@public.gmane.org> writes:> hi all, > > i have the code below; > > QUESTIONS > > 1. how do i get the value of nonce (i.e. 6984053721 )You should take a look at nokogiri http://nokogiri.org/> 2. is there another way of visiting the url "http://api.evdb.com/ > rest/ > users/login?app_key=ct2hJqTCg4XLCP5h" > without using open-uri as in aboveThere is the mechanize framework. Jarl -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
There is a helpful railscast on mechanize here: http://railscasts.com/episodes/191-mechanize --- Jason Soo "I''m going to live forever or die trying." On Mon, May 10, 2010 at 1:36 PM, Jarl Friis <jarl-VtTiYveqpzg@public.gmane.org> wrote:> kevid <alumsimportant-FFYn/CNdgSA@public.gmane.org> writes: > > > hi all, > > > > i have the code below; > > > > QUESTIONS > > > > 1. how do i get the value of nonce (i.e. 6984053721 ) > > You should take a look at nokogiri http://nokogiri.org/ > > > 2. is there another way of visiting the url "http://api.evdb.com/ > > rest/ > > users/login?app_key=ct2hJqTCg4XLCP5h" > > without using open-uri as in above > > There is the mechanize framework. > > Jarl > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.