class ScribeAPI

Public Class Methods

new( key ) click to toggle source
# File lib/scribe_api.rb, line 15
def initialize( key )
  @key = key
end

Public Instance Methods

content_analysis( params={} ) click to toggle source
# File lib/scribe_api.rb, line 41
def content_analysis( params={} )
  options = { :body => { :htmlTitle => params[:title], :htmlDescription => params[:description], :htmlHeadline => params[:headline], :htmlBody => params[:body], :targetedKeyword => params[:keyword], :domain => params[:domain] }.to_json }
  httparty = self.class.post( "/analysis/content?apikey=#{@key}", options )
  result = {}
  
  if httparty.code == 200
    result = httparty.parsed_response
  end
  result
end
keyword_details( params={} ) click to toggle source
# File lib/scribe_api.rb, line 30
def keyword_details( params={} )
  options = { :body => { :query => params[:keyword], :domain => params[:domain] }.to_json }
  httparty = self.class.post( "/analysis/kw/detail?apikey=#{@key}", options )
  result = {}
  
  if httparty.code == 200
    result = httparty.parsed_response
  end
  result
end
keyword_suggestions( params={} ) click to toggle source
# File lib/scribe_api.rb, line 19
def keyword_suggestions( params={} )
  options = { :body => { :query => params[:keyword] }.to_json }
  httparty = self.class.post( "/analysis/kw/suggestions?apikey=#{@key}", options )
  result = {}
  
  if httparty.code == 200
    result = httparty.parsed_response
  end
  result
end
user_information( params={} ) click to toggle source
# File lib/scribe_api.rb, line 65
def user_information( params={} )
  httparty = self.class.get( "/membership/user/detail?apikey=#{@key}" )
  result = {}
  
  if httparty.code == 200
    result = httparty.parsed_response
  end
  result
end