Here is my Perl-script to monitor my own progress:

use strict; use warnings; use LWP::UserAgent; use HTML::TableExtract; use DateTime; die "usage: perl $0 monk password seconds\n" unless $#ARGV == 2; my ( $monk, $pass, $secs ) = @ARGV; print "Querying the monastery once every $secs seconds for monk $monk\ +'s reputation.\n"; $secs = 10 if $secs < 10; while(1) { my $ua = LWP::UserAgent->new; $ua->agent("PMReputation"); my $res = $ua->post( 'http://perlmonks.org/?', {"node_id" => "3559", "op" => "login", "lastnode_id" => "3559", "user" => $monk, "passwd" => $pass, "expires" => "+10y", "length" => "500",} ); die "Cannot enter the monastery ($res->status_line).\n" unless $res- +>is_success; my $te = HTML::TableExtract->new( headers => [ '#', 'User', 'Experie +nce', 'Level', 'Writeups', 'User Since', 'Last Here' ] ); $te->parse( $res->content ); my $writeups = 0; my $exp = 0; my $level = ""; my $rank = 0; my $total = 0; foreach my $ts ($te->tables) { foreach my $row ($ts->rows) { $total = $row->[0]; if( $row->[1] eq $monk ) { ($rank, $exp, $level, $writeups) = @$row[0,2,3,4]; } } } my $now = DateTime->now( time_zone => 'Europe/Berlin' ); my $text = $now->dmy.",".$now->hms.": $level $monk has experience of + $exp and $writeups write ups, Saint $rank/$total.\n"; print $text; if( open my $log, ">>", "narcissistic.txt" ) { print $log $text; close $log; } sleep( $secs-3 ); }

In reply to Re: Querying Saints in our Book by hdb
in thread Querying Saints in our Book by chacham

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.