Sha256: a396e68e1ffffe5cf0c94cb85b3bae21b19ea8be5a09364bf99a8f3ba154ae6e

Contents?: true

Size: 531 Bytes

Versions: 1

Compression:

Stored size: 531 Bytes

Contents

require 'httparty'

module Pinboard
  class Client
    include HTTParty
    base_uri 'api.pinboard.in:443/v1'

    def initialize(options={})
      @auth = { :username => options[:username],
                :password => options[:password] }
    end

    def posts(params={})
			options = {}
      options[:basic_auth] = @auth
			options[:query] = params
      posts = self.class.get('/posts/all', options)['posts']['post']
      if !posts.nil?
        posts.map { |p| Post.new(Util.symbolize_keys(p)) }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pinboard-0.0.3 lib/pinboard/client.rb