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.

Comments

Leave a response

  1. bartuer@gmail.comDecember 31, 2007 @ 11:50 PM
    it is work well, I try it at http://del.icio.us/baobao121, a lot of thanks to you! and would you like add this page's permanent link to your script? so if some user want to update with it, can easily find it, because not every one will get it from this page, maybe they got it anywhere. thanks again for you good job!
  2. TimDecember 31, 2007 @ 11:50 PM
    Hi Bartuer. Glad you like it! I am actually planning a reorg of my hosting and blog at the moment, but once I do that and have a nicer home for the script and my other releases I will definitely include a link in the source. Thanks for remind me.
  3. exideterstelpMay 27, 2008 @ 09:44 AM

    Рулонные наплавляемые материалы оптом прямые поставки с заводов прямо на объект. лучшие цены.

  4. ForexmanJune 04, 2008 @ 10:44 PM

    Hi. This is really interesting post. Thank You! I have just subscribed to Your rss!

    Best regards

Comment