app/models/word.rb
def lookup_thesaurus(query)
      query = normalize_query(query).gsub(/ /, '+')
      begin
        html = Nokogiri::HTML(open("http://thesaurus.com/browse/#{query}").read)
        html.css('.sep_top')[0].to_s.gsub(/<\/a>/, '').gsub(/<a[^>]+>/, '')
      rescue
        "none"
      end
    end
# search the query on the thesaurus.com and paste part of the
# result.
search the query on the thesaurus.com and paste part of the
result.
search the query on the thesaurus . com and paste part of the result .
def lookup_thesaurus(query)
      query = normalize_query(query).gsub(/ /, '+')
      begin
        html = Nokogiri::HTML(open("http://thesaurus.com/browse/#{query}").read)
        html.css('.sep_top')[0].to_s.gsub(/<\/a>/, '').gsub(/<a[^>]+>/, '')
      rescue
        "none"
      end
    end
def lookup_thesaurus ( query ) query = normalize_query ( query ) . gsub ( / / , '+' ) begin html = Nokogiri :: HTML ( open ( "http://thesaurus.com/browse/#{query}" ) . read ) html . css ( '.sep_top' ) [ 0 ] . to_s . gsub ( / < \/ a> / , '' ) . gsub ( / <a[^>]+> / , '' ) rescue "none" end end
search the query on the thesaurus.com and paste part of the
result.
search the query on the thesaurus . com and paste part of the result .
query