Class: QqClient::Client
- Inherits:
-
Object
- Object
- QqClient::Client
- Defined in:
- lib/qq_client/client.rb
Instance Attribute Summary collapse
-
#oauth ⇒ Object
readonly
Returns the value of attribute oauth.
Instance Method Summary collapse
- #add_blog(uid, title, content) ⇒ Object
-
#add_pic_t(uid, content, pic, options = {}) ⇒ Object
Upload a picture and posted a message on the Tencent microblogging platforms.
-
#add_t(uid, content, options = {}) ⇒ Object
Published a microblogging message (plain text) to the Tencent microblogging platforms.
-
#get_info(uid, options = {}) ⇒ Object
Get Tencent Weibo user’s login information.
- #get_uid ⇒ Object
-
#initialize(access_token) ⇒ Client
constructor
A new instance of Client.
Constructor Details
Instance Attribute Details
#oauth ⇒ Object (readonly)
Returns the value of attribute oauth.
5 6 7 |
# File 'lib/qq_client/client.rb', line 5 def oauth @oauth end |
Instance Method Details
#add_blog(uid, title, content) ⇒ Object
33 34 35 36 |
# File 'lib/qq_client/client.rb', line 33 def add_blog(uid, title, content) params = { :content => content,:title => title,:format => 'json' } @oauth.post uid, "blog/add_one_blog", params end |
#add_pic_t(uid, content, pic, options = {}) ⇒ Object
Upload a picture and posted a message on the Tencent microblogging platforms. More info (wiki.connect.qq.com/add_pic_t)
28 29 30 31 |
# File 'lib/qq_client/client.rb', line 28 def add_pic_t(uid, content, pic, = {}) default_params = { :content => content,:pic => pic } @oauth.post uid, "t/add_pic_t", default_params.merge() end |
#add_t(uid, content, options = {}) ⇒ Object
Published a microblogging message (plain text) to the Tencent microblogging platforms. More info (wiki.connect.qq.com/add_t)
21 22 23 24 |
# File 'lib/qq_client/client.rb', line 21 def add_t(uid, content, = {}) default_params = { :content => content } @oauth.post uid, "t/add_t", default_params.merge() end |
#get_info(uid, options = {}) ⇒ Object
Get Tencent Weibo user’s login information. More info (wiki.connect.qq.com/get_info)
15 16 17 |
# File 'lib/qq_client/client.rb', line 15 def get_info(uid, = {}) @oauth.post uid, "user/get_info", end |
#get_uid ⇒ Object
38 39 40 41 |
# File 'lib/qq_client/client.rb', line 38 def get_uid default_params = { :format => 'json' } @oauth.get_uid "oauth2.0/me", default_params end |