Skip to content

Instantly share code, notes, and snippets.

@renaud
Created February 3, 2011 11:17
Show Gist options
  • Save renaud/809365 to your computer and use it in GitHub Desktop.
Save renaud/809365 to your computer and use it in GitHub Desktop.
Using the Alchemy API in Ruby
require "AlchemyAPI.rb"
alchemyObj = AlchemyAPI.new();
alchemyObj.setAPIKey("########");
# Categorize some text.
result = alchemyObj.TextGetCategory("Latest on the War in Iraq.");
puts result.scan(/<category>(.*)<\/category>/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment