We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3d07bb commit 187fc94Copy full SHA for 187fc94
examples/basic/urban_dict.rb
@@ -19,7 +19,7 @@
19
# can be done.. it works!
20
def urban_dict(query)
21
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
+ CGI.unescape_html Nokogiri::HTML(open(url)).css("div.meaning").first.text.gsub(/\s+/, ' ').strip rescue nil
23
end
24
25
0 commit comments