PHP Statisticscript based on WAPstats

Message boards : Number crunching : PHP Statisticscript based on WAPstats
Message board moderation

To post messages, you must log in.

1 · 2 · 3 · 4 · Next

AuthorMessage
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 44457 - Posted: 8 Nov 2004, 22:44:37 UTC
Last modified: 14 Dec 2004, 20:02:11 UTC

Hi@all,

I wrote a little PHP-script to read data out of the WAPstats and to create a picture.
This is how it looks like with my account:



You can also use it by this URL:
http://petrus.homeftp.org/scripting/boincwapstats/counter.php?id=[Your SETI-ID]

If you want to download the sourcecode, you can do that here

So I hope that it will have some use to anyone... ;)

Goodnight/Good morning/... folks!
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: 44457 · Report as offensive
Anonymous

Send message
Joined: 15 Jan 02
Posts: 307
Credit: 24,137
RAC: 0
Afghanistan
Message 44613 - Posted: 9 Nov 2004, 4:28:15 UTC

You are a f**king genius man....THANX!!
<a href="http://www.brainsmashr.com"><img src="http://www.brainsmashr.com/signature.gif"><img src="http://brainsmashr.com/boinc/counter_big.php?id=305369&amp;project=seti&amp;ctx=white&amp;cva=red&amp;cbo=white&amp;cbg=black&amp;linethickness=2"></a>
ID: 44613 · Report as offensive
N/A
Volunteer tester

Send message
Joined: 18 May 01
Posts: 3718
Credit: 93,649
RAC: 0
Message 44617 - Posted: 9 Nov 2004, 4:48:30 UTC

You are the MAN! Excellent job!
ID: 44617 · Report as offensive
Guido Alexander Waldenmeier
Avatar

Send message
Joined: 3 Apr 99
Posts: 587
Credit: 18,397
RAC: 0
Canada
Message 44667 - Posted: 9 Nov 2004, 8:48:08 UTC

test ;-)
ID: 44667 · Report as offensive
Profile Meatwad

Send message
Joined: 12 Mar 04
Posts: 1
Credit: 63,952
RAC: 0
Germany
Message 44727 - Posted: 9 Nov 2004, 13:28:32 UTC - in response to Message 44667.  

OHHH I LOVE TESTS!!!

I KNOW THE ANSWER! ists 44!!!
ID: 44727 · Report as offensive
FrankH
Avatar

Send message
Joined: 25 Feb 04
Posts: 25
Credit: 18,183
RAC: 0
Sweden
Message 44740 - Posted: 9 Nov 2004, 13:57:48 UTC - in response to Message 44457.  

nice, I was thinking of doing this when the wap page came out (as the other widely used statimage (that I use) is quite slow)... but somehow didn't find any free time, looks like don't have to parse that page now ;)
________<br>We\'re not living in a black and white world
ID: 44740 · Report as offensive
FrankH
Avatar

Send message
Joined: 25 Feb 04
Posts: 25
Credit: 18,183
RAC: 0
Sweden
Message 44777 - Posted: 9 Nov 2004, 15:03:44 UTC - in response to Message 44740.  

2 things I had to do with it...1 to get it to run, 1 for security, haven't looked at the rest of the code, but as it's only gd stuff I trust your code :)

1. I use Debian stable(woody) as webserver, and that use php prior to 4.3.0 so I added this function at the bottom of the script:


function file_get_contents($file)
{
return implode('',file($file)); //file reads into an array, implode puts it all in one line with no separator
}


2. I don't like Register Globals to be on (and is recommended to be off by the php team), so I made this just after the $statspath declaration, to make it a bit more secure (as it converts the input to an integer aswell):
$id = intval($_GET['id']);
________<br>We\'re not living in a black and white world
ID: 44777 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 44806 - Posted: 9 Nov 2004, 16:39:21 UTC

thx @ FrankH!

based on your ideas I modified the script in the following way:

1)
if file_get_contents() is not supportet by PHP, I use your function, otherwise the original one (I read somewhere that it would be faster).

2)
thx for finding this, I try to write my scripts safe, too ;)
I added > $id = intval($_GET['id']); just where you put it.

The new Version is downloadable by the same link as the first one.

See ya!
___<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: 44806 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 46348 - Posted: 14 Nov 2004, 11:26:14 UTC
Last modified: 14 Nov 2004, 11:27:33 UTC

Hi@all,

I just noticed that Einstein@home has now a Webinterface with WAP-Support, so I extended my script to support Einstein, too.

Other changes in the new version 1.2:
- script is now named boincwapstats as it supports not only SETI
- I added more comments in the code to make it easier to read (and understand ^^)
- I added optional english language
- with counter.php?update_check you can now check whether there is a new version available


You can use it by the following URLs:

SETI:
http://petrus.homeftp.org/scripting/boincwapstats/counter.php?id=[Your SETI-ID]
Einstein:
http://petrus.homeftp.org/scripting/boincwapstats/counter_einstein.php?id=[Your Einstein-ID]

The downloadlink is the same as above.

See ya
Petrus

PS: Does anyone know how I can publish the script at the Einstein@home-Forum (I don't have an account there yet so I can't post...)

___<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: 46348 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 47125 - Posted: 16 Nov 2004, 18:22:47 UTC
Last modified: 16 Nov 2004, 19:40:03 UTC

Some news concerning the script...

Version 1.3 is out -> Improvements are:

- climatepreditction is supported (use it by http://petrus.homeftp.org/scripting/boincwapstats/counter_climate.php?id=[Your climate-ID])
- colors are adjustable
- more comments in code
- some other changes/improvements

Downloadlink / counterlink are both the same as always (see previous posts)

For downloading older versions use this link.

Have fun!!!
___<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: 47125 · Report as offensive
Ron Roe
Volunteer tester

Send message
Joined: 28 Feb 02
Posts: 156
Credit: 24,124
RAC: 0
United States
Message 47143 - Posted: 16 Nov 2004, 20:45:28 UTC - in response to Message 47125.  
Last modified: 21 Nov 2004, 17:41:35 UTC

> Have fun!!!
>

I wanted to thank you for creating this Boinc wapstats script and then making it available for Users to download and modify for their own use. I've enjoyed making different versions for my own use. Even though I don't know PHP I've been able to figure it out enough and make some modifications.

My problem with the original script was the size of the type. My eyes are too old to see the small type and the fact I use a 19" TV as a computer monitor doesn't help. ;-)

So I've made versions that are larger. Here are a couple of examples:



These are sample images I saved to a image hosting web site and are static.

Now I need to buy a book about PHP and find the time so I can do more. Win the lottery and retire... that's the answer.

Regards :-)
ID: 47143 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 47152 - Posted: 16 Nov 2004, 21:27:43 UTC

The output picture (which I think is the thing most users could want to modify) is generated by the Grapics Library, which is a PHP extension.
So if anyone wants to know better about the functions it provides, here is the official homepage, and here is the part of the PHP-manual which deals with GD. Explains quite a lot!

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: 47152 · Report as offensive
Profile AthlonRob
Volunteer developer
Avatar

Send message
Joined: 18 May 99
Posts: 378
Credit: 7,041
RAC: 0
United States
Message 47281 - Posted: 17 Nov 2004, 6:01:27 UTC - in response to Message 47152.  

> The output picture (which I think is the thing most users could want to
> modify) is generated by the Grapics Library, which is a PHP extension.
> So if anyone wants to know better about the functions it provides, <a> href="http://www.boutell.com/gd/">here[/url] is the official homepage, and <a> href="http://www.php.net/manual/en/ref.image.php">here[/url] is the part of the
> PHP-manual which deals with GD. Explains quite a lot!

Have you implmeneted image caching yet? Janus did for boinc.dk and I'm trying to figure out exactly how to manage it for my sigs script....

Rob
ID: 47281 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 47567 - Posted: 18 Nov 2004, 14:54:55 UTC - in response to Message 47281.  

> Have you implmeneted image caching yet? Janus did for boinc.dk and I'm trying
> to figure out exactly how to manage it for my sigs script....

Hi AthlonRob,

I don't think that caching is sensible for a script with unlimited users because of getting a really HUGE cachefolder ;)

anyway, I wrote code for caching some time ago, so I can post it:

-------------

first we need 2 variables:

$enable_cache = true;
$cachetime = 30; // Cachetime in minutes

-------------

then we need this piece of code before any other things (to save CPU time):
if($enable_cache) {

$cache_s_time = $cachetime * 60;
$cachepic = "$user.png";

if(file_exists($cachepic)) {
$filemtime = filemtime($cachepic);
$time_for_cache = time() - $cache_s_time;
if($filemtime > $time_for_cache) {
Header("Content-type: image/png");
$im = ImageCreateFromPNG($cachepic);
ImagePNG($im);
die();
}
}
}

-------------

finally we need to put this code just before the "ImagePNG()" command:

if($enable_cache) {

ImagePNG($im,"$user.png");

}

-------------
If you have any questions, feel free to ask here :)

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: 47567 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 49663 - Posted: 28 Nov 2004, 9:15:51 UTC

Again some news:

Version 1.5 is out: (Yes, 1.4 is missing. That's because I added Astropulse and a few days later Pirates without releasing 1.4)

Improvements:
- Astropulse added
- Pirates added
- Bugfixing

URLS:
- Astropulse: http://petrus.homeftp.org/scripting/boincwapstats/counter_astropulse.php?id=[Your astropulse-ID]
- Pirates: http://petrus.homeftp.org/scripting/boincwapstats/counter_pirates.php?id=[Your pirates-ID]

Download the sourcecode here (same link as always)

Have a nice day!
Petrus

(PS: Currently I'm working on v2.0, will release that soon I hope ^^)
___<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: 49663 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 49937 - Posted: 29 Nov 2004, 15:57:08 UTC
Last modified: 29 Nov 2004, 15:58:49 UTC

OK, I just finished v2.0!

Minor changes are:
- Variables, paths and other stuff is stored in config.php
- improved code
- bugfixing

These are all rather small things, but I also added the completely new function Summary-Counter which I will explain here:

This is my summary-picture->

As you can see, the function lists all projects and calculates the total BOINC credit.

Usage: add the following to the URL -> ?
- name=[Your nick] &
- team=[Your team] &
and for every project you participate...
- seti=[Your SETI-ID] &
- climate=[Your climate-ID] &
- astropulse=[Your Astropulse-ID] &
- einstein=[Your Einstein-ID] &
- pirates=[Your Pirates-ID]

Download the sourcecode here (same link as always)

cu@all
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: 49937 · Report as offensive
Ron Roe
Volunteer tester

Send message
Joined: 28 Feb 02
Posts: 156
Credit: 24,124
RAC: 0
United States
Message 49943 - Posted: 29 Nov 2004, 16:23:25 UTC - in response to Message 49937.  
Last modified: 29 Nov 2004, 16:26:09 UTC

> OK, I just finished v2.0!
> .....
> .....
> .....
> cu@all
> Petrus
>

Outstanding work!

Thanks again!
ID: 49943 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 50429 - Posted: 1 Dec 2004, 14:59:57 UTC
Last modified: 1 Dec 2004, 15:12:05 UTC

Hi again:

new version 2.1 is available:

- colors and linethickness are adjustable by GET-commands:
-> ctx = text color
-> cbo = border color
-> cbg = background color
use it this way: ?ctx=[Hex-color without #, for example FF0000)
-> linethickness (only 1 and 2 are allowed as values)

- code slightly improved

- fixed a small bug

- new function for RAW-output added:
in order to use that ability, you have to set $allow_raw_output to
true in your config.php
With this function, you can provide a formatted data output for users who
don't have PHP-support.
Use it like summary.php (?seti=[ID]&einstein=[ID]...). With method=, you can
specify the output format (can be XML, JS or PHP)

Examples with my SETI- and climate-stats:
XML - JavaScript - PHP

Download the sourcecode (9 KB)

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: 50429 · Report as offensive
Profile Petrus
Volunteer tester

Send message
Joined: 29 Jan 04
Posts: 63
Credit: 32,086
RAC: 0
Germany
Message 50980 - Posted: 3 Dec 2004, 16:59:06 UTC

Again a new version ^^ (v2.2):

improvements:
- parts of the code new written to increase speed and get smaller files
- languages can be edited or added (if you are interested in adding a new language, please look at the subfolder /lang and contact me via ICQ / email)

sourcecode is available by the same link as always :)

Cu@all
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: 50980 · Report as offensive
Profile AthlonRob
Volunteer developer
Avatar

Send message
Joined: 18 May 99
Posts: 378
Credit: 7,041
RAC: 0
United States
Message 51487 - Posted: 5 Dec 2004, 3:01:25 UTC - in response to Message 47567.  

> I don't think that caching is sensible for a script with unlimited users
> because of getting a really HUGE cachefolder ;)

Oops, sorry for the late response...

I was actually talking about allowing client-side caching. I think I have it figured out, now, though....

Rob
ID: 51487 · Report as offensive
1 · 2 · 3 · 4 · Next

Message boards : Number crunching : PHP Statisticscript based on WAPstats


 
©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.