Skip to content

Commit 187fc94

Browse files
author
rjhornsby
committed
Fix definition element location
1 parent f3d07bb commit 187fc94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/basic/urban_dict.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# can be done.. it works!
2020
def urban_dict(query)
2121
url = "http://www.urbandictionary.com/define.php?term=#{CGI.escape(query)}"
22-
CGI.unescape_html Nokogiri::HTML(open(url)).at("div.definition").text.gsub(/\s+/, ' ') rescue nil
22+
CGI.unescape_html Nokogiri::HTML(open(url)).css("div.meaning").first.text.gsub(/\s+/, ' ').strip rescue nil
2323
end
2424
end
2525

0 commit comments

Comments
 (0)