use LWP::UserAgent;
my $server = "news.gmane.org";
+my $spamurl = "http://spam.gmane.org/{group}:{msgnum}";
# List of groups to process
my @groups;
s/\s*$//g;
next if (/^$/);
$server = $1 if (m/^server (.+)$/);
+ $spamurl = $1 if (m/^spamurl (.+)$/);
push(@groups, $1) if (m/^group (.+)$/);
}
close(CFG);
sub report_spam {
my ($groupname, $msgnum) = @_;
- # Visit http://spam.gmane.org/gmane.linux.debian.devel.lsb:253
- my $response = $ua->get("http://spam.gmane.org/$groupname:$msgnum");
+ my $url = $spamurl;
+ $url =~ s/{group}/$groupname/g;
+ $url =~ s/{msgnum}/$msgnum/g;
+ my $response = $ua->get($url);
if ($response->is_success) {
print "Reported $groupname:$msgnum as spam.\n";
} else {