Class: Renren2::Interface::Feed

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

Overview

Feed Interface

Instance Method Summary collapse

Methods inherited from Base

#check_scope, #initialize, #post, #request

Constructor Details

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

Instance Method Details

#get(type, opts = {}) ⇒ Object

Note:

require “read_user_feed” scope

获取当前用户的新鲜事内容

Parameters:

Options Hash (opts):

  • :uid (int)

    支持传入当前用户的一个好友ID,表示获取此好友的新鲜事,如果不传,默认为获取当前用户的新鲜事

  • :page (int)

    支持分页,指定页号,页号从1开始,默认值为1

  • :count (int)

    支持分页,每一页记录数,默认值为30,最大50

See Also:



21
22
23
24
# File 'lib/renren2/interface/feed.rb', line 21

def get(type, opts={})
  check_scope "read_user_feed"
  post 'feed.get', :body => {:type => type}.merge(opts)
end

#publish_feed(name, description, url, opts = {}) ⇒ Object

Note:

require “publish_feed” scope

以当前会话的用户(session_key对应用户)身份发送应用的自定义新鲜事

Parameters:

  • name (String)

    新鲜事标题 注意:最多30个字符

  • description (String)

    新鲜事主体内容 注意:最多200个字符

  • url (String)

    新鲜事标题和图片指向的链接

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

    a customizable set of options

Options Hash (opts):

  • :image (String)

    新鲜事图片地址

  • :caption (String)

    新鲜事副标题 注意:最多20个字符

  • :action_name (String)

    新鲜事动作模块文案。 注意:最多10个字符

  • :action_link (String)

    新鲜事动作模块链接

  • :message (String)

    用户输入的自定义内容。注意:最多200个字符

See Also:



39
40
41
42
# File 'lib/renren2/interface/feed.rb', line 39

def publish_feed(name, description, url, opts={})
  check_scope "publish_feed"
  post 'feed.publishFeed', :body => {:name => name, :description => description, :url => url}.merge(opts)
end