Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Ruby client for API.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


= WWW::Delicious

WWW::Delicious is a Ruby client for XML API.

It provides both read and write functionalities. You can read user Posts, Tags
and Bundles but you can create new Posts, Tags and Bundles as well.

== Overview

WWW::Delicious maps all the original API calls and provides some
additional convenient methods to perform common tasks.
Please read the official documentation (
to learn more about API.

WWW::Delicious is 100% compatible with all API constraints,
including the requirement to set a valid user agent or wait at least
one second between queries.
Basically, the main benefit from using this library is that you don't need
to take care of all these low level details, if you don't want:
WWW::Delicious will try to give you the most with less efforts.

== Dependencies

  * Ruby 1.8.6

== Source

WWW::Delicious source code is managed via GIT and hosted at GitHub:

== Download and Installation

Installing WWW::Delicious as a GEM is probably the best and easiest way.
You must have RubyGems[] installed
for the following instruction to work:

  $ sudo gem install www-delicious

To install the library manually grab the source code from the website, 
navigate to the root library directory and enter:

  $ sudo ruby setup.rb

If you need the latest development version you can download the source code
from the GIT repositories listed above.
Beware that the code might not as stable as the official release.

== Usage

In order to use this library you need a valid account.
Go to and register for a new account if you don't
already have one.

Then create a valid instance of WWW::Delicious with the account credentials.

  require 'www/delicious'
  # create a new instance with given username and password
  d ='username', 'password')
Now you can use your delicious instance to call on of the API methods available.

=== Last account update

The following example show you how to get the last account update Time.

  require 'www/delicious'
  d ='username', 'password')
  time = d.update # => Fri May 02 18:02:48 UTC 2008

=== Reading Posts

You can fetch your posts in 3 different ways:

  require 'www/delicious'
  d ='username', 'password')

  # 1. get all posts
  posts = d.posts_all
  # 2. get recent posts
  posts = d.posts_recent
  # 3. get a single post (the latest one if no criteria is given)
  posts = d.posts_get(:tag => 'ruby')

Each post call accepts some options to refine your search.
For example, you can always search for posts matching a specific tag.

  posts = d.posts_all(:tag => 'ruby')
  posts = d.posts_recent(:tag => 'ruby')
  posts = d.posts_get(:tag => 'ruby')

=== Creating a new Post

  require 'www/delicious'
  d ='username', 'password')
  # add a post from options
  d.posts_add(:url => '', :title => 'Cool site!')
  # add a post from WWW::Delicious::Post
  d.posts_add( => '', :title => 'Cool site!'))

=== Deleting a Posts

  require 'www/delicious'
  d ='username', 'password')
  # delete given post (the URL can be either a string or an URI)

Note. Actually you cannot delete a post from a WWW::Delicious::Post instance.
It means, the following example doesn't work as some ActiveRecord user might expect.

  post = => '')

This feature is already in the TODO list. For now, use the following workaround
to delete a given Post.

  # delete a post from an existing post = WWW::Delicious::Post

=== Tags

Working with tags it's really easy. You can get all your tags or rename an existing tag.

  require 'www/delicious'
  d ='username', 'password')
  # get all tags
  tags = d.tags_get
  # print all tag names
  tags.each { |t| puts }
  # rename the tag gems to gem
  d.tags_rename('gems', 'gem')

=== Bundles

WWW::Delicious enables you to get all bundles from given account.

  require 'www/delicious'
  d ='username', 'password')
  # get all bundles
  bundles = d.bundles_all
  # print all bundle names
  bundles.each { |b| puts } 

You can also create new bundles or delete existing ones.

  require 'www/delicious'
  d ='username', 'password')
  # set a new bundle for tags ruby, rails and gem
  d.bundles_set('MyBundle', %w(ruby rails gem))
  # delete the old bundle

== Documentation

Visit the website[] for the full documentation
and more examples.

== Website and Project Home

  * {Project Homepage}[]
  * {At GitHub}[]
  * {At RubyForge}[]

== FeedBack and Bug reports

Feel free to email {Simone Carletti}[] 
with any questions or feedback.

Please submit your bug reports to the Redmine installation for WWW::Delicious
available at


  * allow Tags and Bundles to be passed as params for API calls
  * allow Tags, Bundles and Posts to be used for API call (no longer readonly)
  * improve the way new posts are created and updated
  * more (see issue tracker on the website)

== Changelog


Something went wrong with that request. Please try again.