Created
April 7, 2020 04:34
-
-
Save ablakely/069801bca05b1655d3fd40824dc2c4b9 to your computer and use it in GitHub Desktop.
Folding@Home Single User Statistics Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# fahstat.pl: Folding@Home Single User Statistic Script | |
# | |
# Usage: ./fahstat.pl <user name> | |
# Written by Aaron Blakely <[email protected]> | |
use strict; | |
use warnings; | |
my $query = shift; | |
if (!$query) { | |
print "$0: <user name>\n"; | |
print "This script is used to find the FAH stats for a single user.\n"; | |
die "\nWritten by Aaron Blakely <aaron\@ephasic.org>\n"; | |
} | |
system "rm /tmp/fahstat.txt /tmp/fahstat.txt.bz2"; | |
system "wget -O /tmp/fahstat.txt.bz2 https://apps.foldingathome.org/daily_user_summary.txt.bz2"; | |
system "bunzip2 /tmp/fahstat.txt.bz2"; | |
open(my $fh, "</tmp/fahstat.txt") or die $!; | |
my @statdb = <$fh>; | |
close($fh) or die $!; | |
foreach my $line (@statdb) { | |
if ($line =~ /$query\t(.*)\t(.*)\t(.*)/) { | |
print "User:\t\t$query\nScore:\t\t$1\nWork Units:\t$2\nTeam ID:\t$3\n"; | |
exit(); | |
} | |
} | |
print "User '$query' not found\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment