Michael VS HackPompey Round 2

Posted on 2025-12-15 10:31:11

Michael VS HackPompey Round 2

Pre-Waffle

After attending and destroying my first hackathon last year . I was itching for another one, so I went to Hack Pompey this year to defend my title (and for the free food and merch—okay, mostly for the food and merch). Ready to defend my title we had rocked up with nothing but our laptops, a crate of Celsius, and our sleep-deprived brains.

This year it was sponsored by SSEN (Thank you for the beanie) and they had given us a load of data straight from the grid. I was hopeful for good, easy-to-use, clean data and you know what. They were halfway there. All the data was in fact clean. Traversing it and using it was a nightmare. The API returned JSON-LD (I had never seen Linked JSON before) and it only linked to the multi-page excel files. It was API armageddon. After working around with it up till lunch we had managed to untangle the web of data and had created our own API with a caching server to not overload their API or hit a rate limit.

  1. We make a request to their linked JSON file.
  2. We download every linked excel file. (SSEN if you're reading this. Please switch to CSV. Pretty Please).
  3. We then extract every page from every spreadsheet.
  4. I then check the row against the premade list of "Scottish terms" and if a "Scottish term" is found that row is extracted and put into our own local caching server.
  5. A Flask server hosts a local API that reads from the saved cache file and repeats steps 1 to 4 every 5 minutes.

Here is the code for the parser and API: CODE

While the tech behind the parsers and the cache server is cool, I'm not sure it will win any awards. On the journey to victory, Dashboards. I don't know about you but I'd take a pretty dashboard over reading raw JSON almost any day. (Freak Fridays are the exception, that's when I look at the raw hexadecimals). With a bit of HTML, Bootstrap magic, and Flask (I will defend Flask till my dying breath) we actually started to have something presentable.

Dashboard

Dash2

Last year I won one of the technical awards but I learnt last year that the real prize is the Public Choice Award. And the key to that is humor. So now we have this data, let's make something fun with it. Let's work out how many kettles are needed to take down the Scottish power system at any time and turn it into a game.

How does the game work?

It's actually rather simple but the best ideas often are. You can view the LIVE VERSION HERE.

  1. Find the current Available Capacity in MW of the Scottish power grid (turns out it does not change too much). We can do this by making a call to the API we made earlier.
  2. Next we do some maths.

    python kettle_power = 3.0 # kW per kettle total_kettle_power = (kettle_count * kettle_power) / 1000 # Convert to MW remaining_capacity = available_capacity - total_kettle_power blackout_percentage = min(100, max(0, (total_kettle_power / available_capacity) * 100))

    Unlike last year this maths is very simple. We work out how many kettles have been added. Find out the remaining grid capacity and then finally work out how close we are to a blackout as a percentage.

  3. Next we display some warnings and some alerts. If we hit a blackout we want the screen to start flashing to show the power grid has gone down. Here was what the game looked like.

Photo1

Photo2

Now for the hard part, a cracking presentation and this is where I think we need to thank the rest of the team as I'm not sure I'd be able to make it anywhere near as funny.

How Many
Presenting

Put that all together, do some nervous on-stage rambling and BAM winning Public Choice Award combo.

The worlds greatest team

Thank yous. Now I want to thank a few people.

First I want to thank the Hack Pompey Team:

  • Charlotte
  • Hannah
  • Ming
  • Sage and Jane
  • Jack
  • Tom
  • Ryan

You managed to put on an amazing event again, thank you so much for all the time it took. Another thank you to Jack for suggesting we lean into a fun idea, Bringing Down Scotland was definitely the selling point of the project.

Another thank you to SSEN for sponsoring the event and the amazing prizes.

And finally one more massive thank you to my teammates and friends for making this event so much more enjoyable and for the great company:

Back to Home