60 coaches online • Server time: 21:06
Forum Chat
Log in
Recent Forum Topics goto Post Gnomes FTW! (Replays...goto Post Roster Tiersgoto Post Gnomes are trash
SearchSearch 
Post new topic   Reply to topic
View previous topic Log in to check your private messages View next topic
Shraaaag



Joined: Feb 15, 2004

Post   Posted: Jan 07, 2010 - 15:11 Reply with quote Back to top

NEW LINK: http://www.pvv.ntnu.no/~brill/fumbbl/


I enjoy scripting with php, but I hate parsing html. Nevertheless I'm trying to make a script traversing (some) FUMBBL games and lists out player records (cas, td, mvp etc...). I made it for a league I play in, which gives out achievements to players (ie. best scorer in a tournament and so on). Initially we did this process manually, but it was time consuming. Atm you have to copy/paste all the match links you want into the form, but I'm working on a way to parse tournaments (problem is that tournament pages varies alot html-wise, and I hate parsing html).

Click here to try the script

The output will look something like this:
Image
NBBM Ã…sgard 11

In addition to this you can also see individual records for every player, and links to every game. You'll need to have javascript activated.

Note1: It might take some time going through all the matches (depending on how many), and the code is far from optimal. I'm not sure how process-heavy this is, but if it turns out to be a drag on either the web-server it's located or on the fumbbl-server, I'll turn the script off. I've set an upper limit to 50 games, until I've done some further testing.

Note2: The script isn't fool-proof, you can easily give an input it doesn't understand, or maybe it just reaches a snag in the parsing, or maybe I've just taken one too many short-cuts in the code.

Note3: As mentionned, I'm working figuring out a good and safe way to parse tournaments pages instead of having to copy/paste every game link.

Note4: If you have a suggestion or bug reports, please post it. I can't promise I'll do anything but eat pie, but I'll at least think about it.

Note5: Pie!

Note6: There are ofc several ways to make this faster and easier, but that either requires an alternative source of data instead of html (XML documents), being Christer (ie. having access to the Database), more experience with parsing, or using something better than php.

Extra:
Get all the games of one of your teams:
http://www.pvv.ntnu.no/~brill/team_script.php
Get all the players of one of your teams:
http://www.pvv.ntnu.no/~brill/player_script.php


Last edited by Shraaaag on %b %15, %2010 - %16:%Apr; edited 2 times in total
Shades_SteelFist



Joined: Sep 11, 2008

Post   Posted: Jan 07, 2010 - 15:28 Reply with quote Back to top

I just tried with a League I staff and I can easily say that this is one of the easiest and fastest ways to collect all the relevant data needed for a stats page, You've just made my life 100 times easier, thnx mate and well done Smile

_________________
Nuffle is cruel but we love him still
ryanfitz



Joined: Mar 24, 2009

Post   Posted: Jan 07, 2010 - 16:34 Reply with quote Back to top

Amazing Shraaaag,

Thanks for the great tool!

Being able to plug in a 'Tournament' would be amazing, but an extended limit on the games would also be excellent.

Keep up the great work and thank you.

~ryanfitz
krytie



Joined: Aug 16, 2007

Post   Posted: Jan 07, 2010 - 16:48 Reply with quote Back to top

This looks good. I like the way you can break it down into individual games or just check totals. Makes it quick and easy to find the best performer per team in addition to the best in the league.

It will be a real bonus for group admins and casual observers alike when this is updated to require a single tourney url as input -- Much kudos if you do pull that off.
I'm sorry to say I don't know enough about it to be able to aid with this or with streamlining the search.

_________________
There are three types of people in this world -- those who can count and those who cannot!
Wraith



Joined: Aug 02, 2003

Post   Posted: Jan 07, 2010 - 17:29 Reply with quote Back to top

Awesome work.

_________________
Insanity, is merely the lack of fear... to act on your deepest, darkest thoughts.
Kryten



Joined: Sep 02, 2003

Post   Posted: Jan 07, 2010 - 17:30
FUMBBL Staff
Reply with quote Back to top

Slick, I've been meaning to put together something like this. Any chance of picking up the source so I can mod it?
Shraaaag



Joined: Feb 15, 2004

Post   Posted: Jan 07, 2010 - 18:16 Reply with quote Back to top

Kryten wrote:
Slick, I've been meaning to put together something like this. Any chance of picking up the source so I can mod it?


I'm gonna make a few more modifications before I give the source. Just so you know, I haven't written any helpful comments. In fact this is one of those scripts that if I hadn't written it myself, I probably would've made fun of the author Razz
Shraaaag



Joined: Feb 15, 2004

Post   Posted: Jan 07, 2010 - 18:37 Reply with quote Back to top

About limiting the number of games... The server (or php configuration) limits the time it's gonna let a script run. So let's say I try to go through every game in the last Fumbbl cup (302), parse every game for the wanted information, it's gonna take some time. So until I find a way to make the script faster I'll put a ceiling on the number of games. 50 was just a number I pulled out of my magical number hat, but I can easily increase it. How many games does an average tournament have?

Incidently, changed the limit on my home computer (took 2 minutes to run the script), these are the stats from the last FUMBBL Cup:
Image
peikko



Joined: Aug 02, 2003

Post   Posted: Jan 07, 2010 - 19:00 Reply with quote Back to top

Shraaaag wrote:
About limiting the number of games... The server (or php configuration) limits the time it's gonna let a script run.


Its set with max_execution_time in the php.ini file. Also you can override it within your code with command set_time_limit(x);
More about it: http://php.net/manual/en/function.set-time-limit.php
Shraaaag



Joined: Feb 15, 2004

Post   Posted: Jan 07, 2010 - 19:44 Reply with quote Back to top

peikko wrote:
Shraaaag wrote:
About limiting the number of games... The server (or php configuration) limits the time it's gonna let a script run.


Its set with max_execution_time in the php.ini file. Also you can override it within your code with command set_time_limit(x);
More about it: http://php.net/manual/en/function.set-time-limit.php


Yeah, but I don't have access to the php.ini file on the server I use (only on my homecomputer which I use for testing).
set_time_limit() seems to work, however I still would like to see if I can reduce the execution time.
Shraaaag



Joined: Feb 15, 2004

Post   Posted: Jan 08, 2010 - 15:25 Reply with quote Back to top

I've removed the games limit, and increased the time limit (but still, try not to overdo it).
While figuring out the kinks of parsing tournaments, I've made a script to parse your team games (Click here). It outputs links you can just copy/paste into the first script. (If you only want your team's stats and none of your opponent's, then just type in your team's name in the correct box.
Shades_SteelFist



Joined: Sep 11, 2008

Post   Posted: Jan 08, 2010 - 15:42 Reply with quote Back to top

Shraaaag wrote:
I've removed the games limit, and increased the time limit (but still, try not to overdo it).
While figuring out the kinks of parsing tournaments, I've made a script to parse your team games (Click here). It outputs links you can just copy/paste into the first script. (If you only want your team's stats and none of your opponent's, then just type in your team's name in the correct box.


Very cool mate, Dont want to be a drag but is it possible to be able to sort between all Time and active Smile

_________________
Nuffle is cruel but we love him still
Balle2000



Joined: Sep 25, 2008

Post   Posted: Jan 08, 2010 - 16:02 Reply with quote Back to top

Got to hand it to you Shraaaag, you've saved ourselves at NBBM from many hours of tiresome statistical collection!

But don't get me wrong, your amazons are still earmarked for heavy tackles

_________________
Join the SWL
Image
Get your team bios here!
Putting the romantic in necromantic since 2010
Rijssiej



Joined: Jan 04, 2005

Post   Posted: Jan 08, 2010 - 16:14 Reply with quote Back to top

It seems your link for the top rusher and his team are broken.

The script is pretty kewl though Smile
Shraaaag



Joined: Feb 15, 2004

Post   Posted: Jan 08, 2010 - 16:20 Reply with quote Back to top

Rijssiej wrote:
It seems your link for the top rusher and his team are broken


Thanks for pointing it out, I easily got blind with messy code Smile Fixed now
Display posts from previous:     
 Jump to:   
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Log in to check your private messages View next topic