For the past few months I've sort of done nothing with this site, and while I could offer a few very good excuses for that (applying & interviewing for jobs, starting a new job, being out of the country for two weeks, etc.), mostly I've just been lazy and procrastinating on a bunch of half-baked project ideas, and didn't feel I had anything really interesting to write about. After doing a little reading and researching how other people deal with this sort of creative slump, I saw an idea: just set a deadline for yourself.
To try out this revolutionary new concept, I decided I wanted to do a project that somehow related to college football. Why? Because that gave me a really easy deadline to shoot for - the start of the 2024 college football season. I didn't want to do anything super flashy, or technical. I wasn't trying to create the next competitor for NCAA '25 or engineer my own stats-based ranking system. I just wanted something silly and fun that I could get done relatively quickly. While I was brainstorming, I was browsing social media and saw someone post their results from one of those "here's what kind of rpg character you are!" generator sites.
So I decided to make a name generator for college football players.I thought it would be a relatively straight-forward task with a few major steps:
- Find a free API so I could fetch college player names
- Write some simple code to randomly select a first name and last name from that data
- Write a simple frontend to display the results
The first step wasn't too bad - I found the College Football Data API, which is free. You do have to input an email address to get an API token, but other than that there's no barrier to entry or use. However, I did run into a problem when I tried to fetch data from the API via a simple JavaScript frontend. I kept getting a CORS error. Now, I knew my token was valid and that I could get the data I wanted from the API because I maanged to do it successfully via curl. So, I figured it was some weird thing with trying to fetch from a server running on my local machine. So I quickly threw my test version up on my domain and tried from there. Same problem. CORS error. Tried a few other things (including a server-side fetch using PHP) and kept getting the error. It's possible I missed something small / dumb, and that sending an email to the people who maintain the API might've sorted things out quickly.
Then I realized that I didn't need the frontend to fetch the data - I could just fetch it once locally, dump it into a database, and host the data myself. Theoretically, this means my dumb, pointless Footballsona name generator wouldn't have 100% up-to-date info, and I'd have to do am update yearly if I wanted to pull in newer names, but...who cares? I just need a big set of names to draw from. So instead of building a JS frontend I instead just wrote a simple Python script to fetch the player data, and then break each player into a first name, a last name, and a position abbreviation. I inserted each of these into their own tables in the DB, and then did a mysqldump to transfer it to the DB running on my webhosting platform.
The frontend is a dead simple HTML page, minimally styled using colors from the ESPN website. There's a button. You click it. It calls out to a PHP page that selects a random first name, a random last name, and a random position, then returns those values combined as a single string. There's a snippet of JavaScript that then shoves that value into the page so its visible. There's a little bit of work to use ARIA labelling and tab ordering to make the site accessible (I even tested it with a screen reader and it seemed to do ok!) so hopefully its at least somewhat usable for keyboard-only navigation and users with vision problems.
And it's live here! While testing and playing around with this, I was reminded of the Key & Peele East v. West College Football sketches where the players have increasingly unhinged names, so here's a few of my favorites that showed up while debugging things:
- DL Decarius Pringle
- DL Jagger Walker
- WR Penny Hoitink
- QB Udoka Hightower
- TE Daquirs Bakich
- PK Antoineo Rooks
- DL Xavier Hedgemon
- LB Shiyazh Telles
- RB Wesley Yurk
- RB Nehemiah Dollar