Applied Research. Big Data. Distributed Systems. Open Source.

Delicious Python API

One of my research tasks required me to retrieve various information from Delicious.com,
a well-known social bookmarking service. My programming language of choice is Python, and so I wrote a basic Python
module for getting the data I needed.

Figure 1: A tag cloud as seen on Delicious.com

deliciousapi.py

Important Note: It is strongly advised that you read the Delicious.com Terms of Use document before using this Python module. In particular, read section 5 “Intellectual Property”.

Part of the functionality in DeliciousAPI is implemented by calling the official Delicious.com API or parsing its
JSON feeds, other parts are provided by mining and scraping data directly from the Delicious.com website. The module
is able to detect IP throttling, which is employed by Delicious.com to temporarily block abusive HTTP request behavior,
and will raise a custom Python error to indicate that. Please be a nice netizen and do not stress the Delicious.com
service more than necessary. I don’t, and you shouldn’t, too.

DeliciousAPI provides the following features plus some more:

get_urls(): retrieves the most recent URLs which have been bookmarked and annotated with a given tag; supports the retrieving links from the delicious hotlist (front page) plus /popular/<name_of_tag> and /tag/<name_of_tag>

get_url(): returns all public bookmarks of a URL, i.e. its “history”

get_user():

returns a user’s full bookmark collection including private bookmarks if you know username AND password;
in this case, all communication with Delicious.com is encrypted via SSL

returns a user’s full public bookmark collection if you don’t know the user password (additional parameter:
max_bookmarks; by default, only the 50 most recent bookmarks are retreived)

get_tags_of_user(): returns a user’s full tagging vocabulary, i.e. tags and tag counts, aggregated over
all public bookmarks