20six blog downloader script

January 16, 2006 on 11:16 pm | In Coding | 6 Comments

As discussed yesterday, Here’s the (mostly) finished script.

It could do with being checked on Windows, I’ll do that at work tomorrow I expect.

You’ll need PHP 4.3 or above, get it from php.net. Then edit BlogBackupScript.php to have your 20six username and password, and run it!

Good luck!

Download here: blog downloader script (52Kb zip file)

Edit: Or try the brand new Windows version here: (requires .Net framework 2) Blog Downloader Windows Version 2 (47Kb zip file) – It now does everything the script version does!
Edit: The windows version of PHP can be downloaded here.

I’ve had a report of timeouts on downloading some blogs. I’ll see if there’s a fix for that. I may have to give up using the weblog API for downloading the posts and just grab the web pages directly (nuts!)

Edit: Important note for Windows

The default install of PHP seems to set up a 30 second time limit on your scripts; this means you can’t download a big blog without changing it. Fortunately it’s quite simple to do so:

  1. Find your php.ini file – probably it is in C:\WINDOWS\PHP.INI – and open it in Wordpad or your favourite text editor.
  2. Find the line that reads
    max_execution_time = 30

    and change the limit to be 0. This should stop the script from being shut off after 30 seconds.

  3. You might also want to put a semi-colon in front of the line starting ‘memory_limit’ to turn off any memory limit.
  4. Save php.ini
  5. Try your script again – it should now continue downloading your blog.

A good way of checking your blog is to take the XML files and opening them in Internet Explorer or Firefox; this will report an error if the file isn’t complete.
Really big blog?

If you have over 1000 posts in your blog you also need to edit the script slightly; find the line that reads

$numposts = 1000;

and add a 0 on the end to that it will download up to 10,000 posts.

6 Comments »

RSS feed for comments on this post. Add Comment Feed to Bloglines. TrackBack URI

  1. Bubb, you are a legend, nicely done!

    Comment by amillionpieces — 16 January 2006 #

  2. Well done, you! *claps*

    Comment by MJ — 17 January 2006 #

  3. Er….what’s php?

    Comment by Kate — 17 January 2006 #

  4. Sorry. It’s a bit technical isn’t it? Ok, quite a lot technical. PHP is a programming language that’s very useful for writing web pages with. It’s what this website (WordPress) is written using, and probably what 20six used as well… if they had any sense.

    If people get really stuck then I could always try backing up their blogs for them, and email them a zip file of the whole thing. But I’d need to know your username/password for that so that’s not a great idea really.

    I might be able to make an actual windows program to do it as well.

    Comment by bubb — 17 January 2006 #

  5. I go out with a legend *rubs badge*

    Comment by admin — 19 January 2006 #

  6. [...] Go look here to see how to do it. [...]

    Pingback by bobble » Blog Archive » Hold the Front Page: 20Six Blog Backup Script — 28 January 2006 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Creative Commons License This work is licensed under a Creative Commons Attribution 2.5 License.
Powered by WordPress with Pool theme design by Borja Fernandez, modified by bubb.
Entries and comments feeds. Valid XHTML and CSS. ^Top^