• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Folding@home Live Statistics Update

XORX

n00b
Joined
Aug 26, 2012
Messages
2
Hi!

I'm a new member and I want to ask for help refering to javascript coding. My aim is to create a counter, which displays the current Grand Score of my team at any time. I want to implement the code on websites to give all the users a greater overview of their current work and a cool experience of our contribution. I'm pretty sure, this is interesting for several other teams.

I've already finished the core ideas, but don't know how to set up the javascript...

Start of programming:
1) get system time of Operating System (exact hours, minutes, seconds)
2) get the value of "Report generated on" (source code: row 78, extract from http://fah-web.stanford.edu/cgi-bin/main.py?qtype=teampage&teamnum=33)
3) calculate the time difference between 1) and 2) => This is the actual expiration after the Report has been generated (the value must always be smaller than around 1 hour, because of the hourly update!). You have to pay attention to the differnt time zones...
4) get the value of the 3-hour-update amount (source code: row 342, extract from http://kakaostats.com/t.php?t=33)
5) calculate the PPS variable (PPS=points per second) => PPS = (3-hour-update amount from kakao stats)/(3600*3)
6) get the value of "Grand Score" (hourly updated by Stanford) (source code: row 96, extract from http://fah-web.stanford.edu/cgi-bin/main.py?qtype=teampage&teamnum=33)
7) Current Grand Score = "Grand Score" [extracted from 6)] + PPS [calculated @ 5)] * (time difference in seconds) [calculated @ 3)]

I'm pretty sure, that the Current Grand Score won't always display the 100% correct amount of points. But if the hourly updates are quite equal, the Current Grand Score is a very cool tool and the approximation is okay! The more stable the 3-hour-update amount, the more correct the approximation.

This is for Team 33. The other teams just have to change the URLs and it will work fine, too.

There are still a few problems, but I don't know how to solve them. For example the CSS, to beautify the numbers.
I think, it would make more sense to add commas after each 3 numbers. So you can distinguish between the thousands, millions,...
Feel free to start coding and contacting me.

Thanks a lot for ideas and your help!
- XORX -

This is a very early sample of the code (see below):

<html>
<body>


<style type="text/css">
<!--

.nummer{
font-family:Verdana,sans-serif;
font-weight:bold;
font-size:120px;
color: #808080;
border:none;
text-align:center;
width:280px;
background:#F0F4FF;
}

.tabelle {
border:1px solid #0090E0;
height:250px;
width:300px;
background:#F0F4FF;
}

.tabelle td{
border:1px solid #0090E0;
margin:10px;
background:#F0F4FF;
}

-->
</style>





<script>

var PPS = 0.345755544;
var c = 100

function startCount()
{
var timer = setInterval(count,1000);

}
function count()
{
var el = document.getElementById('counter');
var currentNumber = parseFloat(el.innerHTML);
el.innerHTML = (Math.round((currentNumber+PPS) * 100) / 100) + c;

}

</script>
<body onload="startCount();">


Current Grand Score:
<div id="counter"> 0 </div>



<form name="tabelle td">
<input class="nummer" type="text" id="Anzeige" value="0"> </form>



</body>
</html>
 
Umm you may want to go here http://foldingforum.org/viewforum.php?f=14 and talk to some of the other 3rd party stats devolipers Harlem, MtM, smoking2000 and UncleFungus. They can probably answer the questions you have since they have been working with F@H stats fro quite a while. Although I have not seen MtM around for a while.
 
Thank you very much! I'll try at the (main) Folding Forum.

- XORX -
 
Back
Top