module Delicious::Bookmarks::Methods::All

Public Instance Methods

all() click to toggle source

Returns all bookmarks associated with given access token. Results can be paginated:

“‘ruby client.all.offset(150).limit(50).to_a “`

And filtered by date and tag:

“‘ruby client.all.tag(’angular’).from(‘2013/11/12 10:23:00’).to(‘2013/11/13 12:10:00’) “‘

@see Criteria @return [Criteria]

# File lib/delicious/bookmarks/methods/all.rb, line 93
def all
  Criteria.new do |criteria|
    response = @client.connection.get '/v1/posts/all', criteria.params.merge(tag_separator: 'comma')
    posts = response.body['posts'] ? response.body['posts']['post'] : []
    posts.map do |post_attrs|
      Delicious::Post.build_persisted @client,
        url:         post_attrs['href'],
        description: post_attrs['description'],
        extended:    post_attrs['extended'],
        tags:        post_attrs['tag'],
        dt:          post_attrs['time'],
        shared:      (post_attrs['shared'] == 'yes')
    end
  end
end