Shared Del.icio.us Accounts with Python 4

Posted by timgoh
on Wednesday, October 31

syncdelish is a little script I wrote that takes links in a del.icio.us user’s ‘links for you’ section and adds them to his bookmarks.

Basically if you run this script on crontab you automatically bookmark any links users have tagged as “for:”. You can use this to provide link-sharing via a single communal account for a group of people, or simply to auto-add links people send your way.

To use this for a shared account, just create a new account ie “deli”. Have everyone add this account to their del.icio.us network, and then just tag links you want to share with “for:deli”. Those links will be added to deli’s bookmarks whenever the script is run, so you will be able to access them easily1.

Script and usage

Download the script here (BSD licensed2)

Rename as you like and run with Python. Usage is:
syncdelish USERNAME PASSWORD FOR_YOU_FEED

Where FOR_YOU_FEED is the link to RSS at the bottom of the ‘links for you’ page. It looks something like ‘http://del.icio.us/rss/for/username?private=[longhash]’.

Known Issues

‘Links for you’ seems to be an incomplete del.icio.us feature. There are limitations with it as follows:

  • these links cannot be deleted by you
  • even if the original user who tagged it removes the for: tag, it still is not removed
  • there is no differentiation in the private feed for saved links and unsaved links
  • the private ‘links for you’ feed is protected via security by obscurity – no authentication needed, just relies on people not guessing the correct hashcode.

Also, the del.icio.us posting API has only two return codes: success and failure. There is no notification of “failure because duplicate”. Hence when a previously saved link is encountered, the script wrongly outputs failure. It doesn’t break, it just mistakenly tells you that this link could not be added instead of saying it already existed.

Basically, currently it seems that unless you are a del.icio.us developer you have no way of removing something tagged as for you. This leads to an entire more serious problem…

It means my script gets slower every time a link is added, since the list of links to copy only grows and never shrinks. Once the number of shared links gets to a reasonable size, the script is all but unusable, since my script does not know which is a duplicate.

There are a few ways I can resolve this:

  1. Scrape from HTML instead of XML (the link after toggles between ‘saved’ and ‘save this’). Rejected because that’s not the right way to do it.
  2. Log processed links in a file and skip over them if encountered. Rejected because one of my chosen constraints for this was implementing it with a single script.
  3. Take a ‘last_time_run’ or ‘frequency’ type optional parameter that skips all links added before the time given. This is still not ideal because the full list of for: links still has to be downloaded and processed. In other words it’s a hack. So, rejected for now, but if the status quo remains I will add in this feature.
  4. Whine to del.icio.us feedback about the limitations with ‘for you’ links, and then write a blog post whining some more.

As you already know, I picked option 4 for now. Do check back on this page for any updates.

Background and Credits

Thanks to Simon Willison I came across Natalie Downe’s Snafflr script. I liked the idea, but I wanted to implement my own version using del.icio.us’s native “for:” tag.


1 Links tagged with “for:” can only be accessed by the user account they are shared with.

2 Only reason I chose BSD over MIT is that the former has the name of my alma mater while the latter was too expensive for me to attend.

Automation 0

Posted by timgoh
on Sunday, February 11

There was a distinct lack of personal touch in my previous entry, no? I’ve been playing around with del.icio.us more recently as I tried to reorganize the way I process information. More on that in the future.

And I found this nifty feature (which their naming committee took great pains to christen – it’s called a “thingy”). You can enable it by “Daily Blog Posting” under the Settings menu. Just feed it the name/pass for your blog and an address to XMLRPC to. Then every day at a time of your choosing it posts the links you’ve added that day for you.

There’s just one thing I don’t like about this feature—your blog password is displayed in plaintext in your list of thingies. Strange design decision there.

Another caveat of this feature is that it brings my del.icio.us habits into the spotlight. I can just imagine the Joneses whispering away:

“What a convoluted and inconsistent tagging methodology Tim has! Tsk tsk”

“Tim’s del.icio.us usage has dropped recently. Do you think he’s been cheating with ma.gnolia?”