Backup Blog
February 13, 2009
My wife hosts her blog with a popular blogging service. She puts so much effort into her posts, that I want to make sure they get backed up. The service does not provide RSS feeds, so I decided to use Python Mechanize. Unfortunately, the documentation is less than ideal.
This script provides an example of logging into a form, searching links, and downloading the page contents. It snarfs the entire page and makes links to page elements point to the local copy, like using wget --convert-links or Firefox save "Web Page, complete".
Hopefully you will find it instructive. If you put it in a cron job, don't forget to remove the .py in the filename.
Download here: Backup Blog