Subject: Stupid Hack: "There is no IGLU Cabal Extractor"

From: Shlomi Fish <[email-masked]>
Date: Tue, 6 Nov 2001 14:38:34 +0200 (IST)

I wrote a perl script to extract the "There is no IGLU Cabal" reasons out
of Hackers-IL messages. I'm planning to adapt it to do the same for
Linux-IL messages. It's included after the main text.

All in all there are 30 occurences so far. The fortune also mentions who
wrote it and in what message.

Regards,

	Shlomi Fish

There is no IGLU Cabal!
All the previous cabal members became too busy cataloging the reasons for
its inexistence that they forgot to remedy this fact.

############ Begin Perl Script ###############

#!/usr/bin/perl -w

use LWP::Simple;
use Data::Dumper;

use strict;

my %unhtml_conv =
(
    'lt' => '<',
    'gt' => '>',
    'amp' => '&',
);

my $expression = "There is no IGLU Cabal";

my $expression_regex = "\\s*$expression";
$expression_regex =~ s/ /\\s+/g;

sub get_hackers_il_msg
{
    my $index = shift;

    my $text;

    $text = get("http://groups.yahoo.com/group/hackers-il/message/$index?source=1");

    # Take only whatever between the <pre>
    $text =~ s/^[\x00-\xFF]*?<pre>//;
    $text =~ s/<\/pre>[\x00-\xFF]*$//;

    # Convert all those &...; escapes
    # Is there a CPAN module that does this?
    $text =~ s/\&(amp|lt|gt);/$unhtml_conv{$1}/ge;

    my @lines = split(/\n/, $text);

    my ($fortune, $from);
    $fortune = "";

    while(scalar(@lines))
    {
        my $l = shift(@lines);
        if ($l =~ /^From:/)
        {
            $from = $l;
            $from =~ s/^From:\s*//;
            $from =~ s/<.*$//;
            $from =~ s/\s+$//; # Remove trailing whitespace
        }
        if ($l =~ /^$expression_regex/)
        {
            $fortune .= $l . "\n";
            while (scalar(@lines))
            {
                my $l = shift(@lines);
                if (($l =~ /^\s*$/) || ($l =~ /WARNING TO SPAMMERS/))
                {
                    last;
                }
                $fortune .= $l . "\n";
            }
            last;
        }
    }

    if ($fortune eq "")
    {
        return undef;
    }

    my $ret;

    $ret =
    {
        'fortune' => $fortune,
        'group' => "Hackers-IL",
        'from' => $from,
        'msg_index' => $index,
    };

    #my $d = Data::Dumper->new([ \$ret ], ["\$ret"]);
    #print $d->Dump();
    return $ret;
}

#&get_hackers_il_msg(1376);
# 729 is the first message with the IGLU Cabal mentioned
for my $msg_index (729 .. 1389)
{
    print STDERR "$msg_index\n";
    my $fortune = get_hackers_il_msg($msg_index);
    if (defined($fortune))
    {
        print $fortune->{'fortune'}, "\n";
        print "\t" . $fortune->{'from'} . " in " . $fortune->{'group'} . " msg No. " . $fortune->{'msg_index'} . "\n";
        print "%\n";
    }
}

### End Perl Script ###

----------------------------------------------------------------------
Shlomi Fish        [email-masked]
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [email-masked]

If:
1. A is A
2. A is not not-A
does it imply that
1. B is B
2. B is not not-B