#!perl -T # reputer analyzes and displays node reputation and xp data from perlmonks.org # homenode = http://perlmonks.org/index.pl?node=reputer # # List user nodes sorted by rep, title or date in HTML tables. # Three ways to graph number of nodes by reputation. # Display changed, deleted and new node info and rep change. # Cookies save info used for lwp transfers, and display options. # Can write up to 8 data files in temp dir, so give it write permission. # # Export/import enabled if Compress::Zlib is installed # Requires XML::Simple use strict; use CGI qw(header param url); eval("use XML::Simple 'XMLin'"); # required xml parser if($@){&install_xml_simple(); exit} use CGI::Cookie; use HTTP::Cookies; use HTTP::Request::Common; use HTML::Entities 'encode_entities'; use LWP::Simple 'get'; use LWP::UserAgent qw(agent cookie_jar request content); use Data::Dumper; #use CGI::Carp 'fatalsToBrowser'; # only use for debugging with -w my$trade = 0; eval("use Compress::Zlib"); unless($@){$trade = 1} # if installed enable export/import # config variables my$temp = './'; # where data files are saved my$public_access = ''; # 'yes' disables config, downloads, and external program functions my$bodytag = '
'; my$form_method = 'get'; # get or post, 'get' shows params in url my%programs = ( # full path to optional external programs, links will appear in sort mode. # key = the display name, value = a system call which dumps output to the browser. # 'xrepwalker' => 'perl xlukerep.pl', # 'xstatswhore' => 'perl xstatswhore.pl', # 'tracert perlmonks' => 'tracert perlmonks.org', # 'ping perlmonks' => 'ping perlmonks.org', ); # proxy my$use_proxy = ''; # 'yes' enables use thru the following proxy my$proxy = 'http://proxy.dom:port'; # must define this to use proxy my$proxyid = ''; my$proxypass = ''; # end config variables my$bb = 0; # table border on node list if($ENV{'HTTP_USER_AGENT'}){ # ie cant do cellspacing as border in nested colored tables if(($ENV{'HTTP_USER_AGENT'}=~/MSIE/) || ($ENV{'HTTP_USER_AGENT'}!~/Mozilla/)){ $bb = 1 }} my$perlmonks = ''; # default for links if no cookie set my$ddi = 0; # data dumper intent level, 0 = smallest files # paths and data files my$df = $temp.'reputer.dat'; # main data file my$repthen = $temp.'reputer.then'; # 'previous' rep file my$repnow = $temp.'reputer.now'; # 'present' rep file my$uri = url(); # html elements my$nb = ' '; my$bq = ''; my$eh = '