Skip to content

Instantly share code, notes, and snippets.

@stormy
Created June 29, 2011 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stormy/1053305 to your computer and use it in GitHub Desktop.
Save stormy/1053305 to your computer and use it in GitHub Desktop.
Effect Check API using Ruby and HTTParty
require 'httparty'
class EffectCheck
include HTTParty
base_uri 'http://effectcheck.com/'
basic_auth 'your_username', 'your_password'
end
effect_score = EffectCheck.post('/RestApi/score', :body => {:Category => "Generic", :Content => "your_content"})
effect_emotion_words = EffectCheck.post('/RestApi/EmotionWords', :body => {:Category => "Generic", :Content => "your_content"})
puts effect_score['Compassion']['ChartLevel']
# => displays Compassion chart level response
effect_emotion_words['Compassion'].each do |word|
puts word['Word']
end
# => displays all words associated with Compassion sentiment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment