class PinboardClient

Public Class Methods

new(opts) click to toggle source
# File lib/pinboard_client.rb, line 8
def initialize(opts)
  @options = {:basic_auth => {:username => opts[:user], :password => opts[:pass]}}
  self.class.http_proxy(*opts.values_at(:proxy_host, :proxy_port, :proxy_user, :proxy_pass))
end

Public Instance Methods

delete(url) click to toggle source
# File lib/pinboard_client.rb, line 20
def delete(url)
  self.class.get("/posts/delete?url=#{url}", @options)
end
get_urls() click to toggle source
# File lib/pinboard_client.rb, line 13
def get_urls
  response = self.class.get('/posts/all', @options)
  if response.success?
    response['posts']['post'].map { |post| post['href'] }
  end
end