JavaScript Stats

Message boards : Number crunching : JavaScript Stats
Message board moderation

To post messages, you must log in.

AuthorMessage
Profile SuperNova

Send message
Joined: 3 Apr 99
Posts: 15
Credit: 1,569
RAC: 0
United States
Message 50069 - Posted: 30 Nov 2004, 2:58:01 UTC
Last modified: 30 Nov 2004, 3:02:06 UTC

I've written a script that allows people on servers not supporting PHP or some other server language to display their statistics numerically. This is done by using JavaScript includes, and a function to display the variables created by this include. This method works on such servers as GeoCities and Tripod. Thanks to Petrus - my code parses the WAP files and some of that code is derived from his.

Check out this quick demonstration page:
JavaScript stats demo

My to-do list for this is as follows:

- Make it possible to display multiple projects at the same time, by storing the variables in arrays (sah[] and cpdn[]). Maybe extend this further so that multiple users can also be displayed.

- Make some include files with pre-made table writing functions that are ready for use.

- Make a PHP include file that does the same purpose, just writing to PHP variables rather than JavaScript ones.

Of course using the image file would look nicer, this is just for anyone who wants to display in tabulated form. I'm looking into making a custom image as well, mostly for my own use but perhaps usable for others.
<p>
<img src="http://www.infinisoft.34sp.com/boinc/signature.php?project=sah&amp;id=7813418" border="0" />
</p>
ID: 50069 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 50161 - Posted: 30 Nov 2004, 12:47:47 UTC

Hi Supernova,

great idea, indeed! because of the prices for php-webspace, this can be useful for quite a lot!

>I'm looking into making a custom image as well, ...

does JavaScript provide any image creation fuctions? I would say no, but I'm not very experienced in that... ;)

Petrus
___<br>
<img src="http://boincwapstats.sourceforge.net/counter.php?id=454210&amp;style=2">
<a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a>
ID: 50161 · Report as offensive
Profile SuperNova

Send message
Joined: 3 Apr 99
Posts: 15
Credit: 1,569
RAC: 0
United States
Message 50210 - Posted: 30 Nov 2004, 17:40:03 UTC - in response to Message 50161.  

> Hi Supernova,
>
> great idea, indeed! because of the prices for php-webspace, this can be useful
> for quite a lot!

Thank you!

> >I'm looking into making a custom image as well, ...
>
> does JavaScript provide any image creation fuctions? I would say no, but I'm
> not very experienced in that... ;)
>
> Petrus
>

Not exactly. I was going to make an image using PHP, but it is possible with JavaScript/HTML by using background images. Doing it this way can make the JavaScript stats look almost like a PHP-generated signature!

Later on today I will update the script so that the stats are accessed like such:

SAH[user_id][stat_name]
CPDN[user_id][stat_name]

This will be the final format, so don't use the script yet until these changes have been made.
<p>
<img src="http://www.infinisoft.34sp.com/boinc/signature.php?project=sah&amp;id=7813418" border="0" />
</p>
ID: 50210 · Report as offensive
Profile SuperNova

Send message
Joined: 3 Apr 99
Posts: 15
Credit: 1,569
RAC: 0
United States
Message 50264 - Posted: 30 Nov 2004, 23:06:29 UTC

I've updated the script a bunch. It should now be possible to include multiple users across multiple projects. The variables to be used have a revised syntax.

Heres the updated documentation for it:
JavaScript Stats

The HTML in the example pages should make it easy to learn how to implement.
<p>
<img src="http://www.infinisoft.34sp.com/boinc/signature.php?project=sah&amp;id=7813418" border="0" />
</p>
ID: 50264 · Report as offensive
Janus
Volunteer developer

Send message
Joined: 4 Dec 01
Posts: 376
Credit: 967,976
RAC: 0
Denmark
Message 50372 - Posted: 1 Dec 2004, 7:20:48 UTC - in response to Message 50069.  

I tried something like this on BOINC.dk a while ago. It turned out that a lot of people had problems using it due to security meassures in their browsers.
Some browsers simply wouldn't allow loading of off-site javascripts or something like that.

Here's how far I got before realizing that it wasn't going to work out:
The testpage

If you somehow solved this problem I will be glad to know how =)
ID: 50372 · Report as offensive
Profile SuperNova

Send message
Joined: 3 Apr 99
Posts: 15
Credit: 1,569
RAC: 0
United States
Message 50409 - Posted: 1 Dec 2004, 11:37:34 UTC - in response to Message 50372.  

> I tried something like this on BOINC.dk a while ago. It turned out that a lot
> of people had problems using it due to security meassures in their browsers.
> Some browsers simply wouldn't allow loading of off-site javascripts or
> something like that.
>
> Here's how far I got before realizing that it wasn't going to work out:
> The testpage
>
> If you somehow solved this problem I will be glad to know how =)
>

I haven't heard of such a problem. I do notice that on your page a tag is missing from the overview table and that seems to prevent it from showing.

I'm considering an IFRAME page as well that should work well even for JavaScript-disabled browsers.
<p>
<img src="http://www.infinisoft.34sp.com/boinc/signature.php?project=sah&amp;id=7813418" border="0" />
</p>
ID: 50409 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 50412 - Posted: 1 Dec 2004, 12:32:21 UTC

I know that problem, too. For instance, Proxomitron (a proxyserver that I use) blocks the script by default.

Unfortunately, I don't think an iframe can solve that problem because in the end, the page is put together by the browser.

Petrus
___<br>
<img src="http://boincwapstats.sourceforge.net/counter.php?id=454210&amp;style=2">
<a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a>
ID: 50412 · Report as offensive
Profile SuperNova

Send message
Joined: 3 Apr 99
Posts: 15
Credit: 1,569
RAC: 0
United States
Message 50483 - Posted: 1 Dec 2004, 22:22:13 UTC - in response to Message 50412.  

> I know that problem, too. For instance, Proxomitron (a proxyserver that I use)
> blocks the script by default.
>
> Unfortunately, I don't think an iframe can solve that problem because in the
> end, the page is put together by the browser.
>
> Petrus
>

Thanks for the info.
<p>
<img src="http://www.infinisoft.34sp.com/boinc/signature.php?project=sah&amp;id=7813418" border="0" />
</p>
ID: 50483 · Report as offensive

Message boards : Number crunching : JavaScript Stats


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.