Developer Diary, International Workers' Day
Today, but for the infamous American allergy to communism, everybody would celebrate May Day as Labor Day. However, because the United States associated the holiday with the Soviet Union we have our own Labor Day in September, and this day became referred to as International Workers’ Day, celebrated pretty much everywhere except the United States.
I can’t exactly unionize against myself for these little projects, so let’s move on…
Mastodon Tool Trunk
The Rummager now wraps toots with content warnings in an appropriate manner, along the following lines. It probably should have done something like this from the beginning, but considering how few users actually bother to use content warnings ⚞grr…⚟, it didn’t make too much difference…
<summary>
Content Warning
<details>
Status that came with a warning.
</details>
</summary>
This allows Mastodon’s content warnings to function as intended.
You should also see some basic improvements to the code itself. It now mostly complies with ESLint’s advice. I refactored the timeline-generation code so that it didn’t consist of dozens of nearly identical lines. And the CSS makes a bit more sense.
Finally, while I haven’t connected the buttons to anything, the toot-footer buttons now display, so that users can eventually like, boost, and so forth.
Morning Dashboard
After finding a new API to play with via AirNow, my Morning Dashboard now includes air quality information.
As I get used to it, I may change the specific API endpoint that I use, but for now, I get a numerical value (0 – 500), the descriptor of the air quality value—good, moderate, unhealthy for sensitive groups, unhealthy, very unhealthy, and hazardous—and the variety of pollutant (ozone or particulate matter) likeliest to cause problems.
Personally, I’d prefer an hourly forecast to go with the weather forecast, but I also don’t know if that makes any sense.
Entropy Arbitrage
GitHub - jcolag/entropy-arbitrage-code
This probably requires some back-story, to make sense of a tiny change.
For Friday’s social media roundup, I referenced a toot that I made that included a tiny image. In previewing the blog post, I noticed that it stretched the tiny image to an obnoxious degree, because the CSS set width: 35%
for those off-to-the-side images, a choice that I made forgetting that small images might exist, too.
In this case, I had a straightforward fix, changing that style rule to max-width: 35%
. Now, a tiny image—such as what appeared in that toot—will show at its actual size, whereas larger images get scaled down to (slightly more than) a third of its container.
And yes, it horrifies me that I needed to write eighty-odd words to help explain why I needed a four-character addition to a file.
In addition to that, the configuration file makes a bit more sense; three years into the blog, the boilerplate comments explaining a domain name no longer seem useful.
And pretty much every page on the blog should now (invisibly) reference my Mastodon account, using the rel="me"
identity standard. I think that this will work for tools like StreetPass, so such tools should light up, even if someone visits a random page on my blog, instead of my home page.
Next
I imagine that I’ll continue working on the Rummager, probably looking mainly into how to represent boosts. Right now, the code ignores them, because they don’t include a status, but I do sometimes want to read what the people I follow share from third-parties. And that should probably look like a good time to start adding the assorted filters that I want to put in place, which will itself require uploading data to Pantry.
Credits: The header image is Socialists in Union Square, N.Y.C. by the Bain News Service, long in the public domain.
By commenting, you agree to follow the blog's Code of Conduct and that your comment is released under the same license as the rest of the blog. Or do you not like comments sections? Continue the conversation in the #entropy-arbitrage chatroom on Matrix…
Tags: programming project devjournal