User:Where/rcff

My vandal-fighting tool
All scripts on this page need perl and Net::IRC.

I use this script for vandal-fighting. Beware that it is difficult to use and only works under Linux. I have only tested it under KDE with the focus protection level (set in the control center) set to "extreme". The script pops up a firefox window every time an anon-IP edits (except for talk pages) or somebody creates a new page.

use Net::IRC; use strict; our $irc = new Net::IRC; our $conn = $irc->newconn(Nick => "Where" . int(rand(999)), Server => "browne.wikimedia.org", Port => 6667, Ircname => "W"); $conn->add_handler("public", \&onPublic); $conn->add_handler("376", \&onConnect); $irc->start; sub onConnect { our $self = shift; $self->join("#en.wikipedia"); } sub onPublic { our $self = shift; our $event = shift; our ($rawMessage) = $event->args; if ($event->nick eq "rc") { if (0) { if ($rawMessage =~ /Diff:(.*)/) { print "Pre: $1\n"; $1 =~ m#(http://[^\s]+)#; print "La: ". $1 . "\n"; system "firefox '$1' &"; ; }}          $rawMessage =~ m#02(http://en.wikipedia.org[^ ]+)#; our $url = $1; $rawMessage =~ m#5\*.+03(.*)5\*# or die "blah"; our $user = $1; chop $user; chop $user; chop $user; if ($url =~ /[Tt]alk:/) {return;} if ($url =~ /Sandbox/) {return;} if ($url =~ /Articles for deletion/) {return;} if ($url =~ /Wikipedia:Introduction/) {return;} chop $rawMessage; if ($user =~ m#^[\d\.]+$#) { &act($url); }          if ($rawMessage =~ /N\x{03}10/) { print "New\n"; &act($url); }       } } sub act { our $ffWindows = `xwininfo -root -children|grep firefox-bin|wc -l`; chomp $ffWindows; if ($ffWindows < 81) { #the first FF window is 11; each next one adds 7; this means 116 is for 15 windows our $diffUrl = shift; system "firefox '$diffUrl'&"; }      return; }
 * 1) !/usr/bin/perl

AIV notify script
This script pops up a firefox window whenever somebody modifies WP:AIV (unless the edit summary makes it clear that an admin is editing it).

our $browserCommand = "firefox http://en.wikipedia.org/wiki/WP:AIV&"; our $beepCommand = "xterm -e \"printf '\\a';sleep 1\""; #--- #--- use Net::IRC; use strict; our $irc = new Net::IRC; our $conn = $irc->newconn(Nick => "Where" . int(rand(999)), Server => "browne.wikimedia.org", Port => 6667, Ircname => "W"); $conn->add_handler("public", \&onPublic); $conn->add_handler("376", \&onConnect); $irc->start; sub onConnect { our $self = shift; $self->join("#en.wikipedia"); } sub onPublic { our $self = shift; our $event = shift; our ($rawMessage) = $event->args; if ($event->nick eq "rc") { if ($rawMessage =~ /Wikipedia:Administrator intervention against vandalism/) { if (!($rawMessage =~ /empty/i) && !($rawMessage =~ /clear/i)) { #Don't include admins clearing the list system "$beepCommand"; system "$browserCommand"; }          }        } }
 * 1) !/usr/bin/perl
 * 1) Filename: aiv.pl
 * 2) You need perl and Net::IRC to run this
 * 3) People unfortunate enough to be using Windows can use ActivePerl: http://activeperl.com/Products/ActivePerl/ (be sure to then install Net::IRC)
 * 4) People fortunate enough to be using Debian or one of its derivatives (ex. Ubuntu/Kubuntu) can just apt-get libnet-irc-perl
 * 1) Commands to be typed on the commandline when someone adds to AIV
 * 1) If you don't speak perl, you probably don't want to edit below this point