Blog::Normalize - Specification for a sane transition between different blogging systems
use Blog::Normalize::Wordpress; use Blog::Normalize::MovableType; # You've got to create the B::N objects with the database info: my $wp = Blog::Normalize::Wordpress->new( username => $username, password => $password, hostname => $hostname, database => $database, prefix => $prefix, ); my $mt = Blog::Normalize::MovableType->new( username => $username, password => $password, hostname => $hostname, database => $database, ); $wp->connect; $mt->connect; # As simple as: $mt->import(posts => $wp->posts);
I needed to convert a Wordpress blog to a MovableType one. Since I didn't find anything useful quickly on the web, I developed my own converter. Then I realized some other people could use it and some other ones could actually want it in the oppposite way. Then I thought on people trying to make the same on different blog systems. I've changed from one blog to another several times since I started my own (http://blog.damog.net/) in 2002 and it's been always a pain in the ass make converters. Hereby, I propose the Blog::Normalize module that could import and export all sorts of data from one blogging system to another, as long as they are supported which should be too hard for me (or everybody else, to do).
Objects represent a blog system. They are initialized with the needed information (like the DB info) and ready to get data, import and export. Posts, categories, users, everything should be able to be exported and imported if the common spec is followed.
The posts should be an array reference containing, as each of the elements, a hash reference containing each of the posts. As the time of writing, the values id, title, date, text, name should be passed.
id
title
date
text
name
This illustrates the idea:
my $posts = [ { id => 2, title => 'This post is awesome!', text => 'This is my second post on my blog. Welcome to it!', date => '2008-02-23 21:02:52', name => 'this-post-is-awesome', }, { id => 1, title => 'Hit by a taxi', text => 'Today, after leaving the office, I was hit by a taxi in New York City. I'm just fine but it was a shocking moment.', date => '2008-01-06 18:51:00', name => 'hit-by-a-taxi', }, ];
The id is usually just the idea for each of the posts, you may use the permalink here too.
The title of the post entry.
The extended entry of the post.
A YYYY-MM-DD mm:hh:ss formated time.
YYYY-MM-DD mm:hh:ss
A short string for identifying the post.
Nearly everything is broken :) The only thing that barely works right now is the import from Wordpress to MovableType, but more work is being done. I strongly support on the c<Release Early, Release Often> motto.
A LOT. ;)
Start the implementation of TextMotion.
Start the implementation of Blogger which won't use DBI but web scrapping.
Allow a DBI object on the constructor of the networks so we don't have to.
Specification for categories, user and different blogs within a same blogging system.
This may be taken as an specification for blogging systems, but I don't want the application to be too ambitious, so if you like the idea, it's great! Otherwise, if you think I'm reinventing the wheel or doing something that I shouldn't be doing, beat it. As Andy Lester commented on a Perlbuzz column, let new projects and ideas flow!
I do think it's nice to allow developers to make great things quickly, effectively and leaving all hard tasks to the backend through an easy spec.
David Moreno Garza, <damogar@gmail.com<gt> - http://damog.net/
To Raquel (http://www.maggit.com.mx/), who makes me happy every single day of my life.
Copyright (C) 2008 by David Moreno Garza
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
The Do What The Fuck You Want To public license also applies. It's really up to you.
To install Blog::Normalize, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Blog::Normalize
CPAN shell
perl -MCPAN -e shell install Blog::Normalize
For more information on module installation, please visit the detailed CPAN module installation guide.