Class: Renren2::Interface::Like

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

Overview

Like 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

#get_count(urls) ⇒ Object

获取url被喜欢的次数

Parameters:

See Also:



25
26
27
# File 'lib/renren2/interface/like.rb', line 25

def get_count(urls)
  post 'like.getCount', :body => {:urls => urls}
end

#is_liked(uids, urls) ⇒ Object

判断用户是否喜欢过url

Parameters:

See Also:



16
17
18
# File 'lib/renren2/interface/like.rb', line 16

def is_liked(uids, urls)
  post 'like.isLiked', :body => {:uids => uids, :urls => urls}
end

#like(url) ⇒ Object

Note:

require “operate_like” scope

no test below 对某一url执行喜欢操作

Parameters:

  • url (String)

    被喜欢的url

See Also:



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

def like(url)
  check_scope "operate_like"
  post 'like.like', :body => {:url => url}
end

#unlike(url) ⇒ Object

Note:

require “operate_like” scope

对某一url执行取消喜欢操作

Parameters:

  • url (String)

    被取消喜欢的url

See Also:



47
48
49
50
# File 'lib/renren2/interface/like.rb', line 47

def unlike(url)
  check_scope "operate_like"
  post 'like.unlike', :body => {:url => url}
end