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.

deliciousapi.py
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- HTTP proxy support
Here is a code snippet to demonstrate basic usage of deliciousapi.py:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
Download
You can download and install DeliciousAPI from the Python Package Index via setuptools/easy_install. Just run
1 2 3 4 5 | |
and after installation, a simple import deliciousapi in your Python scripts will do the trick.
An alternative is to download the code straight from my code repository on GitHub:
License
The code is licensed to you under the GNU General Public License, version 2.
Feedback
Comments, questions and constructive feedback are always welcome. Just drop me a note.