• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

stats masters call:

Fullmetal Chocobo

Moderator<br>Distributed Computing
Moderator
Now that I'm much more familiar with databases and PHP access MySQL, etc., I had a thought / request / wishful thought. Would anyone be willing to do a write-up how-to type post / thread /doc on how to access stats from sources?

If the grand master himself (Bok) would give some tips, etc, that would be wonderful. And I'm not trying to take anyone's glory or anything--just interested as hell in projects like this, and want to do projects like it.

Just a thought...
 
Well, I do all of my stats by hand: copy and paste into an Excel spreadsheet - and that works ok for me. Probably more error prone and takes too much work, but I do not know any script languages at all ... 🙁
 
I guess I'll post my PrimeGrid Race Stats script here:

Code:
[plain]#!/bin/bash
# Get PrimeGrid race stats.  Optional argument is team name.
# Enter the race ID (from its stats URLs) here:
chal=2010_3
if [ "$1" == "" ] ; then
	team="TeAm AnandTech"
else
	team="$1"
fi
echo Stats for team $team
echo [b]Rank[/b]__[b]Credits[/b]___[b][url=http://www.primegrid.com/challenge/$chal/top_users.html]Username[/url][/b]
links2 -only-proxies 0 -http-proxy '' -dump http://www.primegrid.com/challenge/$chal/top_users.html | grep "$team" | sed -e "s/^ *\([0-9][0-9]*\)  */\t\1\t/;s/   */\t/g" | awk -F'\t' 'BEGIN { OFS="\t"}{print $2, $5, $3}' | sed -e "s/\t/___/g;s/\([0-9]\)\.[0-9]* */\1/;s/^\([0-9]\)_/\1___/;s/^\([0-9][0-9]\)_/\1__/;s/\(_[0-9]\{1,6\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,5\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,4\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,3\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,2\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,1\}_*\)\([^_0-9]\)/\1_\2/"

echo
echo [b]Rank[/b]__[b]Credits[/b]___[b][url=http://www.primegrid.com/challenge/$chal/top_teams.html]Team[/url][/b]
links2 -only-proxies 0 -http-proxy '' -dump http://www.primegrid.com/challenge/$chal/top_teams.html | grep -A3 -B3 "$team" | grep "^ *[0-9]" | sed -e "s/   */\t/g;s/\(Texas\|Epsilon\) \([0-9]\)/\1\t\2/" | awk -F'\t' 'BEGIN { OFS="\t"}{print $2, $4, $3}' | sed -e "s/\t/___/g;s/\([0-9]\)\.[0-9]* */\1/;s/^\([0-9]\)_/\1___/;s/^\([0-9][0-9]\)_/\1__/;s/\(_[0-9]\{1,6\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,5\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,4\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,3\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,2\}_*\)\([^_0-9]\)/\1_\2/;s/\(_[0-9]\{1,1\}_*\)\([^_0-9]\)/\1_\2/;s/\($team\)/[b]\1[\/b]/"[/plain]

I also did a stats system for the old ECCp-109 project, as a class project for databases in college. Looking back at it, it may have been extremely buggy, but I can send it to you if you want.
 
Last edited:
Wow. I had no idea you could do anything like that. And sure, I'll take any sources you are willing to share.
 
Well, I do all of my stats by hand: copy and paste into an Excel spreadsheet - and that works ok for me. Probably more error prone and takes too much work, but I do not know any script languages at all ... 🙁
Same here, but I think we make less mistakes than buggy code 😉.
 
If you wanted to create a consolidated site of TeAm stats, it could probably be done with a combination of a scripted parser to create files of data, and ruby, and ruby-on-rails.
 
Back
Top