class WeiboApi::User
Public Class Methods
new(access_token, uid)
click to toggle source
# File lib/weibo_api/user.rb, line 5 def initialize(access_token, uid) @access_token = access_token @uid = uid end
Public Instance Methods
custom_request(path, options = {})
click to toggle source
# File lib/weibo_api/user.rb, line 35 def custom_request(path, options = {}) params = options.merge(access_token: @access_token) { |_, important, _| important } make_request resource_path(path, params), {} end
info(options = {})
click to toggle source
Return the authenticating user's personnal infos or the one specified on the options (uid).
# File lib/weibo_api/user.rb, line 11 def info(options = {}) params = options.merge(access_token: @access_token, uid: @uid) { |_, important, _| important } make_request resource_path('users/show', params), {} end
show_status(id)
click to toggle source
Return the single weibo's content by its ID
# File lib/weibo_api/user.rb, line 30 def show_status(id) params = { access_token: @access_token, id: id } make_request resource_path('statuses/show', params), {} end
statistics(options = {})
click to toggle source
Return the authenticating user's followers statistics.
- WIP
# File lib/weibo_api/user.rb, line 18 def statistics(options = {}) params = options.merge(access_token: @access_token, uid: @uid) { |_, important, _| important } make_request resource_path('friendships/followers', params), {} end
timeline(options = {})
click to toggle source
Return the authenticating user's latest weibos.
# File lib/weibo_api/user.rb, line 24 def timeline(options = {}) params = options.merge(access_token: @access_token, trim_user: 1) { |_, important, _| important } make_request resource_path('statuses/user_timeline', params), {} end