Class: Weibo2::Interface::Suggestions

Inherits:
Base
  • Object
show all
Defined in:
lib/weibo2/interface/suggestions.rb

Overview

Suggestions API

Instance Method Summary collapse

Methods inherited from Base

#get, #initialize, #post, #request

Constructor Details

This class inherits a constructor from Weibo2::Interface::Base

Instance Method Details

#favorites_hot(opts = {}) ⇒ Object

返回系统推荐的热门收藏

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :count (int)

    每页返回结果数,默认20

  • :page (int)

    返回页码,默认1

See Also:



49
50
51
# File 'lib/weibo2/interface/suggestions.rb', line 49

def favorites_hot(opts={})
  get 'suggestions/favorites/hot.json', :params => opts
end

#users_by_status(content, opts = {}) ⇒ Object

根据一段微博正文推荐相关微博用户

Parameters:

  • content (String)

    微博正文内容

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :num (int)

    返回结果数目,默认为10

See Also:



38
39
40
# File 'lib/weibo2/interface/suggestions.rb', line 38

def users_by_status(content, opts={})
  get 'suggestions/users/by_status.json', :params => {:content => content}.merge(opts)
end

#users_hot(opts = {}) ⇒ Object

返回系统推荐的热门用户列表

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :category (String)

    推荐分类,返回某一类别的推荐用户

See Also:



16
17
18
# File 'lib/weibo2/interface/suggestions.rb', line 16

def users_hot(opts={})
  get 'suggestions/users/hot.json', :params => opts
end

#users_may_interested(opts = {}) ⇒ Object

获取用户可能感兴趣的人

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :count (int)

    单页返回的记录条数,默认为10

  • :page (int)

    返回结果的页码,默认为1

See Also:



27
28
29
# File 'lib/weibo2/interface/suggestions.rb', line 27

def users_may_interested(opts={})
  get 'suggestions/users/may_interested.json', :params => opts
end

#users_not_interested(uid) ⇒ Object

把某人标识为不感兴趣的人

Parameters:

  • uid (int64)

    不感兴趣的用户的UID

See Also:



63
64
65
# File 'lib/weibo2/interface/suggestions.rb', line 63

def users_not_interested(uid)
  post 'suggestions/users/not_interested.json', :body => {:uid => uid}
end