Perl Fantasy Football Version 0.1

This is a set of scripts that will allow you to setup and maintain a fantasy football league. It requires a MySQL database and the perl interpreter. This initial release will allow you to enter team, goalkeeper and striker data, to create various html files and forms, to make player entries, to update the weekly statistics for teams, goalkeepers and strikers currently picked, and to generate an html file containing a detailed league table. This release does not include the ability to add new strikers, delete old strikers or to maintain the costs and teams of existing strikers. Nor does it allow players to update their team,goalkeeper and striker selections (but it will very soon do). These perl scripts are NOT designed to run as cgi scripts within a web server environment, they are intended to be run off-line, and any output generated from then uploaded to a web site for display...Roll on the day when British Telecom stop charging for local calls and we in the UK can afford to maintain permanent links to the internet, and thus run local web servers.

football.sql

mysql database creation script

addteam.pl team_file

adds a list of teams to the database.

input file format :-

team_id TAB Team_Name TAB cost

should generate a team_id if the "team_id TAB" portion is not included.

addkeeper.pl goalkeeper_file

adds a list of goalkeepers to the database.

input file format :-

keeper_id TAB Team_Name TAB cost

should generate a keeper_id if the "keeper_id TAB" portion is not included.

Team_Name must match the Team_Name added by addteam.pl.

addstriker.pl striker_file

adds a list of strikers to the database.

input file format :-

Team_Name

striker_id TAB cost TAB Striker_Name

should generate a striker_id if the "striker_id TAB" postion is not included.

Team_Name must match the Team_Name added by addteam.pl.

multiple strikers can be added after a Team_Name.

getmailteam.pl extracted_mail_file

extract submission form information from a mail message and creates a players team.

It assumes that entryform.pl generated the html input form.

After creating a new player, you must manually update the player entry to add :-

Initials and Short_Name (shortened team name)

Initials is a unique key, thus preventing further team additions until setup.

entryform.pl >maketeam.html

outputs an html format entry form.

listteams.pl >teams.html

outputs an html format list of teams.

listgoalkeepers.pl >keepers.html

outputs an html format list of goalkeeper.

liststrikers.pl >strikers.html

outputs an html format list of strikers.

listplayers.pl >players.html

outputs an html format list of league players.

mysql football <findpicked.sql >playlist

mysql script to select teams, goalkeepers and strikers picked by players.

weeklyresults.pl week_number edited_playlist

enters scores from the output generated (and then edited) from findpicked.sql.

calcresults.pl week_number

updates the players after weeklyresults.pl has been executed.

leaguetable.pl >league.html

outputs an html format list containing the league table.

links.add

html format file which is included in all html output.

It serves to provide links to other pages.

title.add

html format file which is included in all html output.

It serves to provide main headings for each page.

Week by week processing

Use findpicked.sql to obtain a list of teams, goalkeepers and strikers that have been picked. Watch the games, use teletext or read a newspaper and update the file created by findpicked.sql to enter number of goals conceeded by teams and goalkeepers and number of goals scored by strikers. findpicked.sql conveniently defaults this to 0.


Once all results are in execute weeklyresults.plto setup the results table for the week. Execute calcresults.pl to update the player statistics for the week.
Execute leaguetable.pl to output a league table in total points accrued order.
Publish the output from leaguetable.pl in your fantasy football site.

Enjoy !

Mark W J Redding


Return to the Perl Footie Index page
Return to the Index page