Skip to content

Instantly share code, notes, and snippets.

@collin
Created March 6, 2009 12:34
Show Gist options
  • Select an option

  • Save collin/74891 to your computer and use it in GitHub Desktop.

Select an option

Save collin/74891 to your computer and use it in GitHub Desktop.
# Open the class to set your license id
class Calais; def license_id; "YOUR OPEN CALAIS KEY GOES HERE" end end
# Make an instance where content is the text content of your article.
data = Calais.new(content)
# Default content type is text/html, if you are using text/plain, try this:
data = Calais.new(content, :content_type => "text/plain")
# the Calais class has two attr_readers, :hierarchy and :response
# response is a Hash of the raw response from Calais
# hierarchy is a hierarchically organized Hash of the data
# We'll see how those are used later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment