IronMan Update

No really, not just because I've not posted anything in.. a while. I got bored reading mst's mbox of ironman stuff, converting blog urls into atom/rss feeds, and typing the results into Plaggers yaml configuration file.

So I replaced all those manual entries with:

- module: Subscription::DBI
  config:
    schema_class: 'IronMan::Schema'
    connect_info: ['dbi:SQLite:/home/castaway/plagger/subscriptions.db']

And wrote one of these to convert the existing junk:

 #!/usr/bin/perl

 use strict;
 use warnings;
 use YAML 'LoadFile';
 use Data::Dumper;
 use Data::UUID;
 use IronMan::Schema;

 my $yamlfile = shift;
 my $dsn = shift;
 my $yaml_dump = LoadFile($yamlfile);

 my $schema = IronMan::Schema->connect($dsn);

 my ($sub_conf) = grep { $_->{module} eq 'Subscription::Config' } 
  @{ $yaml_dump->{plugins} };
 print Dumper($sub_conf);
 my $feeds = $sub_conf->{config}{feed};

 my $uuid = Data::UUID->new();
 foreach my $feed (@$feeds) {
     print "Feed: $feed->{url}\n";
     my $fdb = $schema->resultset('Feed')->find_or_new({ id => $uuid->create_str, %$feed}, { key => 'url' });
     if($fdb->in_storage) { 
         print "... already exists\n";
         next;
     }
     $fdb->insert;
 }

The twiddly part was setting up an app (form) for people to sign up, which now exists in the ironman repo, and runs on my local box, at the moment.

Thoughts of things to add:

Someone also needs to make the thing prettier!

Btw to install, symlink the css and image dirs from "plagger/assets/plugins/Publish-PagedPlanet/default/static" to the catalyst "root" dir.

@public,perl,ironman

Last modified: 2009-07-30T22:32:11

WTF