Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hashie gem version #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 34 additions & 30 deletions lib/weibo_2/api/v2/statuses.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,120 +2,124 @@ module WeiboOAuth2
module Api
module V2
class Statuses < Base

#read interfaces
def public_timeline(opt={})
hashie get("statuses/public_timeline.json", :params => opt)
end

def friends_timeline(opt={})
hashie get("statuses/friends_timeline.json", :params => opt)
end

def home_timeline(opt={})
hashie get("statuses/home_timeline.json", :params => opt)
end

def friends_timeline_ids(opt={})
hashie get("statuses/friends_timeline/ids.json", :params => opt)
end

def user_timeline(opt={})
hashie get("statuses/user_timeline.json", :params => opt)
end

def user_timeline_ids(opt={})
hashie get("statuses/user_timeline/ids.json", :params => opt)
end

def timeline_batch(opt={})
hashie get("statuses/timeline_batch.json", :params => opt)
end

def repost_timeline(id, opt={})
hashie get("statuses/repost_timeline.json", :params => {:id => id}.merge(opt))
end

def repost_timeline_ids(id, opt={})
hashie get("statuses/repost_timeline/ids.json", :params => {:id => id}.merge(opt))
end

def repost_by_me(opt={})
hashie get("statuses/repost_by_me.json", :params => opt)
end

def mentions(opt={})
hashie get("statuses/mentions.json", :params => opt)
end

def mentions_ids(opt={})
hashie get("statuses/mentions/ids.json", :params => opt)
end

def bilateral_timeline(opt={})
hashie get("statuses/bilateral_timeline.json", :params => opt)
end

def show(opt={})
hashie get("statuses/show.json", :params => opt)
end

def querymid(opt={})
hashie get("statuses/querymid.json", :params => opt)
end

def queryid(opt={})
hashie get("statuses/queryid.json", :params => opt)
end

def hot_repost_daily(opt={})
hashie get("statuses/hot/repost_daily.json", :params => opt)
end

def hot_repost_weekly(opt={})
hashie get("statuses/hot/repost_weekly.json", :params => opt)
end

def hot_comments_daily(opt={})
hashie get("statuses/hot/comments_daily.json", :params => opt)
end

def hot_comments_weekly(opt={})
hashie get("statuses/hot/comments_weekly.json", :params => opt)
end

def count(opt={})
hashie get("statuses/count.json", :params => opt)
end

#write interfaces
def repost(id, opt={})
hashie post("statuses/repost.json", :params => {"id" => id}.merge(opt))
end

def destroy(id)
hashie post("statuses/destroy.json", :params => {"id" => id})
end

def update(status, opt={})
hashie post("statuses/update.json", :params => {"status" => status}.merge(opt))
end


def upload(status, pic, opt={})
multipart = build_multipart_bodies({"status" => status, "pic" => pic}, opt)
hashie post("statuses/upload.json", :headers => multipart[:headers], :body => multipart[:body])
end

def upload_url_text(opt={})
hashie post("statuses/upload_url_text.json", :params => opt)
end

def emotions(opt={})
hashie get("emotions.json", :params => opt)
end


def upload_pic(pic)
hashie post("statuses/upload_pic.json", :params => {pic: pic})
end

end
end
end
end
end
2 changes: 1 addition & 1 deletion weibo_2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency "rspec", "~> 2.6"

gem.add_runtime_dependency 'oauth2', "~> 0.9.1"
gem.add_runtime_dependency 'hashie', "~> 2.0.4"
gem.add_runtime_dependency 'hashie', "~> 3.4.0"
gem.add_runtime_dependency 'multi_json' , "~> 1"
gem.add_runtime_dependency 'rest-client', "~> 1.7.3"
end