Created
June 29, 2011 07:07
-
-
Save stormy/1053305 to your computer and use it in GitHub Desktop.
Effect Check API using Ruby and HTTParty
This file contains 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
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