Skip to content
Snippets Groups Projects
Commit f34fe0e1 authored by rjhornsby's avatar rjhornsby Committed by Dominik Honnef
Browse files

Fix definition element location

Closes: gh-227 [via git-merge-pr]
parent eef778ab
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,7 @@ bot = Cinch::Bot.new do
# can be done.. it works!
def urban_dict(query)
url = "http://www.urbandictionary.com/define.php?term=#{CGI.escape(query)}"
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
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment