Project

delicious

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby wrapper for delicious.com API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0

Runtime

 Project Readme

Gem Version Build Status Coverage Status Code Climate

Delicious API wrapper

This gem is a delicious.com oAuth API client. It supports pretty much everything delicious API allows to do:

  • Manage bookmarks (get, create, delete)
  • Manage bundles (get, create, delete)
  • Manage tags (get, rename, delete)

Delicious API requires you to obtain user's oAuth token in order to access his/her account programmatically.

Requirements

Ruby versions higher than or equal to 1.9.3 are supported.

Installation

Add the following line into your Gemfile:

gem 'delicious', '~> 1.0.0'

Client configuration

You should obtain access token first.

client = Delicious::Client.new do |config|
  config.access_token = 'my-access-token'
end

Bookmarks

Get bookmarks

client.bookmarks.all returns all bookmarks created by user associated with access token. You can paginate results:

client.bookmarks.all.offset(50).limit(100)

It's possible to filter by tag, starting and ending dates:

client.bookmarks.all.tag('angular').from('2013/11/12 10:23:00').to('2013/11/13 12:10:00')

Create

client.bookmarks.create url:         'http://example.com',
                        description: 'Example bookmark',
                        tags:        'tag1,tag2,tag3'

It returns an instance of Delicious::Post which responds to persisted?.

Delete

If you have an instance of Delicious::Post which was saved, you can call delete on it:

post = client.bookmarks.create url: 'http://example.com', description: 'Example bookmark'
post.delete if post.persisted? # => true if bookmark was deleted, false otherwise

You can also delete bookmark with a client:

client.bookmarks.delete url: 'http://example.com' # => true if bookmark was deleted, false otherwise

Bundles

Bundles are named list of tags. See the following example for how to create a new bundle:

Create

bundle = client.bundles.set 'bundlename', %w(tag1 tag2)

It returns an instance of Delicious::Bundle on success and throws Delicious::Error if something went wrong on the server.

Delete

You can call bundle.delete or client.bundles.delete('bundlename') to delete existing bundle. It returns true on successful deletion and false otherwise.

Find by bundle name

bundle = client.bundles.find 'bundlename'

All bundles

bundles = client.bundles.all

Tags

Get all tags

tags = client.tags.all

Delete tag

client.tags.delete 'tag'

Rename tag

client.tags.rename 'old_name', 'new_name'

Links