Class: Renren2::Interface::Photos
- Defined in:
- lib/renren2/interface/photos.rb
Overview
Photos Interface
Instance Method Summary collapse
-
#accept_tag(tag_id, photo_owner_id) ⇒ Object
接受圈人请求.
-
#add_comment(uid, content, opts = {}) ⇒ Object
对可见照片或者相册进行评论.
-
#create_album(name, opts = {}) ⇒ Object
以人人用户的身份创建相册.
-
#get(uid, opts = {}) ⇒ Object
获取可见照片的相关信息.
-
#get_albums(uid, opts = {}) ⇒ Object
获取用户的相册列表信息。当取第一页时,会返回头像相册和快速上传相册.
-
#get_comments(uid, opts = {}) ⇒ Object
获取可见照片的相关评论内容.
-
#get_tags(photo_id, owner_id, opts = {}) ⇒ Object
获取照片中圈出的好友或人.
-
#refuse_tag(tag_id, photo_owner_id) ⇒ Object
拒绝接受圈人请求.
-
#tag(photo_id, owner_id, photo_width, photo_height, top, left, frame_width, frame_height, opts = {}) ⇒ Object
圈出照片中的好友或人.
-
#upload(upload, content_type, opts = {}) ⇒ Object
上传照片到用户的相册,同时返回这张照片的信息.
Methods inherited from Base
#check_scope, #initialize, #post, #request
Constructor Details
This class inherits a constructor from Renren2::Interface::Base
Instance Method Details
#accept_tag(tag_id, photo_owner_id) ⇒ Object
Note:
require “deal_request” scope
接受圈人请求
159 160 161 162 |
# File 'lib/renren2/interface/photos.rb', line 159 def accept_tag(tag_id, photo_owner_id) check_scope "deal_request" post 'photos.acceptTag', :body => {:tag_id => tag_id, :photo_owner_id => photo_owner_id} end |
#add_comment(uid, content, opts = {}) ⇒ Object
Note:
require “read_user_photo,publish_comment” scope
对可见照片或者相册进行评论
86 87 88 89 90 |
# File 'lib/renren2/interface/photos.rb', line 86 def add_comment(uid, content, opts={}) check_scope "read_user_photo" check_scope "publish_comment" post 'photos.addComment', :body => {:uid => uid, :content => content}.merge(opts) end |
#create_album(name, opts = {}) ⇒ Object
Note:
require “create_album” scope
以人人用户的身份创建相册
21 22 23 24 |
# File 'lib/renren2/interface/photos.rb', line 21 def create_album(name, opts={}) check_scope "create_album" post 'photos.createAlbum', :body => {:name => name}.merge(opts) end |
#get(uid, opts = {}) ⇒ Object
Note:
require “read_user_photo” scope
获取可见照片的相关信息
69 70 71 72 |
# File 'lib/renren2/interface/photos.rb', line 69 def get(uid, opts={}) check_scope "read_user_photo" post 'photos.get', :body => {:uid => uid}.merge(opts) end |
#get_albums(uid, opts = {}) ⇒ Object
Note:
require “read_user_album” scope
获取用户的相册列表信息。当取第一页时,会返回头像相册和快速上传相册
36 37 38 39 |
# File 'lib/renren2/interface/photos.rb', line 36 def get_albums(uid, opts={}) check_scope "read_user_album" post 'photos.getAlbums', :body => {:uid => uid}.merge(opts) end |
#get_comments(uid, opts = {}) ⇒ Object
Note:
require “read_user_photo,read_user_comment” scope
获取可见照片的相关评论内容
103 104 105 106 107 |
# File 'lib/renren2/interface/photos.rb', line 103 def get_comments(uid, opts={}) check_scope "read_user_photo" check_scope "read_user_comment" post 'photos.getComments', :body => {:uid => uid}.merge(opts) end |
#get_tags(photo_id, owner_id, opts = {}) ⇒ Object
Note:
require “read_user_photo” scope
获取照片中圈出的好友或人
147 148 149 150 |
# File 'lib/renren2/interface/photos.rb', line 147 def (photo_id, owner_id, opts={}) check_scope "read_user_photo" post 'photos.getTags', :body => {:photo_id => photo_id, :owner_id => owner_id}.merge(opts) end |
#refuse_tag(tag_id, photo_owner_id) ⇒ Object
Note:
require “deal_request” scope
拒绝接受圈人请求
171 172 173 174 |
# File 'lib/renren2/interface/photos.rb', line 171 def refuse_tag(tag_id, photo_owner_id) check_scope "deal_request" post 'photos.refuseTag', :body => {:tag_id => tag_id, :photo_owner_id => photo_owner_id} end |
#tag(photo_id, owner_id, photo_width, photo_height, top, left, frame_width, frame_height, opts = {}) ⇒ Object
Note:
require “send_request” scope
圈出照片中的好友或人
125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/renren2/interface/photos.rb', line 125 def tag(photo_id, owner_id, photo_width, photo_height, top, left, frame_width, frame_height, opts={}) check_scope "send_request" post 'photos.tag', :body => {:photo_id => photo_id, :owner_id => owner_id, :photo_width => photo_width, :photo_height => photo_height, :top => top, :left => left, :frame_width => frame_width, :frame_height => frame_height}.merge(opts) end |
#upload(upload, content_type, opts = {}) ⇒ Object
Note:
require “photo_upload” scope
上传照片到用户的相册,同时返回这张照片的信息
52 53 54 55 |
# File 'lib/renren2/interface/photos.rb', line 52 def upload(upload, content_type, opts={}) check_scope "photo_upload" post 'photos.upload', :body => {:upload => Faraday::UploadIO.new(upload, content_type)}.merge(opts) end |