Visit a url programatically

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"?> 6984053721 Please supply a user authentication response using the nonce provided.

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??

kevid [email protected] 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/

  1. 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

There is a helpful railscast on mechanize here:
#191 Mechanize - RailsCasts

Jason S.
“I’m going to live forever or die trying.”