1 Jul 2005 (updated 1 Jul 2005 at 12:17 UTC)
»
Linux Weekly News
Just renewed my LWN subscription. I encourage everyone with an interest in keeping up with what is going on in the world of Linux to give them money - its cheap, easy to do, and well worth the money. (Its also the only website I give money to in return for content, so that should give you an idea of how good I think it is).
Moving the blog
I've been talking about moving my blog over to my own website for a while. Since I've got my CMS working again (now with a nicer and more maintainable framework) I'm looking at writting the blog bit.
Task 1 was getting some data to work with before starting work on the renderer, so I looked into the best way to suck the data down from Advogato and ended up going with this quick hack:
#!/usr/bin/perl
use strict;
use warnings;
use WebService::Advogato;
use Date::Simple;
my $string_user = "dorward";
my $client = new WebService::Advogato($string_user, 'myFakePassword');
my $num_entries = $client->len($string_user) or die($!);
my $root = "/home/david/sBuilder/source/blog.dorward.me.uk/";
foreach my $int_index (0 .. $num_entries-1) {
my ($date_created, $date_updated) =
$client->getDates($string_user, $int_index);
print "Created: $date_created\n";
$date_created =~ s/T.*$//;
my $date = Date::Simple->new($date_created) or die($!);
my $year = $date->year();
my $month = $date->month();
my $day = $date->day();
my $date_string = sprintf("%04d/%02d/%02d", $year, $month, $day);
my $dir = $root . $date_string;
print $dir, "\n";
system("mkdir -p $dir");
my $entry_text = $client->get($string_user, $int_index);
open(FILE, ">>$dir/advogato.source");
print FILE $entry_text;
close(FILE);
}
The next job is to clean up the code it downloaded, while Advogato is nice and easy to use, it does do some unfortunate things to my markup, and makes me fake headings using bold paragraphs.