3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 03:33:06 +01:00

Include action_with_args in factoids export

This commit is contained in:
Pragmatic Software 2014-04-07 04:50:00 +00:00
parent 736056b586
commit 7367e4f18c
2 changed files with 11 additions and 3 deletions

View File

@ -167,7 +167,15 @@ sub export_factoids {
my $action = $self->factoids->hash->{$channel}->{$trigger}->{action};
$action =~ s/(.*?)http(s?:\/\/[^ ]+)/encode_entities($1) . "<a href='http" . encode_entities($2) . "'>http" . encode_entities($2) . "<\/a>"/ge;
$action =~ s/(.*)<\/a>(.*$)/"$1<\/a>" . encode_entities($2)/e;
print FILE "<td width=100%><b>$trigger</b> is " . $action . "</td>\n";
if(exists $self->factoids->hash->{$channel}->{$trigger}->{action_with_args}) {
my $with_args = $self->factoids->hash->{$channel}->{$trigger}->{action_with_args};
$with_args =~ s/(.*?)http(s?:\/\/[^ ]+)/encode_entities($1) . "<a href='http" . encode_entities($2) . "'>http" . encode_entities($2) . "<\/a>"/ge;
$with_args =~ s/(.*)<\/a>(.*$)/"$1<\/a>" . encode_entities($2)/e;
print FILE "<td width=100%><b>$trigger</b> is $action<br><br><b>with_args:</b> $with_args</td>\n";
} else {
print FILE "<td width=100%><b>$trigger</b> is $action</td>\n";
}
if(exists $self->factoids->hash->{$channel}->{$trigger}->{edited_by}) {
print FILE "<td>" . $self->factoids->hash->{$channel}->{$trigger}->{edited_by} . "</td>\n";

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 540,
BUILD_DATE => "2014-04-03",
BUILD_REVISION => 541,
BUILD_DATE => "2014-04-06",
};
1;