Class: Weibo2::Interface::Statuses
- Defined in:
- lib/weibo2/interface/statuses.rb
Overview
Statuses API
Instance Method Summary collapse
-
#destroy(id) ⇒ Object
根据微博ID删除指定微博.
-
#emotions(opts = {}) ⇒ Object
获取微博官方表情的详细信息.
-
#friends_timeline(opts = {}) ⇒ Object
获取当前登录用户及其所关注用户的最新微博.
-
#home_timeline(opts = {}) ⇒ Object
获取当前登录用户及其所关注用户的最新微博.
-
#hot_comments_daily(opts = {}) ⇒ Object
按天返回热门微博评论榜的微博列表.
-
#hot_comments_weekly(opts = {}) ⇒ Object
按周返回热门微博评论榜的微博列表.
-
#hot_repost_daily(opts = {}) ⇒ Object
按天返回热门微博转发榜的微博列表.
-
#hot_repost_weekly(opts = {}) ⇒ Object
按周返回热门微博转发榜的微博列表.
-
#mentions(opts = {}) ⇒ Object
获取最新的提到登录用户的微博列表,即@我的微博.
-
#public_timeline(opts = {}) ⇒ Object
返回最新的公共微博.
-
#queryid(mid, type = 1, opts = {}) ⇒ Object
test failed 通过微博(评论、私信)MID获取其ID.
-
#querymid(id, type = 1, opts = {}) ⇒ Object
通过微博(评论、私信)ID获取其MID.
-
#repost(id, opts = {}) ⇒ Object
转发一条微博.
-
#repost_by_me(opts = {}) ⇒ Object
获取当前用户最新转发的微博列表.
-
#repost_timeline(id, opts = {}) ⇒ Object
获取指定微博的转发微博列表.
-
#show(id) ⇒ Object
根据微博ID获取单条微博内容.
-
#show_batch(ids) ⇒ Object
根据微博ID批量获取微博信息 [Privilege].
-
#timeline_batch(opts = {}) ⇒ Object
批量获取指定的一批用户的微博列表 [Privilege].
-
#update(status, opts = {}) ⇒ Object
no tested 发布一条新微博.
-
#upload(status, pic, opts = {}) ⇒ Object
no tested 上传图片并发布一条新微博.
-
#upload_url_text(opts = {}) ⇒ Object
指定一个图片URL地址抓取后上传并同时发布一条新微博 [Privilege].
-
#user_timeline(opts = {}) ⇒ Object
获取某个用户最新发表的微博列表.
Methods inherited from Base
#get, #initialize, #post, #request
Constructor Details
This class inherits a constructor from Weibo2::Interface::Base
Instance Method Details
#destroy(id) ⇒ Object
根据微博ID删除指定微博
238 239 240 |
# File 'lib/weibo2/interface/statuses.rb', line 238 def destroy(id) post 'statuses/destroy.json', :body => {:id => id} end |
#emotions(opts = {}) ⇒ Object
获取微博官方表情的详细信息
295 296 297 |
# File 'lib/weibo2/interface/statuses.rb', line 295 def emotions(opts={}) get 'emotions.json', :params => opts end |
#friends_timeline(opts = {}) ⇒ Object
获取当前登录用户及其所关注用户的最新微博
33 34 35 |
# File 'lib/weibo2/interface/statuses.rb', line 33 def friends_timeline(opts={}) get 'statuses/friends_timeline.json', :params => opts end |
#home_timeline(opts = {}) ⇒ Object
获取当前登录用户及其所关注用户的最新微博
48 49 50 |
# File 'lib/weibo2/interface/statuses.rb', line 48 def home_timeline(opts={}) get 'statuses/home_timeline.json', :params => opts end |
#hot_comments_daily(opts = {}) ⇒ Object
按天返回热门微博评论榜的微博列表
201 202 203 |
# File 'lib/weibo2/interface/statuses.rb', line 201 def hot_comments_daily(opts={}) get 'statuses/hot/comments_daily.json', :params => opts end |
#hot_comments_weekly(opts = {}) ⇒ Object
按周返回热门微博评论榜的微博列表
212 213 214 |
# File 'lib/weibo2/interface/statuses.rb', line 212 def hot_comments_weekly(opts={}) get 'statuses/hot/comments_weekly.json', :params => opts end |
#hot_repost_daily(opts = {}) ⇒ Object
按天返回热门微博转发榜的微博列表
179 180 181 |
# File 'lib/weibo2/interface/statuses.rb', line 179 def hot_repost_daily(opts={}) get 'statuses/hot/repost_daily.json', :params => opts end |
#hot_repost_weekly(opts = {}) ⇒ Object
按周返回热门微博转发榜的微博列表
190 191 192 |
# File 'lib/weibo2/interface/statuses.rb', line 190 def hot_repost_weekly(opts={}) get 'statuses/hot/repost_weekly.json', :params => opts end |
#mentions(opts = {}) ⇒ Object
获取最新的提到登录用户的微博列表,即@我的微博
123 124 125 |
# File 'lib/weibo2/interface/statuses.rb', line 123 def mentions(opts={}) get 'statuses/mentions.json', :params => opts end |
#public_timeline(opts = {}) ⇒ Object
返回最新的公共微博
18 19 20 |
# File 'lib/weibo2/interface/statuses.rb', line 18 def public_timeline(opts={}) get 'statuses/public_timeline.json', :params => opts end |
#queryid(mid, type = 1, opts = {}) ⇒ Object
test failed 通过微博(评论、私信)MID获取其ID
168 169 170 |
# File 'lib/weibo2/interface/statuses.rb', line 168 def queryid(mid, type=1, opts={}) get 'statuses/queryid.json', :params => {:mid => mid, :type => type}.merge(opts) end |
#querymid(id, type = 1, opts = {}) ⇒ Object
通过微博(评论、私信)ID获取其MID
153 154 155 |
# File 'lib/weibo2/interface/statuses.rb', line 153 def querymid(id, type=1, opts={}) get 'statuses/querymid.json', :params => {:id => id, :type => type}.merge(opts) end |
#repost(id, opts = {}) ⇒ Object
转发一条微博
229 230 231 |
# File 'lib/weibo2/interface/statuses.rb', line 229 def repost(id, opts={}) post 'statuses/repost.json', :body => {:id => id}.merge(opts) end |
#repost_by_me(opts = {}) ⇒ Object
获取当前用户最新转发的微博列表
107 108 109 |
# File 'lib/weibo2/interface/statuses.rb', line 107 def repost_by_me(opts={}) get 'statuses/repost_by_me.json', :params => opts end |
#repost_timeline(id, opts = {}) ⇒ Object
获取指定微博的转发微博列表
94 95 96 |
# File 'lib/weibo2/interface/statuses.rb', line 94 def repost_timeline(id, opts={}) get 'statuses/repost_timeline.json', :params => {:id => id}.merge(opts) end |
#show(id) ⇒ Object
根据微博ID获取单条微博内容
132 133 134 |
# File 'lib/weibo2/interface/statuses.rb', line 132 def show(id) get 'statuses/show.json', :params => {:id => id} end |
#show_batch(ids) ⇒ Object
根据微博ID批量获取微博信息 [Privilege]
141 142 143 |
# File 'lib/weibo2/interface/statuses.rb', line 141 def show_batch(ids) get 'statuses/show_batch.json', :params => {:ids => ids} end |
#timeline_batch(opts = {}) ⇒ Object
批量获取指定的一批用户的微博列表 [Privilege]
79 80 81 |
# File 'lib/weibo2/interface/statuses.rb', line 79 def timeline_batch(opts={}) get 'statuses/timeline_batch.json', :params => opts end |
#update(status, opts = {}) ⇒ Object
no tested 发布一条新微博
253 254 255 |
# File 'lib/weibo2/interface/statuses.rb', line 253 def update(status, opts={}) post 'statuses/update.json', :body => {:status => status}.merge(opts) end |
#upload(status, pic, opts = {}) ⇒ Object
no tested 上传图片并发布一条新微博
269 270 271 |
# File 'lib/weibo2/interface/statuses.rb', line 269 def upload(status, pic, opts={}) post 'statuses/upload.json', :body => {:status => status, :pic => pic}.merge(opts) end |
#upload_url_text(opts = {}) ⇒ Object
指定一个图片URL地址抓取后上传并同时发布一条新微博 [Privilege]
284 285 286 |
# File 'lib/weibo2/interface/statuses.rb', line 284 def upload_url_text(opts={}) post 'statuses/upload_url_text.json', :body => opts end |
#user_timeline(opts = {}) ⇒ Object
获取某个用户最新发表的微博列表
66 67 68 |
# File 'lib/weibo2/interface/statuses.rb', line 66 def user_timeline(opts={}) get 'statuses/user_timeline.json', :params => opts end |