Created
September 30, 2012 12:54
-
-
Save datfaf/3806669 to your computer and use it in GitHub Desktop.
Delicious Backup Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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