class QqClient::Client

Attributes

oauth[R]

Public Class Methods

new(access_token) click to toggle source
# File lib/qq_client/client.rb, line 7
def initialize(access_token)
        @oauth = Oauth.new(access_token)
end

Public Instance Methods

add_blog(uid, title, content) click to toggle source
# File lib/qq_client/client.rb, line 35
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 = {}) click to toggle source

Upload a picture and posted a message on the Tencent microblogging platforms. More info (wiki.connect.qq.com/add_pic_t)

# File lib/qq_client/client.rb, line 30
def add_pic_t(uid, content, pic, options = {})
        default_params = { :content => content, :pic => pic, :multipart => true }
        @oauth.post uid, "t/add_pic_t", default_params.merge(options)
end
add_t(uid, content, options = {}) click to toggle source

Published a microblogging message (plain text) to the Tencent microblogging platforms. More info (wiki.connect.qq.com/add_t)

# File lib/qq_client/client.rb, line 23
def add_t(uid, content, options = {})
        default_params = { :content => content }
        @oauth.post uid, "t/add_t", default_params.merge(options)
end
get_info(uid, options = {}) click to toggle source

Get Tencent Weibo user’s login information. More info (wiki.connect.qq.com/get_info)

# File lib/qq_client/client.rb, line 15
def get_info(uid, options = {})
        data = @oauth.post uid, "user/get_info", options
        data['data']['openid'] = uid
        data
end
get_uid() click to toggle source
# File lib/qq_client/client.rb, line 40
def get_uid
        default_params = { :format => 'json' }
        @oauth.get_uid "oauth2.0/me", default_params
end