Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

gav (2710)

  (email not shown publicly)
AOL IM: flufflegavin (Add Buddy, Send Message)

Hacker in NYC.

Journal of gav (2710)

Thursday September 26, 2002
10:24 PM

cross blogging

[ #8045 ]
I've got the excellent MovableType as my blog on my website at but my life isn't interesting enough for me to maintain two logs. I had an idea about using Net::Blogger to get my post from use.perl and mirroring it. The documentation is a bit confusing but I persevered and here is my first stab:

use strict;
use Net::Blogger;

my $blog = Net::Blogger->new(engine => 'slash', debug => 0);


my ($ok, @posts) = $blog->getRecentPosts();

die "Error! Can't get use.perl recent posts!" unless $ok;

my $post = $blog->getPost($posts[0]->{postid});
my ($title, $content) = split /\n/, $post->{content}, 2;

my $new_post = <<"POST";
<p><i><font size="-1">From: <a href="">use.perl</a> Posted On: $post->{dateCreated}</font></i></p><p>$content</p>

my $mt = Net::Blogger->new(engine => "movabletype", debug => 0);

$mt->Username( *****);

    title => $title, description => $new_post, publish => 1

I'm going to tweak things a bit, saving the id's of posts so I can cron it to run hourly.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.