Skip to content

Instantly share code, notes, and snippets.

@datfaf
Created September 30, 2012 12:54
Show Gist options
  • Save datfaf/3806669 to your computer and use it in GitHub Desktop.
Save datfaf/3806669 to your computer and use it in GitHub Desktop.
Delicious Backup Script
#! /usr/bin/env python
# The Delicious API only returns 1000 bookmarks at a time.
# The web export returns them all in a single file.
# This script uses the latter to back up your bookmarks.
#
# To use:
# 1. Install requests: http://python-requests.org
# 2. Substitute your username and password below
# 3. Run and enjoy!
import requests
username = "[redacted]"
password = "[redacted]"
data = {"action": "login", "username": username, "password": password}
response = requests.post("http://delicious.com/login", data=data)
cookies = response.cookies
data = {"include_notes": "yes", "include_tags": "yes", "tags": ""}
response = requests.post("http://export.delicious.com/settings/bookmarks/export", data=data, cookies=cookies)
print unicode(response.content, errors="ignore").encode("utf-8")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment