dirkobot/dbdump.pl
2011-06-28 18:55:19 -04:00

26 lines
681 B
Perl

#!/usr/bin/perl
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect("dbi:SQLite:dbname=bot-basicbot.sqlite","","");
=for comment
CREATE TABLE "basicbot" (
id INT PRIMARY KEY,
namespace TEXT,
store_key TEXT,
store_value LONGBLOB );
=cut
my $sth = $dbh->prepare("SELECT * FROM basicbot;");
$sth->execute();
while(my $row = $sth->fetchrow_hashref) {
$row->{store_value} =~ s/text\s*.*\s*alternat.*factoids$//ig;
$row->{store_value} =~ s/isis_\w*//ig;
print $row->{store_key}, "\n\t\t", $row->{store_value}, "\n" if ($row->{store_key} =~ s/infobot_//)
}