I just read about everybody's favorite blogger -- who shall remain nameless, because I don't wish to discuss him -- shutting down a popular blogging site he was running, without notice. One person commented thusly:
There you go boys and girls: the number one reason why you don't want to go with a hosted solution, and if you do, backup. Frequently. No matter how nice or cuddly or professional the host -- back your material up at least weekly. Never give anyone control over what happens to your writing. Never.Sound advice, that.
#!/usr/bin/perl use warnings; use strict;
$ENV{TZ} = 'GMT';
use Data::Dumper; use Date::Parse; use File::Path; use File::Spec::Functions; use SOAP::Lite;
my $host = 'use.perl.org'; my $uri = "http://$host/Slash/Journal/SOAP"; my $proxy = "http://$host/journal.pl"; my $uid = 1; my $backup = catdir($ENV{HOME}, 'Documents', 'journal', $host); my $max = 1000;
mkpath($backup);
my $journal = SOAP::Lite->uri($uri)->proxy($proxy); my $recents = $journal->get_entries($uid, $max)->result;
for my $recent (@$recents) { my $id = $recent->{id}; my $file = catfile($backup, $id); next if -e $file; my $entry = $journal->get_entry($id)->result;
open my $fh, '>', $file or die "Can't open $file: $!"; print $fh Dumper $entry; close $fh;
my $time = str2time($entry->{date}); utime $time, $time, $file; }
Re:Just remember to change the UID
pudge on 2004-06-16T02:03:57
Oops.:-)
Re:Comments?
pudge on 2004-06-16T03:05:16
Just screen-scraping.
Since it not only makes backups of my journal, but also serveral other peoples.
That's a, uh, feature. Yeah, that's the ticket.