lib/mambanation/base.rb in mambanation-0.1.5 vs lib/mambanation/base.rb in mambanation-0.1.6
- old
+ new
@@ -35,11 +35,11 @@
perform_get("/users/#{id.to_i}.json", :query => query)
end
alias_method :user_by_id, :user
def user_set_websession(id, credentials)
- perform_post("/users/#{id.to_i}/update_websession", :body => { :user_credentials => credentials })
+ perform_post("/users/#{id.to_i}/update_websession", :query => { :user_credentials => credentials })
end
#
# User actions
#
@@ -133,16 +133,16 @@
def create_post(post)
perform_post("/posts/create", :body => { :post => post })
end
- def post(id)
+ def posts(id)
perform_get("/posts/#{id.to_i}.json")
end
def publish_post(id, stream_id)
- perform_post("/posts/#{id.to_i}/publish", :body =>{ :post => { :stream_id => stream_id } })
+ perform_post("/posts/#{id.to_i}/publish.json", :body => { :post => { :stream_id => stream_id } })
end
#
# Roles
#
@@ -191,10 +191,10 @@
private
def request_options(opts={})
opts[:headers] ||= {}
- opts[:headers].merge! "FB-Cookies" => fbs_cookies
+ opts[:headers].merge! "FB-Cookies" => fbs_cookies if fbs_cookies
opts
end
def perform_get(path, options={})
MambaNation::Request.get(self, path, request_options(options))