21 coaches online • Server time: 04:09
* * * Did you know? The most aggressive player is Taku the Second with 6628 blocks.
Log in
Recent Forum Topics goto Post Gnomes are trashgoto Post ramchop takes on the...goto Post Chaos Draft League R...
fumbblib development note #1
WARNING! Huge techical text!

In the past few weeks I managed to arrange many of my fragmented Python codes into a library called fumbbllib. I even coded some new stuff. I want to share what can be done with the library at the moment.

Currently the library have three components, bbcode, formats, and session.

bbcode

Currently it only has a table module I used to make the table below from a CSV file. New features will be added by my own needs for posting and editing of group informations.

formats

My prior goal was to mix the informations of the different sources of match results into a single object which can be used for further analysis or magic. Currently, the following formats are available for this:
  • HTML: The HTML match report we all know well. This one gets used as a basis of the detailed match report.
  • API-XML: The XML provided by the FUMBBL API, which is the only source of information about the division_id which is essential. Unfortunately, it is not provided for all matches (BUG #1868), though no problem with recent ones.
  • FFB-XML: The XML which is probably used by the FFB server to update the database and is stored on the site. Unfortunately, this one is also missing for many matches (BUG #1878), but again no problem with recent ones.
  • FFB replay data: This is the ultimate source which contains all aspects of a match. Fortunately it is currently migrating to a human readable form which seems to JSON for the first view but I had not downloaded any data yet.
I have a local copy of all the data of the sources above, even the current FFB replays. It's size is about 80G and I've downloaded it for almost a month long to spare Christer's hardware as much as possible. After I had it I made the parsers of the HTML and API-XML and the code which mixes the two of them. The result is a JSON data which contains the most of what can be get from the formats. The table below contains the keys provided by them:

Key
HTML
API-XML
FFB-XML
division_id
X

gate
X
X
x
match_id
x
X

replay_id
X
X
replay_version
X

team.FAME
X
X
team.TR
X

team.TS
X

team.TV
X
X
X
team.TW
X

team.coach_id
X

team.coach_name
X

team.coach_postmatch_CR
X

team.coach_postmatch_bracket
X

team.coach_rankings
X

team.conceded
X
X
X
team.fanfactor_delta
X
X
X
team.inducements
X
X
team.name
X
X

team.petty_cash_transferred
X
team.petty_cash_used
X
X
team.player.defecting (?)
X
team.player.injuries
X
X
team.player.name
X

team.player.nr
X

team.player.origin
X

team.player.player_id
X
X

team.player.player_type
X
team.player.spps
X
team.player.stats
X
X
X
team.player.stats.spps
X
X
team.race
X

team.score
X
X
X
team.spectators
X
X
team.spiralling_expenses
X
X
team.stats
X
x
x
team.stats.cas_bh
X
X

team.stats.cas_si
X
X

team.stats.cas_kill
X
X

team.stats.suf_cas_bh
X
team.stats.suf_cas_si
X
team.stats.suf_cas_kill
X
team.team_id
X
X
X
team.winnings
X
X
X
time
X
X

type
X



With the formats module I am also capable of watch FUMBBL for new matches played and trigger events based on them.

Future plans:
  1. add remining formats
  2. deal with current games page
  3. add remaining API formats for groups, tournaments, etc.

session

With this module, I can automate tasks on FUMBBL. Currently I can log in and make/edit/delete a group or a note easily. Soon I will be able make alterations in them based on events triggered by the formats module.

This very blog post was tested by just editing a TXT file and updating a note with a plain command.

Future plans:
  1. tournament automation
  2. message editing
  3. wiki editing

I am planning to run my script suite on a Raspberry Pi 24/7 and manage and provide some great stuff with it.

UPDATE#1: session module went private