def login()
      login_page = @agent.get("https://www.google.com/accounts/ServiceLogin?service=grandcentral")
      login_page.forms.first.field_with(:name=>"Email").value = @email
      login_page.forms.first.field_with(:name=>"Passwd").value = @password
      agent.submit(login_page.forms.first)
      page = @agent.get('https://www.google.com/voice/')
      dialing_form = page.forms.find { |f| f.has_field?('_rnr_se') }
      raise InvalidLoginException, "Cannot login to Google Voice with #{@email}" unless dialing_form
      @rnr_se = dialing_form.field_with(:name => '_rnr_se').value
    end
def login()
      login_page = @agent.get("https://www.google.com/accounts/ServiceLogin?service=grandcentral")
      login_page.forms.first.field_with(:name=>"Email").value = @email
      login_page.forms.first.field_with(:name=>"Passwd").value = @password
      agent.submit(login_page.forms.first)
      page = @agent.get('https://www.google.com/voice/')
      dialing_form = page.forms.find { |f| f.has_field?('_rnr_se') }
      raise InvalidLoginException, "Cannot login to Google Voice with #{@email}" unless dialing_form
      @rnr_se = dialing_form.field_with(:name => '_rnr_se').value
    end
Create a basic Mechanize agent, initial our objects, and
 create our dynamic <function>_xml methods
 Login to a Google Account to use the Google Voice services
 Most of the calls require a special authentication token called
 _rnr_se that can be scraped from the page once logged in.