Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- if ( $#ARGV > 0 ) {
- foreach $usr (@ARGV) {
- print "-[ $usr ]-----------------------------------------------\n";
- system("$0 $usr");
- }
- exit;
- }
- if ( $#ARGV < 0 ) { print "usage: $0 <nick(s)> \n"; exit; }
- $user = $ARGV[0];
- $index = `curl -s "http://whatpulse.org/api/user.php?UserID=$user"`;
- @indexsplit = split("\n", $index);
- foreach $n (@indexsplit) {
- $n =~ s/^ //;
- if ( $n =~ /UserID/ ) { $n =~ s/<[^>]*>//g; $id = $n; }
- if ( $n =~ /AccountName/ ) { $n =~ s/<[^>]*>//g; $account = $n; }
- if ( $n =~ /DateJoined/ ) { $n =~ s/<[^>]*>//g; $datejoined = $n; }
- if ( $n =~ /Country/ ) { $n =~ s/<[^>]*>//g; $country = $n; }
- if ( $n =~ /Pulses/ ) { $n =~ s/<[^>]*>//g; $pulses = $n; }
- if ( $n =~ /TotalKeyCount/ ) { $n =~ s/<[^>]*>//g; $totalkeycount = $n; }
- if ( $n =~ /TotalMouseClicks/ ) { $n =~ s/<[^>]*>//g; $totalclicks = $n; }
- if ( $n =~ /TotalMiles/ ) { $n =~ s/<[^>]*>//g; $totalmiles = $n; }
- if ( $n =~ /AvKeysPerPulse/ ) { $n =~ s/<[^>]*>//g; $avgkeysperpulse = $n; }
- if ( $n =~ /AvClicksPerPulse/ ) { $n =~ s/<[^>]*>//g; $avgclicksperpulse = $n; }
- if ( $n =~ /^<Rank>/ ) { $n =~ s/<[^>]*>//g; $rank = $n; }
- }
- if ( $pulses > 0 ) {
- print "Account: $account ( $country ) Joined: $datejoined - http://whatpulse.org/stats/users/$id/\n";
- print "Keys: $totalkeycount - Clicks: $totalclicks - Miles: $totalmiles\n";
- print "AVG/Pulse | Keys: $avgkeysperpulse - Clicks: $avgclicksperpulse\n";
- print "Pulses: $pulses - Rank: $rank\n";
- } else {
- print "No such user found or no pulses.\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement