Bot-BasicBot-Pluggable
view release on metacpan or search on metacpan
examples/chump.cgi view on Meta::CPAN
# not require people to remember which way round to put the link and
# title. This is pretty easy to get right - 90% of the time, the link
# is really obvious. These tests will catch 99% of the cases.
# catch 'real' urls - http://, ftp://, etc.
if ($one =~ /^\w+:\/\//) {
return "<a href=\"$one\">$two</a>";
} elsif ($two =~ /^\w+:\/\//) {
return "<a href=\"$two\">$one</a>";
# catch just numbers, guess if it's a blog_id or a timestamp
# TODO if we ever have >10^8 blog entries, this will break.
# Hopefuly, time() will be larger by then, and I can adjust this
# number.
} elsif ($one =~ /^\d{8,}$/) {
return "<a href=\"".CGI::url()."?timestamp=$one\">$two</a>";
} elsif ($one =~ /^\d+$/) {
return "<a href=\"".CGI::url()."?blog_id=$one\">$two</a>";
} elsif ($two =~ /^\d{8,}$/) {
return "<a href=\"".CGI::url()."?timestamp=$two\">$one</a>";
} elsif ($two =~ /^\d+$/) {
( run in 0.495 second using v1.01-cache-2.11-cpan-748bfb374f4 )