Anyone use this pdf ?
Already ran into an error and checked O’Reilly site and there is no errata submitted to date.
I’m getting an error in the first example (Yahoo search using REST)
NoMethodError in
Code#yahootest
Showing app/views/code/yahootest.rhtml where line #2 raised:
undefined method
text’ for #REXML::Text:0x388fb50
Controller - class CodeController < ApplicationController
def yahootest query = CGI.escape(“SEARCH TEXT”) #URL encoded search value yahookey = “19571957” url = "http://api.search.yahoo.com/ " + “WebSearchService/VI/webSearch?” + “appid=#{yahookey}&query=#{query}” + “&results=3&start=1” result = Net::HTTP.get(URI(url)) @doc = REXML:: Document.new result end
end
View-
<% @doc.root.each_element do |res| %>
Title: <%= res[0].text.to_s %>
Summary: <%= res[1].text.to_s %>
Link: <%= res[2].text.to_s %>
<% end %>
??? Anyone know what’s wrong Stuart
`