For linux's(and unix-like) users without Internet every day, sometimes we want to know information about the submissions to a problem in different languages, memory usage, run time, ...
If we can download several signedlist of the top 400 or 500 users for example, is an amount about 30 Mb of text and 6 Mb compressed.
xilinx.gz
defrager.gz
eigenray.gz
...
With the following bash script we get the information regarding a problem. You have to personalize for you.
# FR's bash aliases and functions
# ...
spojdir alias='cd /media/DATA/Frank/PROGRAMAS_DE_FR/spoj; ls'
submits ()
{
# $1 problem code, classical
pushd. > /dev/null
spojdir > /dev/null
cd www/signedlist/
zgrep -w $1 *. gz | grep-w AC> ___r
cut --delimiter \ = \. -f1 ___r> ___author
cut --delimiter \ = \| -f6 ___r> ___bt # best sols by running time
cut --delimiter \ = \| -f8 ___r> ___lang
cut --delimiter \ = \| -f7 ___r> ___mem # memory usage
paste ___bt ___mem ___lang ___author | sort -n | nl
rm ___*
popd > /dev/null
}
submitsl ()
{
submits "$1" | less
}
Execute
$ submits TEST
1 0.00 116 ASM Pratik
2 0.00 1520 BF frankr
3 0.00 1576 C ak15
4 0.00 1624 C ak15
5 0.00 1628 C xilinx
6 0.00 1628 C gerrob
7 0.00 1636 C suby
.....
To download a lot of signedlists we can do with wget.
$ cat list.txt
spoj.pl/status/xilinx/signedlist/4
spoj.pl/status/defrager/signedlist/
spoj.pl/status/eigenray/signedlist/
spoj.pl/status/ikatanic/signedlist/
....
$ wget -i list.txt
I built the list (users only) with the following command:
$ grep rank01.htm | grep www | grep spoj | grep users | grep -v ranks | grep -v problems | cut --delimiter\=\" -f2 | cut --delimiter\=\/ -f5 >> users.txt
And then create list.txt with another script.