General note: This site’s appearance, configuration, hosting, and other basic considerations will change over time. As a result, certain content on this page could be at variance with what you’re currently seeing on the site, but the two were consistent when this post originally appeared.
Note: This post also appears on dev.to.
getJSON feature just as useful as the
node-fetch on which the aforementioned JS relied to grab data from webmention.io.
In a short time, I’d ditched the idea of patching up the 2020 solution and, instead, started building a completely new one of my own which would use
getJSON to work with the webmention.io API.1
node_modules folders I’d had to add just yesterday due to the dependencies on which the earlier, JS-based method relied. I’m no JS-hating purist but, hey, when you don’t need all the extra weight, why keep it in the repo?
When I have the code somewhat DRY-er, I’ll write about it.2 In the meantime, I’ve left the following comment within the
webmentions-pipes) partial template I’m using to suck all this into each applicable post, just in case the curious happen to find that partial on the site repo:
Apologies for the ugliness of the following.
First, I'll make it work; then I'll **try**,
at least within the limits of Go and Hugo,
to make it a bit DRY-er at the very least.
Fortunately, both Go and Hugo are so fast,
I don't pay a (real) penalty for this spaghetti.
But I **do** want to do better. Trust me, friends.
And, yes, there are some unused vars in here.
Some are for testing only; some are yet to be used.
For now, I’ll just feel fortunate if I don’t end up being the subject of one of those Jurassic Park memes about being so preoccupied with whether I could do this, I failed to consider whether I should — but, truth be known, right now I do feel pretty good about it all. Any time I can get Hugo’s funky templating to do something a little out of the ordinary, I consider it a victory. I can only hope it doesn’t end up being the Pyrrhic kind.
Oh, and if you do happen to check out that code in my repo: I repeat that it’s very much a work in progress, and request that you not judge it too harshly.
It would be funny if certain guys from my final workplace — who, three years ago, laboriously helped me through my first-ever attempts at using JS to extract data from remote sites — should happen to read this. I just hope they’re not eating or drinking anything when they do; I’d hate to be responsible for a choking incident or, at the very least, a splattered phone screen. ↩︎