InLineStats(JS)


By James Battersby

Description

InLineStats(JS) is a Perl script to allow you to display on your own web pages your current Seti@Home stastics. This is a modified version of InLineStats that does not require ASP support by your server. InLineStats(JS) give you access to all of you major statistical information such as the number of units returned, you current rank etc. To be able to use InLineStatsJS you must be able to run Perl scripts on you web server.

Download

Download InLineStats(JS) V1.3 now (2,291 Bytes)

Version History

  • V1.3 - 13th July 2002
    • Updated to cope with Seti@Home URL change.
  • V1.2
    • Changed regular expression for total CPU time to work correctly with times less than and more than 1 year.
  • V1.1
    • Changed to produce JavaScript output.

Installing

The download file contains two files:

  • setistatsjs.pl - The Perl script
  • example.htm - An example of how to use it

You must place these files in directories where your web server can execute them. It is common for the Perl file to be placed in the /cgi-bin/ directory. If you are not sure, you will need to speak to you web server administrator.

Having located the files, you MUST edit example.htm. Replace YOUR-WEB-SERVER with your web sites URL. You MUST also edit the perl script to replace YOUR-EMAIL-ADDRESS with the Email address registered with Seti@Home.

Using InLineStats(JS)

To get your stats on your web page, you need to include setistatsjs.pl like this:

<script src="YOUR-WEB-SERVER/setistatsjs.pl"></script>

This will cause the scripts to run. All of your stats will be placed in a number of variable for you to use as you like. These variables are:

DescriptionVariable Name
Total units returnedunitsreturned
Current rankrank
Number of users at this rankusersatrank
Done more work units than (%)beaten
Total number of userstotalusers
Time last unit returnedlastreturned
Average CPU timeaveragecputime
Total CPU timecputime

You can insert a variable at any point on your page after including the Perl file. To do this, you need a little bit of JavaScript like this document.write(rank), this will write out your rank.

Finally, it is possible for the scripts to fail. This may be due to the Seti@Home web site being down. To prevent rubbish being displayed, you should initialise your rank to zero before including the Perl file, and check that it is not zero after. Here is an example:


<html>
<head>
<title>My Stats</title>
</head>
<body>
<script language="JavaScript">
rank = '0'
</script>
<script src="YOUR-WEB-SERVER/setistatsjs.pl"></script>
<h1>My Rankings</h1>
<script language="JavaScript">
if (rank == '0')
{
	document.write("My rank is not available<br>")
}
else
{
	document.write("Rank " + rank + "<br>")
	document.write("Users at this rank " + usersatrank + "<br>")
	document.write("Total users " + totalusers + "<br>")
	document.write("Units returned " + unitsreturned + "<br>")
	document.write("Total CPU time " + cputime + "<br>")
	document.write("Average CPU time " + averagecputime + "<br>")
	document.write("Last unit returned " + lastreturned + "<br>")
	document.write("% users beaten " + beaten + "%<br>")
}
</script>
</body>
</html>

The above example is included in the download file.


Note:All software on this site is supplied "as is", with no guarantee offered or implied. While every effort has been made to ensure the correct operation of the software, no responsibility is accepted for any loss, damage or charges incurred which may arise from the use of this software. A virus scan has not been performed on the download files, you are advised to do this before running any of the software. Re-distribution of the software is permitted providing that I) no charge is made for it, II) it is distributed in exactly the same form as found on this site, III) you do not take any credit for it's production. Any queries should be directed to the original author.

© 2003-2004 James Battersby.
Main Page | Mail the WebMaster