How-to: Backup Del.icio.us to Gmail
I recently decided that I have a serious dependency issue with the del.icio.us social bookmarking service. I access all my bookmarks from multiple computers and mobile handsets on a daily basis. Of late I’ve realized that the disappearance of my del.icio.us account - however unlikely - would cause me to go into internet dependency retardation and/or shock.
I’ve tried a few of the scripts that are floating around the net for backing up del.icio.us to Gmail. The easiest one by far to get up and running with minimal dependencies. The end result will backup your entire del.icio.us links collection to your 2GB Gmail account.
Step one: Look at this mess! Clean it up now!!!
This first step is optional although I highly recommend it. In the past I would simple fill out the description field when posting to my account. It’s a good habit to fill out the extended field as well. This script uses the description field as the subject line and places the extended field information and tags in the body of the email. In addition, the script will also scrape a current version of your link and add the pure HTML of the website to the email body.
Step two: ssss… Is that a Python in your pants?
Download and install Python 2.4. Installation is straight forward. If you’re looking clarification or help, feel free to ask.
Step three: Download some herbal magic
You’ll need to download and install cElementTree and the most recent standard ElementTree library. Thankfully all these little bits have installers.
Step four: The magic backup script
Navigate yourself to Bill Mill’s and download a copy of the backup delicious script. Open the script with a plain text editor the appropriate lines and save.
Step five: Create a Gmail filter
Login to your Gmail account and click on ‘Settings’ > ‘Filters’. Create a filter for messages addressed TO: your yourusername+del.icio.us@gmail.com. Add the label of your choice, and check the ‘Skip inbox’ rule (unless you want all your links to show up as new messages to sift through).
Step six: Del.icio.us + Gmail goodness
The last and final step is running the script. For Windows users, the easiest method is clicking Start > Run. Type ‘cmd’ and hit ‘Enter’. In the DOS prompt, ‘cd’ to the directory where your script is saved. Example:
cd G:\derek\python\
G:\ being the drive letter (my thumbdrive), and derek\python\ being the python folder within derek on the thumdrive. Once you’re in the correct directory, type backup_delicious.py and hit ‘Enter’. If everything was setup correctly, all those tidbits of text flowing on your screen - you should recognize some of your links - indicate that your del.icio.us links are being backed up and forwarded. If the script stops, restarting the script will simply force it to continue where it left off.
The end result will be a backup of all your links:
Update: If you’re having difficulty updating your backup collection on Gmail, delete the update file which is created by the script and re-run.
Update #2: Martin on TipMonkies updated the delicious_backup.py script to remove the HTML code from the email body. The description, tags, and link remain just like the script posted above.