Extracting data from Psychostats 3 rank listing
Here’s a small script to extract maybe interesting data from Psychostats 3. Mostly a reminder for myself but anyone else who is interested about PS3 stats can use this method too. Blog interprets : D as smiley so “K : D” is written with space, same as with “K : M”.
limit=250
echo “# Rank Kills Deaths K : D K : M Online Skill”
lynx -source “http://css.setti.info/psychostats3/index.php?limit=$limit” | # Get Psychosts 3 HTML source
grep “<td class=.text. align=.center.>\|<td class=.text.>\|<td class=.text. nowrap>” | # Find stat lines from HTML
cut -f 2- -d “>” | # Parse stats
sed ’s/<\/td>//’ | # Parse stats
cut -f 1 -d “&” | # Parse stats
sed -e ‘N;s/\n/ /;N;s/\n/ /;N;s/\n/ /;N;s/\n/ /;N;s/\n/ /;N;s/\n/ /;’ # Parse one player’s stats in one line
#| sed -e ’s/,//g’ -e ’s/\./,/g’ # Replace periods (.) with commas (,)
Output should look something like this:
# Rank Kills Deaths K : D K : M Online Skill
1 13141 5482 2,40 0,69 317:55:50 15319,84
2 2247 908 2,47 0,95 39:25:18 15194,82
3 1665 754 2,21 0,67 41:21:15 14996,65
4 6149 2466 2,49 1,05 97:22:15 14715,97
5 21162 11396 1,86 0,61 582:14:46 14640,08
6 8672 4509 1,92 0,77 187:35:11 14638,51
7 6207 3721 1,67 0,58 178:41:34 14475,05
8 7245 4069 1,78 0,49 246:23:09 14378,98
9 1660 1200 1,38 0,50 55:40:32 14178,03
10 4375 2496 1,75 0,70 104:45:04 14150,38
That in turn can be handled with GNUPlot.
Something like comparing skill to K : D could be done to draw nice graphs.
GNUPlot script:
reset
set xlabel “Skill”
set ylabel “K : D ratio”
set title “Skill vs.“
set terminal png color;
set output “demo-plot.png”;
plot ‘ps3data.txt’ using 7:5 with points
That will result into a image which looks like this:
