Class: Renren2::Interface::Pages

Inherits:
Base
  • Object
show all
Defined in:
lib/renren2/interface/pages.rb

Overview

Pages Interface

Instance Method Summary collapse

Methods inherited from Base

#check_scope, #get, #initialize, #post, #request

Constructor Details

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

Instance Method Details

#become_fan(page_id) ⇒ Object

成为某个Page的粉丝

Parameters:

  • page_id (int)

    Page的ID

See Also:



27
28
29
# File 'lib/renren2/interface/pages.rb', line 27

def become_fan(page_id)
  post 'pages.becomeFan', :body => {:page_id => page_id}
end

#get_categoriesObject

获取公共主页的类型



64
65
66
# File 'lib/renren2/interface/pages.rb', line 64

def get_categories
  post 'pages.getCategories'
end

#get_fans_list(page_id, opts = {}) ⇒ Object

获取Page粉丝的列表

Parameters:

  • page_id (int)

    Page的ID

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

Options Hash (opts):

  • :page (int)

    分页显示的页码 缺省值为1

  • :count (int)

    每页显示的粉丝的数量, 缺省值为10

See Also:



119
120
121
# File 'lib/renren2/interface/pages.rb', line 119

def get_fans_list(page_id, opts={})
  post 'pages.getFansList', :body => {:page_id => page_id}.merge(opts)
end

#get_info(page_id, fields) ⇒ Object

获取某个Page的信息

Parameters:

  • page_id (int)

    Page的ID

  • fields (String)

    需要返回的字段的列表,多个字段间用逗号隔开。现在支持:status(当前状态),desc(描述), base_info(基本信息),albums_count(相册总数),blogs_count(日志总数), fans_count(粉丝总数), detail_info(详细信息), contact_info(联系信息)

See Also:



76
77
78
# File 'lib/renren2/interface/pages.rb', line 76

def get_info(page_id, fields)
  post 'pages.getInfo', :body => {:page_id => page_id, :fields => fields}
end

#get_list(opts = {}) ⇒ Object

获取Page的列表

Parameters:

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

Options Hash (opts):

  • :uid (int)

    用户的ID。当此参数不为空时表示获取此人关注的公共主页列表

  • :page (int)

    页码,默认值为1

  • :count (int)

    每页的容量,默认值为10

  • :category (int)

    分类的ID。缺省时表示获取所有类型的公共主页

See Also:



107
108
109
# File 'lib/renren2/interface/pages.rb', line 107

def get_list(opts={})
  post 'pages.getList', :body => opts
end

#get_managed_list(opts = {}) ⇒ Object

获取当前用户管理的Page列表

Parameters:

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

Options Hash (opts):

  • :page (int)

    页码,默认值为1

  • :count (int)

    每页的容量,默认值为10

See Also:



18
19
20
# File 'lib/renren2/interface/pages.rb', line 18

def get_managed_list(opts={})
  post 'pages.getManagedList', :body => opts
end

#is_admin(page_id) ⇒ Object

判断当前用户是否是某个Page的管理员

Parameters:

  • page_id (int)

    Page的ID

See Also:



85
86
87
# File 'lib/renren2/interface/pages.rb', line 85

def is_admin(page_id)
  post 'pages.isAdmin', :body => {:page_id => page_id}
end

#is_fan(opts = {}) ⇒ Object

判断用户是否为Page的粉丝

Parameters:

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

Options Hash (opts):

  • :uid (int)

    用户的ID

  • :page_id (int)

    Page的ID,缺省时,值为当前应用对应的Page的ID

See Also:



57
58
59
# File 'lib/renren2/interface/pages.rb', line 57

def is_fan(opts={})
  post 'pages.isFan', :body => opts
end

#is_page(page_id) ⇒ Object

判断一个ID是否为Page

Parameters:

  • page_id (int)

    Page的ID

See Also:



94
95
96
# File 'lib/renren2/interface/pages.rb', line 94

def is_page(page_id)
  post 'pages.isPage', :body => {:page_id => page_id}
end

#quit(page_id) ⇒ Object

与某个公共主页解除粉丝关系

Parameters:

  • page_id (int)

    Page的ID

See Also:



36
37
38
# File 'lib/renren2/interface/pages.rb', line 36

def quit(page_id)
  post 'pages.quit', :body => {:page_id => page_id}
end

#set_status(status, page_id) ⇒ Object

Page管理员修改Page的状态

Parameters:

  • status (String)

    管理员更新的page状态信息,最多140个字符

  • page_id (int)

    Page的ID

See Also:



46
47
48
# File 'lib/renren2/interface/pages.rb', line 46

def set_status(status, page_id)
  post 'pages.setStatus', :body => {:status => status, :page_id => page_id}
end