my $html = get("http://perlmonks.com/index.pl?op=randomnode"); ($node) = $html =~ /\blastnode_id=(\d+)/; my ($title) = $html =~ /([^>]+)<\/title>/i; my ($author) = $html =~ /\bby\s*<A HREF[^>]+>([^<]+)<\/A>/i; if ($title eq $author) { $section = 'Homenode'; ($homenodexp) = $html =~ /Experience:.*?<B>(\d+)/; } elsif ($author eq 'perlnewsbot') { $section = 'News'; } else { ($section) = $html =~ /\b(?:go|back)\s+(?:to\s+)?(?:see\s+more\s+)?<A HREF=\ "\/index.pl\?node=(Seekers|Meditations|Craft|Cool|Perl)/i; $section = 'Poetry' if $section eq 'Perl'; $section ||= $html =~ /bgcolor="CCCCCC"/i ? 'Code' : ''; $section ||= 'Disc'; }