Class: RiteTag

Inherits:
Object
  • Object
show all
Defined in:
lib/ritetag.rb

Instance Method Summary collapse

Constructor Details

#initialize(auth) ⇒ RiteTag

Returns a new instance of RiteTag.



6
7
8
9
10
11
# File 'lib/ritetag.rb', line 6

def initialize(auth)
	@auth = auth
	@consumer=OAuth::Consumer.new @auth['consumer_key'], @auth['consumer_secret'], {:site=>"https://ritetag.com/api/v2"}

       @access_token = OAuth::AccessToken.new(@consumer, @auth['token'], @auth['token_secret'])
end

Instance Method Details

#get(query) ⇒ Object



13
14
15
16
# File 'lib/ritetag.rb', line 13

def get(query)
	json_response =  @access_token.get("/ai/twitter/#{query}/").body
	return JSON.parse(json_response)
end