in reply to Inconsistency of navigation links

Aside from the obvious consistency issues, I ran into this when programming my custom random node program. In order to customize which categories got displayed, I had to determine the category from the page in exactly the manner you describe above. I even had to differentiate between discussions and catacombs based on the existence of a shaded table... Ewww, how long before that assumption breaks?

In short, a consistant category label would have made this project *much* easier, and would improve its robustness in the future.

Update: Although it's quite ugly, here is the relevant snippet.

my $html = get("http://perlmonks.com/index.pl?op=randomnode"); ($node) = $html =~ /\blastnode_id=(\d+)/; my ($title) = $html =~ /<title>([^>]+)<\/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'; }

-Blake