Kait

Updating old code

Forgive the lack of posts recently, a back injury has mostly confined me to bed, and I get a little sick of staring at computer screens.

But while I've been out of it I caught up on Aaron Sorkin's The Newsroom, which I had never seen. As a fan of The West Wing and yes, even Studio 60, I thought, as a former journalismo myself, this would be right up my alley.

And it definitely inspired me ... to get back into writing code. It was so bad. I was surprised at how bad it was. It made me question my own taste and wonder whether I'd misjudged Sorkin's talent.

Don't get me wrong, he has some good scripts, and some of his meaty monologues and dialogues in various things he's written are an absolute delight.

But he's also written the same show at least three times now? Including similar (in some cases, identical) plot points, themes, specific jokes, even a reference to using too much back medicine as an excuse for why a white man said something dumb.

In case you couldn't tell from my recipe intro up top there, this is a post about how I reworked Newslurp, a little app I coded four years ago (right before the Big Newsletter Boom thanks to Covid!). I switched RSS services at one point and was using a "subscribe to the newsletter from the service's email" feature, but the lack of polish in the app (and severe degredation of basic feed-reading) means I'm back on the market.

And rather than tying all my content to another proprietary app, I decided revive Newslurp so I could keep better control of everything. The app had a significant overhaul, with most of the email heavy lifting now being done in Google Apps Script (thus removing the need for Google API integration and the PECL mailparse extension, which is not readily available on shared hosts).

I also switched from MySQL to SQLite (because this is not really an application that needs a whole MySQL DB), and updated the code/dependencies to run on PHP 8.2

My biggest takeaway from the whole thing is that while I really love types, PHP does not make it easy to use them properly with collections or array-like objects. Yikes.

As always, I hope this is in some way helpful to others, but mostly it's helpful to me! Enjoy.

I think legitimately 2 hours of the 5-hour revamp was spent debugging TypedArray issues.