Score Predictor Animated Logo
SCORE PREDICTORAnalytical Sports Competition

Technical Instructions & Architecture

Since the 2017 season up to the end of the 2025 season the whole of the predictor league was run with an array of custom spreadsheets Google actions scripts and python programs - this historical heavy lifting from season 2026 has been replaced by the Score-Predictor.co.uk progressive Web App - enjoy a description here of how it used to work.

Spreadsheet matrix diagram
01 | Spreadsheet Database
Google Form intake diagram
02 | Google Form Intake
Google Sheet Form Builder helper diagram
03 | Form Builder Helper
Python script scraper diagram
04 | Python Scraper Script
1. Master Spreadsheet Database

The absolute brain of the Score Predictor platform is our custom-coded Excel spreadsheet database. This spreadsheet houses the season schedules, active player metrics, and mathematical matrices required to process weekly leaderboards and outcome metrics.

Every week, the commissioner inputs the real-time match outcomes. The spreadsheet automatically cross-references every player's predictions, applies multipliers (including Magic Bullet and the LoneWolf/CleanSweep conditions), and compiles the master standings instantly.

Spreadsheet Archive Downloads:
System Compatibility Note: These macro-enabled Excel spreadsheets (.xlsm) contain custom VBA script procedures. To run calculations correctly, they must be opened using the Microsoft Excel Desktop Application on MS Windows with Macros enabled. They are incompatible with Excel Online, Google Sheets, or mobile office apps.
2. Google Form Submission Intake

To collect predictions from players cleanly and prevent any layout mistakes, we utilise a customised Google Form. On every game week, players visit the form link, fill out their predicted scores for the ten fixtures, designate their Magic Bullet game, and submit.

The Google Form immediately records the data and triggers an email notification add-on, dispatching a structured copy of the submitted predictions straight to the commissioner's inbox.

3. Google Sheet Form Builder Helper

To automate the creation of each week's submission form and prevent manual input errors, we utilise a dedicated Form Builder helper sheet. The upcoming fixtures are copied and pasted into the designated range (A1:D10) of this spreadsheet.

Once the weekly details are loaded, updating a single control cell (E11) triggers a custom Google Apps Script (GScript) inside the form. This script automatically grabs the compiled data from column F of the helper sheet and instantly populates the questions, options, and fixtures inside the Google Form in under a second.

form_builder_script.gsApps Script
function readInQuestions() {
  //@NotOnlyCurrentDoc
  var form = FormApp.getActiveForm()
  var ss= SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1FyjAWRRtB7cT7S_SNjr4ugAiQFw8xNAfHOXn4asAONw/edit?usp=sharing')
  
  var sss = ss.getSheetByName("Sheet1");
  var title = (sss.getRange(11, 5).getDisplayValue() + " of the 25/26 Season");
  var description = (sss.getRange(11, 5).getDisplayValue() + " of the Premier league kicks off on " + sss.getRange(11, 6).getDisplayValue() + ", please provide your predictions for this weeks games below. Please enter 0 - 0 for nil nil or 5 - 2 for a 5 goal home team and 2 goals for the away team. Any other form of input will not be accepted.  You are required to choose a Magic Bullet game from your predictions this will be worth triple the score in your weekly total. You can predict as many times as you want and your latest version will be used, 24 hours before the start of the first game is the deadline after this no predictions will be accepted. This year we will reward Clean Sweep and LoneWolf multipliers.");
  
  var items = form.getItems();
  Logger.log("how many items - " + items.length);
  Logger.log(" - ");
  
  form.setTitle(title)
  form.setDescription(description)
  formTitle = form.getTitle();
  Logger.log("From title is - " + formTitle);
  formDesc = form.getDescription();
  Logger.log("Form Desc is - " + formDesc);
             
  for (var i = 0; i < (items.length - 1); i++) {
    var itemType = items[i].getType();
    var itemID = items[i].getId();

    try {
        var questionTitle = sss.getRange((i + 1), 6).getDisplayValue();
        if (itemType === FormApp.ItemType.MULTIPLE_CHOICE || 
            itemType === FormApp.ItemType.TEXT || 
            itemType === FormApp.ItemType.PARAGRAPH_TEXT ||
            itemType === FormApp.ItemType.CHECKBOX ||
            itemType === FormApp.ItemType.LIST) {
                
            items[i].setTitle(questionTitle);
            var itemTitle = items[i].getTitle();
            Logger.log("Title set successfully for item ID " + itemID + ": " + itemTitle);

            } else {
              Logger.log("Item does not support setTitle (Item Type: " + itemType + ", Item ID: " + itemID + ")");
          }
    
    } catch (error) {
        Logger.log("Error occurred for item ID " + itemID + ": " + error.message);
    }
    Logger.log("Number is " + i);
    Logger.log("Item ID is " + itemID);
    Logger.log(" -- ");
  } 
}
4. Python Automated Email Scraper

Rather than manually copying hundreds of values from player emails into Excel (which would take hours and cause mistakes!), we engineered a custom background Python scraping script.

The Python script logs into the commissioner's inbox, automatically identifies the structured prediction emails, parses the exact score values, formats them into standard spreadsheet CSV matrices, and outputs them—ready to be pasted directly into your Master Spreadsheet in under two seconds!