lib/mambanation/base.rb in mambanation-0.1.12 vs lib/mambanation/base.rb in mambanation-0.1.13

- old
+ new

@@ -10,15 +10,15 @@ @client = client @fbs_cookies = fbs_cookies end # - # Users + # Famous # - # def create_user(user) - # perform_post("/users", :body => { :user => user }) - # end + def famous(query = {}) + perform_get("/users/famous.json", :query => query) + end def current_user perform_get("/users/me") unless fbs_cookies.nil? end @@ -87,20 +87,32 @@ # Options: facet_id def facet(id) perform_get("/facets/#{id.to_i}.json") end + def famous_facets(query = {}) + perform_get("/facets/famous.json", :query => query) + end + # Options: user_id def user_facets(id, query = {}) perform_get("/users/#{id.to_i}/facets.json", :query => query) end + def facet_coms(id, query = {}) + perform_get("/facets/#{id.to_i}/coms.json", :query => query) + end + + def facet_messages(id, query = {}) + perform_get("/facets/#{id.to_i}/messages.json", :query => query) + end + # # Badges # - def badges - perform_get("/badges.json") + def badges(query = {}) + perform_get("/badges.json", :query => query) end def user_badges(id, query = {}) perform_get("/users/#{id.to_i}/badges.json", :query => query) end @@ -167,10 +179,10 @@ def announcements(id) perform_get("/users/#{id.to_i}/announcements.json") end protected - + def self.mime_type(file) case when file =~ /\.jpg/ then 'image/jpg' when file =~ /\.gif$/ then 'image/gif' when file =~ /\.png$/ then 'image/png'