lib/tumblr/reader.rb in tumblr-rb-1.1.1 vs lib/tumblr/reader.rb in tumblr-rb-1.2.0

- old
+ new

@@ -11,9 +11,21 @@ # http://www.tumblr.com/docs/en/api#api_read def read(username, params={}) self.class.read username, :get, parameters(params) end + # http://www.tumblr.com/docs/en/api#api_pages + def pages(username) + Weary.get("http://#{username}.tumblr.com/api/pages") + end + + def all_pages(username) + raise 'You must provide an email address and password' if defaults.blank? + Weary.post("http://#{username}.tumblr.com/api/pages") do |req| + req.with = {:email => defaults[:email], :password => defaults[:password]} + end + end + # http://www.tumblr.com/docs/en/api#authenticated_read def authenticated_read(username, params={}) raise 'You must provide an email address and password' unless (params.include?(:email) && params.include?(:password)) || defaults self.class.read username, :post, parameters(params) end \ No newline at end of file