Threads API is now public
Saving this here so I can come back to it and integrate posting to Threads into this blog.
Database Victory
FINALLY.
I have spent far too long trying to resolve the database issues for Wyrmling, my collection management tool. It now appears to finally be done correctly. I'm using Laravel as the PHP framework and it has a fantastic tool for defining database structure so that it can be stored in git. It took me far too long to sort out the database definitions, but tonight it all ran successfully, including setting up the foreign keys.
Now that the database is setup, I can finally move on to building the remaining 99.5% of the app.
Sometimes the correct answer is to not touch it anymore
Yesterday I did a surprising amount of coding on Glowbug. Most of it entirely invisible to you all. The quick overview:
- Bluesky embeds (we'll come back to this)
- Updating my css editor page in the admin to be able to edit any of the template files
- Updated my image management page in the admin to have pagination
- Simple CSS updates
Okay, so let's come back to Bluesky.
I managed to get invited to it yesterday, as noted when I shared my (current) account name. It's fine. It feels like basic Twitter. What I loved though was seeing how simple generating an embed URL can be. It's just an iframe to a path which includes the desired post.
Great.
Except that took me down a rabbit hole of trying to understand why the Markdown generation of my blog continually failed to handle embedded html example iframe to show how clean the embed code is. Embedding html in posts in my blog is currently one of the things which is broken and I haven't really fixed because I never do it. Except for yesterday when I wanted to do it.
It's broken in a few ways:
- When I go back to edit that post, the embedded html is processed as html into the in-browser editor, which often leads to it breaking itself.
- The code tag delineations are no help here. Even wrapping the iframe in HTML's 'pre' or 'code' tags didn't stop it from rendering as html. And I have no idea why.
So, this means once I submit a post with embedded html, I can't touch it again except directly through the database.
I'll figure this out eventually, but I didn't last night.
And as I did these various codings, I apparently broke something. The automated end-of-day post didn't happen. The code that generates it wasn't even something I worked on yesterday, but because of how the blog is coded it's quite possible I accidentally messed it up.
So I tried to figure it out this morning. In doing so, I also noticed the newsletter generation wasn't working. So I worked on that some.
None of these, by the way, have satisfactory "I fixed it!" resolutions. The newsletter eventually sent, though I don't know why. We'll see if the end of day post runs tonight or not.
Sometimes, when you run and use your own code, if it suddenly works - the correct answer is to not touch it anymore.
Behemoth morning code
I woke up at 5 this morning and so I decided to finally start implementing stuff on Behemoth, rather than just getting it framed and basically styled.
So, this morning, I figured out login and registration in Laravel. It was overall pleasantly easy. Though I made my life harder as the default identifying field is 'name' with the framework. Because I changed it to be 'username' in the table it didn't work right away. I had to trace through code and update it which took a little longer. That said, I had it all sorted and working in roughly 40 minutes.
I suppose I could have just reverted the table's column name but that breaks the naming structure I have defined so I'd have to go through and update table details.
So, it's fixed and working. Now the real fun can begin.
Behemoth Coding Update
The biggest obstacle to me starting on Behemoth, my collection management software, has been the database. I've had the schema concept for over a year; but, now that I have finally started to sit down and code it I've begun to find issues with it. They are, thus far, all addressable and largely just oversights from the simplistic schema. One example is that I had not fleshed out how exactly I'd track the collection-specific entry details in such a way that would enable the flexibility of the system I envisioned.
I am convinced the idea is sound, it just is proving to require a bit more nuance than I had originally conceived.
As I write more, I am more and more excited to be learning Laravel. Its power has been immediately obvious. Comparing the experience from the work on web apps I've coded entirely on my own for pathing and models, as well as their implementation of database management for deployments, etc. It is just obviously powerful and robust.
Additionally, I'm learning Tailwind CSS. It's an interesting concept which entirely assigns elements to objects rather than adopting the semantic CSS concept where you define larger classes, etc. I will say I'm not yet convinced by it, the way I am with Laravel. But we'll see. Perhaps the simplicity of it will convince me.

PHP in 2023
I default to PHP for my server side programming. And, while I'm just a hobbyist, it's interesting to see where PHP is going and how. I hadn't really been aware of the PHP foundation, but I'm glad to hear about it and that its first year has been a success.
Coding for flexible scheduling
This morning's back-of-my-mind coding puzzle I'm trying to figure out. How to best handle flexible scheduling of things. I want to do a rotation of posts that are of a similar format: "What I'm Reading," "What I'm watching," "What I'm listening to," and "What I'm working on" - these would rotate through books, tv, podcasts / audiobooks, and the things I'm spending my time on.
But I'd like to add it as a feature in Glowbug as a scheduled prompt sort of thing. But I need to figure out how I store it flexibly so I can say "First Saturday", "Second Saturday", etc.
Right now my idea is to make use of PHP's strtotime() function which works on the above, but doesn't handle "every Monday" etc. So I'm trying to wrap my head around this puzzle and figure out how to tackle it.
PHPDesktop
A framework that allows you to use PHP for developing desktop apps. As PHP is my primary coding language these days, I am definitely going to have to give this a look. I don't have a project I want to dive into with it right now, but I'm sure something will come.
Morning Blog Coding
This morning I spent a little time tweaking the CSS on the site. It started just because I noticed a quirk with my embedded code blocks, if the line goes too long it breaks the layout. I'm still trying to figure out the fix for it. As I was working on it, I also realied I was not loving the font of the site - especially when it was used for code. So, I spent a little while tweaking it. Still not perfect, but better.
As part of this it has also become clear to me that I need to change how CSS is handled. Currently it's a template file, so updating it required publishing the entire site. That got annoying. So I finally took the first step toward section publishing, the idea that when I post an article, I don't need to rebuild the entire site.
For today, I just added the ability to define specific classes of templates I wanted to publish. So now I can specify if I want to just publish the frontpage, or the dates archives, or the individual posts, etc. Primarily this is useful for things like this morning, where I am focusing on modifying templates and want to just refresh what I'm working on - but it is a step towards the smart publishing I want.
Unshortening URLs in PHP
In an effort to expedite my posting of links from my phone, yesterday I added a function which expands shortened URLs in the blog, so I don't have to do that on my side. It took a little testing to get it to work right. I found examples online were incomplete, often written only for cases that definitely used shortened links and that did not handle when the link wasn't shortened, etc.
Sharing where I landed, in case it is useful to others.
function unshorten($url) {
//Checks if the variable appears as a URL
if (!filter_var($url, FILTER_VALIDATE_URL) === false) {
//Fetch the headers of that URL, requires PHP 5+
$headers = get_headers($url, true);
//If the URL is being forwarded, it will have the 'location' set in the headers
if (isset($headers['location'])) {
//Overwrite the provided URL with the new destination
$url = $headers['location'];
}
}
return $url;
}
Tonight's coding is not on Glowbug but on another one of my projects. One in need of a refresh and rewrite: My Fixture Picker. Currently it lives on firsttou.ch, but honestly I might let the domain drop and just bring it over to trickjarrett.com. We'll see.
This site solves a problem for me: I really like watching soccer. I have access to lots of games in different leagues on different channels or streaming services. How do I pick what I should watch?
What exists right now is entirely made via server side code using PHP. What I need is to rewrite it so instead it provides your browser with all the raw match data and then you can set some variables for preferences, pick favorite teams, etc. And then it is saved in cookies or as a unique user for you.
So, my plan today is to begin working on that rewrite. I might use this as a chance to experiment with ReactJS since I have no experience with it. We'll see.
