Class: Qq::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token, uid) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/qq/client.rb', line 7

def initialize(access_token, uid)
	@oauth = Oauth.new(access_token,uid)
end

Instance Attribute Details

#oauthObject (readonly)

Returns the value of attribute oauth.



5
6
7
# File 'lib/qq/client.rb', line 5

def oauth
  @oauth
end

Instance Method Details

#add_blog(title, content) ⇒ Object



29
30
31
32
# File 'lib/qq/client.rb', line 29

def add_blog(title,content)
	params = { :content => content,:title => title,:format => 'json' }
	@oauth.post "blog/add_one_blog",params
end

#add_pic_t(content, pic, options = {}) ⇒ Object

上传图片并发表消息到腾讯微博



24
25
26
27
# File 'lib/qq/client.rb', line 24

def add_pic_t(content,pic,options = {})
	default_params = { :content => content,:pic => pic }
	@oauth.post "t/add_pic_t",default_params.merge(options)
end

#add_t(content, options = {}) ⇒ Object

发表一条微博信息到腾讯微博



18
19
20
21
# File 'lib/qq/client.rb', line 18

def add_t(content,options = {})
	default_params = { :content => content }
	@oauth.post "t/add_t",default_params.merge(options)
end

#get_info(options = {}) ⇒ Object

api



13
14
15
# File 'lib/qq/client.rb', line 13

def get_info(options = {})
	@oauth.get "user/get_info",options
end