From 28a5d47af18d43020caf5b3d6a8603a41d66eed2 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 1 Jul 2010 01:43:49 +0000 Subject: [PATCH] Exported factoids now have clickable links --- PBot/Factoids.pm | 6 +++++- PBot/VERSION.pm | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 79c2020e..aece9791 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -136,8 +136,12 @@ sub export_factoids { } else { print FILE "\n"; } + + my $action = $self->factoids->hash->{$channel}->{$trigger}->{action}; + $action =~ s/(.*?)http(s?:\/\/[^ ]+)/encode_entities($1) . "http$2<\/a>"/ge; + $action =~ s/(.*)<\/a>(.*$)/"$1<\/a>" . encode_entities($2)/e; - print FILE "$trigger is " . encode_entities($self->factoids->hash->{$channel}->{$trigger}->{action}) . "\n"; + print FILE "$trigger is " . $action . "\n"; print FILE "- submitted by " . $self->factoids->hash->{$channel}->{$trigger}->{owner} . "
" . localtime($self->factoids->hash->{$channel}->{$trigger}->{created_on}) . "\n\n\n"; } diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 39a30af6..6e265718 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 225, + BUILD_REVISION => 226, BUILD_DATE => "2010-06-30", };