Class: Renren2::Interface::Blog
- Defined in:
- lib/renren2/interface/blog.rb
Overview
Blog Interface
Instance Method Summary collapse
-
#add_blog(title, content, opts = {}) ⇒ Object
创建一篇日志.
-
#add_comment(id, uid, content, opts = {}) ⇒ Object
发布一个人人网日志的评论.
-
#get(id, uid, opts = {}) ⇒ Object
获取自己或好友一篇日志的信息.
-
#get_comments(id, uid, opts = {}) ⇒ Object
获取一篇日志的评论.
-
#gets(uid, 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
#add_blog(title, content, opts = {}) ⇒ Object
Note:
require “publish_blog” scope
创建一篇日志
19 20 21 22 |
# File 'lib/renren2/interface/blog.rb', line 19 def add_blog(title, content, opts={}) check_scope "publish_blog" post 'blog.addBlog', :body => {:title => title, :content => content}.merge(opts) end |
#add_comment(id, uid, content, opts = {}) ⇒ Object
Note:
require “publish_blog,publish_comment” scope
发布一个人人网日志的评论
81 82 83 84 85 |
# File 'lib/renren2/interface/blog.rb', line 81 def add_comment(id, uid, content, opts={}) check_scope "publish_blog" check_scope "publish_comment" post 'blog.addComment', :body => {:id => id, :uid => uid, :content => content}.merge(opts) end |
#get(id, uid, opts = {}) ⇒ Object
Note:
require “read_user_blog” scope
获取自己或好友一篇日志的信息
48 49 50 51 |
# File 'lib/renren2/interface/blog.rb', line 48 def get(id, uid, opts={}) check_scope "read_user_blog" post 'blog.get', :body => {:id => id, :uid => uid}.merge(opts) end |
#get_comments(id, uid, opts = {}) ⇒ Object
Note:
require “read_user_blog,read_user_comment” scope
获取一篇日志的评论
64 65 66 67 68 |
# File 'lib/renren2/interface/blog.rb', line 64 def get_comments(id, uid, opts={}) check_scope "read_user_blog" check_scope "read_user_comment" post 'blog.getComments', :body => {:id => id, :uid => uid}.merge(opts) end |
#gets(uid, opts = {}) ⇒ Object
Note:
require “read_user_blog” scope
获取指定用户的可见日志信息列表
33 34 35 36 |
# File 'lib/renren2/interface/blog.rb', line 33 def gets(uid, opts={}) check_scope "read_user_blog" post 'blog.gets', :body => {:uid => uid}.merge(opts) end |