Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created March 21, 2010 23:58
Show Gist options
  • Save leejarvis/339665 to your computer and use it in GitHub Desktop.
Save leejarvis/339665 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'nokogiri'
require 'open-uri'
query = "stuff"
doc = Nokogiri::HTML(open("http://thesaurus.com/browse/#{query}"))
puts doc.search("//td[text()='Synonyms:']/following-sibling::td/span").text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment