version 0.5: This version is by the same author. When I tried to run 0.4, it choked because the layout of the home nodes is a bit different now. The author updated the script basically because I asked him to. Nice guy. :) You may have problems using this script off this web page so I put it on http://hongpong.dyndns.org/perl/e2exp.pl for possibly better functionality.



#!/usr/bin/perl -w
# ithron@charter.net
# e2exp.pl
#
# More info by HongPong: this script accesses the internet knowledge database
# www.everything2.com and determines a user's important metrics, specifically,
# their XP and their node count. For more info write the author at ithron@charter.net.
# To execute the script enter 'perl -w e2exp.pl [username]' on your command line.
# Visit http://www.everything2.com/index.pl?node=e2exp.pl for the latest info.
#
# 0.5 (06/14/01): update for new user home page format. Also uses a different get URL
# to prevent "Duplicates found" confusion.
# 0.4 (06/27/00): using LWP and uri::escape now, some code clean up, etc.
# 0.3 (06/26/00): 0.2 + ability to look at anybody's node/exp info.
# 0.2 (05/28/00): show exp to node ratio.         
# 0.1 (05/25/00): pull down my current exp on e2.
# 
# usage: e2exp.pl [e2 user]
#

use strict;
use LWP::Simple;
use URI::Escape;

my $version = "0.5";

# in order of appearance ...
my ($user, @usernode, $f, $num, $exp);

if ((!$ARGV[0]) || ($ARGV[0] =~ /-(h|(-)?help)/) || ($ARGV[0] =~ /-(v|V|(-)?ver(sion)?)/)) { 
print <\.*$//;
	    @usernode = split(/\n/, get("http://everything2.com$_"));
	    last;
	}
    }
}

$f = 0;

foreach (@usernode) {
    chomp;
    if ($_ =~ /experience/) { 
	$_ =~ s/\<.+?\>//g;
	$_ =~ s/number of write\-ups\/experience//;
	if ($_ !~ /n\/a/) { ($num, $exp) = split(/\//, $_); }
	else { print "this is a special user. nodes/exp are not applicable.\n" and exit; }
	last;
    }
}

print "\n   nodes: $num\n";
print "     exp: $exp\n";
print "exp/node: " . $exp/$num . "\n\n";

# eop.