From 07d2750db67125c258b09d6ab27468685cb71bb6 Mon Sep 17 00:00:00 2001 From: simonraven Date: Tue, 15 Feb 2005 14:16:44 +0000 Subject: [PATCH] URL patch. submitted by jethro. what it does is something like: jethro | cocogivre: literal cmd: bar (.*?) cocogivre | "CMD: bar (.*?)" is "($1): $1 a une ptite bite -> http://www.lala.com/sa?q=$1" jethro | !bar test test1 test2 cocogivre | test test1 test2 a une ptite bite -> http://www.lala.com/sa?q=test%20test1%20test2 (the is case insensitive) git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1115 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Factoids/Reply.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Factoids/Reply.pl b/src/Factoids/Reply.pl index 8235bb5..b06347d 100644 --- a/src/Factoids/Reply.pl +++ b/src/Factoids/Reply.pl @@ -250,6 +250,19 @@ sub SARit { } &status("Reply.pl: $done SARs done.") if ($done); + # type + # + while ($txt =~ /(.*)<\/URL>/){ + &status("we have to norm this 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>/$foobar/; + } return $txt; } -- 2.39.5