|
@@ -150,6 +150,16 @@ sub adh_abo_ffdn {
|
|
|
|
|
|
}
|
|
|
|
|
|
+# on note les RP
|
|
|
+sub rp {
|
|
|
+ my $link = shift @_;
|
|
|
+ my $filename = "/var/www/rp/rp.txt";
|
|
|
+ my $filehandle;
|
|
|
+ open ($filehandle, '>>', $filename) or die "Impossible d'ouvrir le fichier $filename en écriture";
|
|
|
+ print $filehandle "$link\n";
|
|
|
+ close $filehandle;
|
|
|
+ return "Une nouvelle RP à traiter est disponible à http://rp.chown.me (hl quota_atypique taziden)";
|
|
|
+}
|
|
|
|
|
|
## Le bot lit le chan et réagit
|
|
|
sub said {
|
|
@@ -439,6 +449,13 @@ sub said {
|
|
|
return "datafoin <3";
|
|
|
}
|
|
|
}
|
|
|
+ elsif ($message->{body} =~ /^\Q$symbol\Erp/) {
|
|
|
+ my $url = $message->{body};
|
|
|
+ $url =~ s/^\Q$symbol\Erp //;
|
|
|
+ rp($url);
|
|
|
+ }
|
|
|
+ # http://qntm.org/files/perl/perl.html
|
|
|
+ # http://www.drdobbs.com/web-development/writing-irc-bots-in-perl-with-botbasicbo/184416221
|
|
|
}
|
|
|
|
|
|
# tout ce qu'on écrit dans /tmp/log apparait dans $channel
|