Description

Using this plugin, you can display a list of your del.icio.us bookmarks inside a DokuWiki page. It makes use of del.icio.us' JSON feed and fetches all bookmarks of your account for tags given. You can even combine tags using Boolean operators.

Syntax

{{delicious>[[a|o|n]?]TAG1 [TAG2 TAG3]}}

a, o, n are optional:

a = AND: all bookmarks tagged with each tag

o = OR: all bookmarks tagged with any of the tags

n = NOT: all bookmarks tagged with TAG1, but not TAG2, TAG3 etc.

if you omit a, o or n, a will be presumed

if you use a, o or n, don't forget the question mark!

You can use as many tags as you want, delimited by a white space (' ')

Examples

To make it easier to get into the usage of this plugin, I registered a demo account at del.icio.us: Username is dokuwiki. It is set as the default account when you install the plugin. After installation, try these:

one tag

{{delicious>dokuwiki}}

which is the same as

{{delicious>a?dokuwiki}} or {{delicious>o?dokuwiki}} or {{delicious>n?dokuwiki}}

The result should be this:

AND, multiple tags

Now let's search all posts that are tagged 'dokuwiki' and 'reference':

{{delicious>dokuwiki reference}}

which is the same as

{{delicious>a?dokuwiki reference}}

OR, multiple tags

We're searching for all bookmarks tagged either 'web2.0' or 'del.icio.us' or both 'web2.0' and 'del.icio.us':

{{delicious>o?web2.0 del.icio.us}}

NOT, multiple tags

Now we want to list all bookmarks tagged 'web2.0' but not tagged 'dokuwiki':

{{delicious>n?web2.0 del.icio.us}}

I think you see the point. You can use as many tags as you want, but be careful: For OR and NOT queries, a set of results is pulled from del.icio.us for every tag and then merged or reduced respectively. That might be a performance and/or bandwidth issue, though most probably not.

delicious link images

To make the plugin render lists bulleted with little del.icio.us logos, add this line to your /conf/interwiki.conf:

delicious http://del.icio.us/tag/

and move/copy the file /lib/plugins/delicious/images/delicious.gif to /lib/images/interwiki/

If you set up interwiki.conf, put the icon in place and set Interwiki Icon to 1, then a post might look like this:
Neat, huh? It has the additional benefit, that you can now link to sets of bookmarks on del.icio.us with interwiki syntax: [[delicious>dokuwiki+del.icio.us|Bookmarks tagged **dokuwiki** and **del.icio.us** on del.icio.us]].

Note: This is not necessary to use the plugin. It's just stylistic sugar.

Description instead of tags

If you change Links description to desc you get something like this:

Known Bugs / Troubleshooting

Amount of bookmarks is limited to 100 per request, i.e. per tag.

Characters in tags that can't conveniently be URL-encoded (e.g. '?' and '&') will break the matching pattern.

I adapted your modified getJSON() method to use the DokuHTTPClient. The idea is nice, but I hesitate to implement it. While this makes sense for some cases, it might not be what users want as the global default. — konstantin baierer 2009/01/24 14:19

Standalone script exporting del.icio.us links to DokuWiki Syntax

Hi,

I've written a class to get all bookmarks into my DokuWiki. You can export all bookmarks from del.icio.us under settings → Bookmarks: export / backup. Include both tags and notes. After downloading the class turns that file either into an array or DokuWiki syntax. It creates H3's from tags and puts all bookmarks into an unordered list. It's just a quick and dirty solution but maybe someone will find it useful. — Kai Schaper 2007-07-19 09:12

in witch file must I put the class and what have it to write into the DokuWiki page?

It's not an extension for the del.icio.us Plugin. It's just a simple stand alone script to turn your exported bookmarks into DokuWiki syntax.

Password-secured del.icio.us account?

— Jordan 2007-11-23 15:56
Hello, is there a way to make it work with a private delicious ?
Giving the password in the conf file ?
It would be great !!

I wrote a patch to get private links. But I gave up during my tests. If I want to access private links I must use the API. This API blocks more requests than one every second.
If anyway someone interested in my patch you can contact me. — nougad 2008-07-05 04:13

The first version of this plugin used the API and respected the “one query per second” policy, but parsing XML is complicated for the differences in PHP4 and PHP5 and overkill for a simple functionality like the one this plugin offers. — konstantin baierer 2008/12/31 11:36

"AND" doesn't work

With the patch described above. I submitted a hack below.

For example, if I have

{{delicious>foo bar}}

I don't get anything back. I'm using DokuWiki 2008-05-05 with PHP version 5.2. (I think).

I had to comment out the line that runs urlencode on the tags, because it was messing with the + that is put between the tags when using something like this:

Where you want foo+bar.

Here's the patch, just rem-out the $tags = urlencode($tag) line, and then add a line with $tags=$tag;. I haven't had time to really find out why this is occurring, but I did narrow it down to the urlencode function being called.

You don't have to put + between the tags you want to combine with AND. Just use spaces! The plugin implements the Boolean set logic internally and your patch will break it. Update to the newest version and everything should work again. — konstantin baierer 2008/12/31 11:36

I've just been looking for a solution to the AND tags problem and I have commented-out the urlencode line as suggested above and that worked. I've got the latest version from this page today. Maybe there's some other reason why this is needed? — Steven Robertson 2009/01/23 15:03

I can't reproduce the issue, but it seems to be an issue nonetheless, so I added a configuration option that disables the offending urlencode($tag) line. Could you give me an example of a tag set that fails with urlencode enabled? — konstantin baierer 2009/01/24 03:56