]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/blogspam.pm
useragent: Automatically choose whether to use LWPx::ParanoidAgent
[git.ikiwiki.info.git] / IkiWiki / Plugin / blogspam.pm
index 3eb4cf8b37f90272446d48a31d77c4b064052cc9..3835f52ca2b0a46df1f3a436f69b7bb576431e05 100644 (file)
@@ -57,18 +57,10 @@ sub checkconfig () {
        };
        error $@ if $@;
 
-       eval q{use LWPx::ParanoidAgent};
-       if (!$@) {
-               $client=LWPx::ParanoidAgent->new(agent => $config{useragent});
-       }
-       else {
-               eval q{use LWP};
-               if ($@) {
-                       error $@;
-                       return;
-               }
-               $client=useragent();
-       }
+       # Using the for_url parameter makes sure we crash if used
+       # with an older IkiWiki.pm that didn't automatically try
+       # to use LWPx::ParanoidAgent.
+       $client=useragent(for_url => $config{blogspam_server});
 }
 
 sub checkcontent (@) {