Created
March 6, 2009 12:34
-
-
Save collin/74891 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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