Skip to content

Notes

Short status updates.

If your WordPress install and Mastodon server run …

If your WordPress install and Mastodon server run on the same server, wp_http_validate_url() and thereby Share on Mastodon’s settings page may reject your instance URL. (WordPress, somehow, rejects “local” URLs.) The API calls themselves will probably work just fine, though. (wp_remote-post() and its cousins normally do not explicitly “validate” URLs.) This behavior’s “fixed” by explicitly allowing these URLs by means of the http_request_host_is_external filter. https://github.com/janboddez/share-on-mastodon/issues/46#issuecomment-1408315635

In reply to https://starrwulfe.xyz/9730-2/. Is there a …

In reply to https://starrwulfe.xyz/9730-2/.

Is there a way to expand the context block to handle all the other post kinds?

Good question. I had some plans, but—just have a quick glance at my “notes” section—since I mostly use these three or four types, that’s what I went with. I wanted to do different blocks, but they would share so much code that it kinda made sense to just “merge” them into one.

That said, I’m looking into nesting other (Paragraph, etc.) blocks to avoid having to explain to people that, for “notes,” they probably want Context blocks followed by a Group block with an e-content class, or go find the right block templates and so on. (I mean, you don’t have to; it’s just I prefer the way most Microsub readers treat that sort of setup.) Anyhow, if I ever go there, I may have to “split up” the Context block anyway.

So, yeah, new blocks (or “kinds”) are certainly an option. RSVP would be nice. Reads, too, perhaps (although I’ve yet to use them).

Another thing I started but then halted is more elaborate “contexts,” where I show not just a URL, but a title and author, too. (Part of it is still there in the code, in fact.)

Can you tell me how you’re doing your editing?

I use both WP-Admin and a Micropub app (Indigenous, I’m on Android). Sort of 50–50. On my one blog, I use the classic editor and a “text expander” to help me hand-type HTML and microformats. On another, it’s the block editor and Context block (plus the occasional Columns and Image blocks, etc.). My notes support Markdown, too.

This way, my posts’ “kinds” are inferred by the actual microformats in them, rather than determined by an explicit taxonomy. I really wanted my “notes” to cover also quick replies and “bookmarks” or “quotes,” have everything in a single “timeline.” (My goal was for it to be like Twitter, yes.)

Also what plug-in or custom coding are you using to show the weather and shortlink?

The weather bit, or part thereof, is actually IndieBlocks; it’s “hidden” behind the “Location and Weather” option (Settings > IndieBlocks > Miscellaneous). This will add a “Location” meta box to (by default) posts and notes. (It should also work with Microsub latitude and longitude coordinates.) Weather data is pulled from the OpenWeatherMap API, and uses the location information.

This does require, however, a (free) API key, which you should add to wp-config.php like so: define( 'OPEN_WEATHER_MAP_API_KEY', 'your-actual-api-key' );.

The tricky bit, however, is this: there’s currently no easy way to get the weather data out of WordPress’s wp_postmeta table. I’m going to have to add that, and document this part of the plugin.

Meanwhile, and this may actually your best bet, you should definitely check out David Shanske’s Simple Location plugin, which is where I got the idea in the first place! (It is much more feature-rich, too.)

The shortlinks, then: I host my own super simple URL shortener, but there’s plenty of other solutions. I call it whenever a new post is published; it returns a shorter URL, which I again store as post meta. I’ll likely blog about this part in the near future! (In my theme—it’s not really a theme, but whatevs—I fetch this URL and output it. get_post_meta( $post->ID, 'short_url', true ), that’s about it.)

Bookmarked https://www.manton.org/2023/01/24/ivory-and-microblog.html. This is an important distinction to …

Bookmarked https://www.manton.org/2023/01/24/ivory-and-microblog.html.

This is an important distinction to make. (Just FYI: ActivityPub does come with a client-to-server API, which Mastodon chose to ignore.)

ActivityPub is a mostly server-to-server API that both Micro.blog and Mastodon support. […] Likewise, [you] can follow Mastodon accounts and reply to posts without needing an actual Mastodon account yourself.

For client apps like Ivory, Mastodon has its own API. It’s a completely different thing than ActivityPub, closer to the Twitter API. It’s not an open standard and Micro.blog does not support it.

The following also holds, at least in part, for Micropub—yet another API, yay!—clients. Part of the confusion can be overcome by adding support for the spec’s “config queries” (where apps are able to detect which features a server supports).

If Micro.blog worked with Ivory, what would the UI look like when the features didn’t exactly match up? It would be confusing.

In reply to https://starrwulfe.xyz/8627-2/. No worries. I used …

In reply to https://starrwulfe.xyz/8627-2/.

No worries. I used to run my own Microsub server and client (somewhat extensive forks of Aperture and Monocle, respectively), then coded up a “more traditional” feed reader (with h-feed and partial Microsub support), which I am now porting to WordPress, in the form of a plugin. That plugin actually has (optional, and somewhat limited, but it’s something) “reply,” “bookmark,” and “like” abilities much like your typical Microsub clients. (Microsub itself, as well as h-feed support, is out, at least for now. Most other things work okay. And it’s going to take some work to get it to hook into Post Kinds, which I personally don’t use. Post Kinds, I believe, uses meta boxes for target URLs and the like, whereas I mostly work with “raw,” i.e., in-post HTML. That’s not to say it couldn’t work, just that it’d take some time.)

TL;DR: I literally went from hosting a handful of apps, different programming languages and whatnot, to (mostly) a single, self-contained WordPress install!

In reply to https://starrwulfe.xyz/some-thoughts-on-yarns/. Re: OPML import, I …

In reply to https://starrwulfe.xyz/some-thoughts-on-yarns/.

Re: OPML import, I once created https://github.com/janboddez/add-opml-to-yarns/. While it may not support OPML v2, you might wanna give it a try. (Other than that, I’m not much of a Yarns fan. Its database architecture is pretty weird, and I’m afraid it doesn’t deal too well with larger amounts of data. Plus, I’ve sort of stepped away from the whole Microsub thing, but that’s just me.)

In reply to https://jan.boddez.net/notes/8db31d4a63. Recently saw someone mention …

In reply to https://jan.boddez.net/notes/8db31d4a63.

Recently saw someone mention they’d come across a request for “ActivityPub, but without follow notifications,” which (understandably) they felt was a bit creepy.

At the same time, that is exactly what RSS is. (Or any web scraper.)

ActivityPub, in fact, is a lot like RSS-plus-WebSub. Everything has a URL, everything (private messages aside, hopefully) can be crawled, and so on. Depending on the user agent and purpose, the server behind these URLs will (often) either return JSON or HTML. HTML, like any web page!

It is absolutely possible to add ActivityPub to just about any website. The (public) timeline thing, the avatars, the “action” buttons below statuses—the GUI, in short—none of that is part of the Fediverse per se. It’s just that people have mostly been building (federated) clones of popular social media sites.

In reply to https://rubenerd.com/obsolete-tech-the-battery-daddy/. All the time. The …

In reply to https://rubenerd.com/obsolete-tech-the-battery-daddy/.

All the time. The number of battery-powered toys is … infinite? DUPLO trains; Super Mario LEGO; remote-controlled cars; dolls that cry, laugh, and burp; an ice cream cart that talks. Also, smoke alarms, and door chimes (and the latter take only disposable/alkaline batteries because rechargeables have that slightly lower voltage).

[W]hen was the last time you replaced a cylindrical battery out of anything, save for the odd remote control?

In reply to https://jan.boddez.net/notes/436f21f3a2. I log into ManageWP—a …

In reply to https://jan.boddez.net/notes/436f21f3a2.

I log into ManageWP—a dang handy tool by the way, although I only use it on a few select sites—for the first time in a long time, and bam, I get hit with the very same notice. Very same vulnerability database. (Clicking around a bit actually reveals that this particular CVE is all about a fairly ancient Windows app called FeedReader3, and that a certain mailing list at one point did mention, in a rather unrelated fashion, “WordPress,” so there’s that.)

Here’s something new. I occasionally—using [this bit of …

Here’s something new. I occasionally—using this bit of code—fetch (very basic) weather data when I post to this site, and I just saw a temperature, underneath a day-old note, of minus zero degrees Celsius. (Not that that’s incorrect per se, but I’d like to avoid it right here.) The “fix”? Run the (floating point) number through round() first, then number_format().

I have yet to look into it, but …

I have yet to look into it, but I fear that using [email protected] or whatever as the “email address” for webmentions might lead to issues, should one have enabled only the “Comment author must have a previously approved comment” setting, in WordPress’s Discussion settings. (I manually review each and every comment, so I wouldn’t know.)

I mean, if every comment (i.e., webmention) appears to be coming from the same (dummy) email, then … basically, all of them are going to be approved.

You should probably not add “No Title” to …

You should probably not add “No Title” to your titleless “IndieWeb” notes. Even if your site’s front end doesn’t show these “titles,” your RSS feed still might. Which would cause feed readers to display these notes as “articles,” i.e., with a title (equal to “No Title”).