Message boards :
Number crunching :
PHP Statisticscript based on WAPstats
Message board moderation
Author | Message |
---|---|
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
Anonymous Send message Joined: 15 Jan 02 Posts: 307 Credit: 24,137 RAC: 0 |
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&project=seti&ctx=white&cva=red&cbo=white&cbg=black&linethickness=2"></a> |
N/A Send message Joined: 18 May 01 Posts: 3718 Credit: 93,649 RAC: 0 |
You are the MAN! Excellent job! |
Guido Alexander Waldenmeier Send message Joined: 3 Apr 99 Posts: 587 Credit: 18,397 RAC: 0 |
test ;-) |
Meatwad Send message Joined: 12 Mar 04 Posts: 1 Credit: 63,952 RAC: 0 |
OHHH I LOVE TESTS!!! I KNOW THE ANSWER! ists 44!!! |
FrankH Send message Joined: 25 Feb 04 Posts: 25 Credit: 18,183 RAC: 0 |
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 |
FrankH Send message Joined: 25 Feb 04 Posts: 25 Credit: 18,183 RAC: 0 |
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 |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
Ron Roe Send message Joined: 28 Feb 02 Posts: 156 Credit: 24,124 RAC: 0 |
> 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 :-) |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
AthlonRob Send message Joined: 18 May 99 Posts: 378 Credit: 7,041 RAC: 0 |
> 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 |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
> 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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
Ron Roe Send message Joined: 28 Feb 02 Posts: 156 Credit: 24,124 RAC: 0 |
> OK, I just finished v2.0! > ..... > ..... > ..... > cu@all > Petrus > Outstanding work! Thanks again! |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
Petrus Send message Joined: 29 Jan 04 Posts: 63 Credit: 32,086 RAC: 0 |
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&style=2"> <a href="http://tinyurl.com/5klcp">Use</a> / <a href="http://petrus.homeftp.org/scripting/download/count.php?id=6">Download</a> |
AthlonRob Send message Joined: 18 May 99 Posts: 378 Credit: 7,041 RAC: 0 |
> 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 |
©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.