32 lines
749 B
Perl
32 lines
749 B
Perl
#!/usr/bin/perl
|
|
|
|
use DBI;
|
|
|
|
|
|
my $dbh = DBI->connect("dbi:SQLite:dbname=bot-basicbot.sqlite","","");
|
|
|
|
|
|
#CREATE TABLE "basicbot" (
|
|
# id INT PRIMARY KEY,
|
|
# namespace TEXT,
|
|
# store_key TEXT,
|
|
# store_value LONGBLOB );
|
|
|
|
|
|
my $readsth = $dbh->prepare("SELECT id, namespace, store_key, store_value FROM basicbot");
|
|
my $updatesth = $dbh->prepare("UPDATE basicbot SET store_key = ? WHERE id = ?");
|
|
|
|
$readsth->execute();
|
|
|
|
$dbh->begin_work;
|
|
|
|
while(my @row = $readsth->fetchrow_array) {
|
|
if ($row[1] eq "Infobot") {
|
|
print $row[2], "\n";
|
|
my $newkey = $row[2];
|
|
$newkey =~ s/!/?/g;
|
|
$updatesth->execute($newkey, $row[0]);
|
|
}
|
|
}
|
|
|
|
$dbh->commit;
|