#!/usr/bin/perl use strict; my $uid = 60082; if ($ARGV[1] =~ m/^\s*([0-9]+)\s*$/mi) { $uid = $ARGV[1]; } print qx(wget -q -N -O user.txt http://www.alphabounce.com/user/$uid); open(FH, '< user.txt'); my $name = ""; my $rank = ""; my $days = ""; my $expl = ""; my $x = ""; my $y = ""; my $pos = 0; while() { if ($pos < 1 && m/\"([^\"]+)\"/mi)/mi) { $name = $1; } } if(m/Position\s*:\s*/mi) { $pos = 2; #print; } if($pos >= 2 && m/\s*\[\s*([\-0-9]+)\s*\]\s*\[\s*([\-0-9]+)\s*\]\s*/mi) { $pos = 3; $x = $1; $y = $2; } if(m/\s*Exploration\s*:\s*[^0-9]*\s*([0-9]+)[^0-9]+\s*:\s*[^0-9]+([0-9]+)\s*(days)?/mi) { $expl = $1; $days = $2; } } print "You are [$name], Rank[$rank], \nwith id [$uid], located at [$x,$y]\n"; print "Exploration: [$expl]. Days [$days]\n"; close(FH); exit(0);