submitted by jethro. what it does is something like:
jethro | cocogivre: literal cmd: bar (.*?)
cocogivre | "CMD: bar (.*?)" is "($1): $1 a une ptite bite -> <URL>http://www.lala.com/sa?q=$1</URL>"
jethro | !bar test test1 test2
cocogivre | test test1 test2 a une ptite bite -> http://www.lala.com/sa?q=test%20test1%20test2
(the <url></url> is case insensitive)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1115
c11ca15a-4712-0410-83d8-
924469b57eb5
}
&status("Reply.pl: $done SARs done.") if ($done);
+ # <URL></URL> type
+ #
+ while ($txt =~ /<URL>(.*)<\/URL>/){
+ &status("we have to norm this <URL></URL> stuff, SARing");
+ my $foobar = $1;
+ if ($foobar =~ m/(http:\/\/[^?]+)\?(.*)/){
+ my ($pig1,$pig2) = ($1,$2);
+ &status("SARing using URLencode");
+ $pig2=~s/([^\w])/sprintf("%%%02x",ord($1))/gie;
+ $foobar=$pig1."?".$pig2;
+ }
+ $txt =~ s/<URL>(.*)<\/URL>/$foobar/;
+ }
return $txt;
}