Creative Problem Solver. Programmer. Bodysurfing. Sometime Comics.
Blogger since 2001.

own yr www rn! #IndieWeb

Autocomplete Results for Search

A site with a lot of content: photos and text, needs good search.

To that end I spent the day adding autocomplete to the site for all the places search exists.

I was unaware that the jQuery UI suite was included and could be queued in WordPress. Or maybe I had forgotten.

wp_enqueue_script('jquery-ui-autocomplete', '', array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position', 'jquery-ui-menu'), '1.12.1');

Anyway one of the niceties I added was a year indicator on the results. The older the post the darker the colors associated with the year. It helps distinguish relevance for something technical for example. I don’t think many of my programming posts more than 15 years old are relevant to anyone. The first search engine I put on this site was called “ht://dig” and it appears not to exist anymore. Even the domain is dead.

Autocomplete may be overkill for this, as I’m not propagating the text to the search field. It’s possible what I really want is just an Ajax based search. For now I’m content with the results.

 

“be the change you wish to see in the indieweb”

Interactivity of personal sites and webmentions” is a terrific piece by Jo on the upsides and nuances of webmentions. The thing it does really well is remind folks of this key thing…that on the #IndieWeb, YOU get to choose how and what you share and how and and if what may come back to you is displayed.

She says:

“be the change you wish to see in the indieweb”

Yes indeed!

A renaissance and rebirth of a social web means human community. With people comes friction. Intentional and unintentional. Human societies contain friction and individuals in that society are responsible for themselves and to be mindful of the needs of the larger community.

As a programmer, I find focusing on the technical aspects of programming: markup, databases, API calls, can lead to missing out on the “social,” the human, the most important part of social software.

I plan to revisit writing about “the ‘net” and the social aspects of living online.

The first writers I think of are ones who have published books: danah boyd, Clay Shirky, Derek Powazek, Gretchen McCulloch and Zeynep Tufekci.There are others.

It’s a quote so good I’m dropping it a second time, as Jo says:

“be the change you wish to see in the indieweb”

How To Print A Web Page, 1997 style.

Our technology choices were so primitive. And here in the 21st century I’ve done a fair amount of HTML to PDF generation. I’ve even created ebooks with them. It was fun to live in a time when things were so unformed.

From comp.infosystems.www.misc, the question thread, from March 20, 1997:

Anyone have a decent way to print a web page? I’d like to get a nice color printout including background images and such.

Printing it from NS or IE leaves out the backgrounds and doing a screen capture results in unsatisfactory output.

Any other ideas?

My answer, from March 21, 1997:

I've done this - but it requires some work:
1. Load up the page in your browser how you like it.
2. Do a screen capture
3. Crop the non essential parts of the screen capture.
4. Print out the result.
5. Done.
NOW! I hear you saying, "BUT JOE, THESE PAGES ARE TOO LONG?!?!?"
Chill monkeyboy ... listen up...
1. Load up the page in your browser how you like it.
2. Do a screen capture of the top part...
Scroll down...
Do another screen capture...
Scroll down...
Do another screen capture...
(you see where I'm going here).
Repeat until done.
Add honey glaze (DOH! that's my girlfriend's ham recipe!)
2a.Load up your favorite paint program (like Photoshop or some wannabe Photoshop), open each image and tile/splice them into one image)
3. Crop the non essential parts of the screen capture.
4. Print out the result.
You should be done now.
That's how I've done it, but there may be other opinions.
The issue of HTML --> PS to relaibly print from the web is still open, as far as I know.

Have I ever posted on Leap Day?

I genuinely don’t know. There have been 5 since I started the site. 2004. 2008. 2012. 2016. 2020.

And today is Leap Day and I already posted today.

Have I ever posted on Leap Day?

Let’s write a WordPress shortcode and find out!

add_shortcode('on_this_day',
/**
 * Expect [on_this_day month="February" day="29"]
 * Both month and day are required
 * And return an ordered list of posts from that day grouped by year
 * @param $atts
 * @param $content
 * @param $tag
 */ function ( $atts, $content, $tag ) {
    $atts = shortcode_atts([
       'month' => '',
       'day' => '',
    ], $atts, $tag);
    $month = $atts['month'];
    $day = $atts['day'];
    if (empty($month) || empty($day)) {
       return;
    }
    // if month is non-numeric, convert it to a number
    if (!is_numeric($month)) {
       $month = date('m', strtotime($month));
    }
    // and the same with the day...
    if (!is_numeric($day)) {
       $day = date('d', strtotime($day));
    }
    $args = [
       'post_type' => 'post',
       'post_status' => 'publish',
       'posts_per_page' => -1,
       'date_query' => [
          'month' => $month,
          'day' => $day,
       ],
       'orderby' => 'date',
       'order' => 'ASC',
    ];
    $posts = get_posts($args);
    $posts_by_year = [];
    foreach ($posts as $post) {
       $year = get_the_date('Y', $post);
       $posts_by_year[$year][] = $post;
    }
    $output = '';
    foreach ($posts_by_year as $year => $year_posts) {
       $output .= sprintf('<dt>%s</dt>', $year);
       foreach ($year_posts as $post) {
          $output .= sprintf('<dd><a href="%s">%s</a></dd>',
             get_permalink($post->ID),
             get_the_title($post)
          );
       }
    }
    return '<dl class="on-this-day" >' . $output . '</dl>';

});

I add that code to my theme. And now, when I add to a page or post with a shortcode that specifies a month and a day, like so…

[on_this_day month="February" day="29"]

…I get output like this:

2008
Mr. Bird
2024
Gravatar WordPress verification for self-hosted WordPress
Have I ever posted on Leap Day?

So before today, I posted once on 29 February. In 2008. I’m surprised! That was fun.


Since it’s Leap Day it’s also Delete Your Drafts Day. I deleted 3 lingering drafts I will not miss. I turned 1 into a post which will publish tomorrow. So there are 4 drafts, which is good enough for me. I wrote about my odd schedule for checking on drafts last week if you care to read it.


Happy Leap Day!

Unrelated goofiness: ‘30 Rock’ Co-Creator Tells The Story Behind Leap Day Williams Watch the weirdness and check it out on Nestflix.


P.S. is there a WordPress shortcode you wish existed? What would it be?

Gravatar WordPress verification for self-hosted WordPress

Gravatar is doing something interesting and ambitious with their icon site. For a long time it’s been the place you can update a pictorial avatar in one place and have it propagate to things like GitHub, Slack and others. Now they are allowing you to “verify” links associated with that account by doing authentication flows with individual sites such as Instagram, Mastodon, Twitter, GitHub.

Being owned by Automattic, it has the capability to directly verify WordPress.com hosted blogs, but it also can do the verification against self-hosted WordPress (WordPress dot org) instances:

Other WordPress site

To make your association with the site, their instructions state:

For verifying your WordPress site, you need to add on your site a link to your Gravatar profile. This allows us to validate that you have access to your WordPress site. Please follow these steps below:

Go to your WordPress site and paste the embed code above into the editor of any post or page of your site. The code will create an invisible Gutenberg block that will help us to validate your site. (You can delete this block later after this verification process is completed.)

The code they offer looks like this:

<!-- wp:social-links --><ul class="wp-block-social-links"><!-- wp:social-link {"url":"https://gravatar.com/artlung","service":"chain","label":"test","rel":"me"} /--></ul><!-- /wp:social-links -->

As I don’t use the Gutenberg block editor I didn’t like the idea of adding a Gutenberg chunk to my site, but adding such a chunk to a post or page would work. It’s the filter the_content that runs the code inside them even if you use Classic Editor.

Rather than adding the code to a page, instead I added a bit of code to my own hand-rolled theme’s footer.php file. That looks like this:

<?php
$gravatar_rel_me_verifier = '<!-- wp:social-links --><ul class="wp-block-social-links"><!-- wp:social-link {"url":"https://gravatar.com/artlung","service":"chain","label":"test","rel":"me"} /--></ul><!-- /wp:social-links -->';
echo apply_filters('the_content', $gravatar_rel_me_verifier);
?>

Note that if you use a theme that gets updates from WordPress.org this code edit will be clobbered. If you want the change to be permanent you would do that with a child theme of the theme you use, copying whatever code the theme uses for the footer and making the edit.

Digital Gardens

I attended the Homebrew Website Club Europe this morning (evening in the UK and Europe). These Zoom calls are always an excellent opportunity to hear folks ideas, thoughts, and ambitions.

Jo is often on the HWC meetings and her site dead.garden uses the .garden top level domain extension. Her website is a kind of digital garden: her art and ideas and things she watched and pages she liked.

In the meeting today the name Maggie Appleton came up (I think maybe by James?). I had no idea that the term “digital garden” has a rich history. (It feels great to learn new history about the internet. I feel happy that people are thinking deeply about how we use these digital spaces). Maggie Appleton wrote an extensive backgrounder: “A Brief History & Ethos of the Digital Garden” 3 years ago. Charmingly the way the piece is attributed is “Planted 3 years ago.” Appleton’s description of a “digital garden” is as…

a collection of evolving ideas that aren’t strictly organised by their publication date. They’re inherently exploratory – notes are linked through contextual associations. They aren’t refined or complete – notes are published as half-finished thoughts that will grow and evolve over time. They’re less rigid, less performative, and less perfect than the personal websites we’re used to seeing.

She is not the originator of the term. For that, she credits Mark Bernstein.

Mark Bernstein’s 1998 essay Hypertext Gardens appears to be the first recorded mention of the term. Mark was part of the early hypertext crowd – the developers figuring out how to arrange and present this new medium.

That presentation: Hypertext Gardens: Delightful Vistas is great, this sentence–(from 1998!)–stood out to me:

Today’s Web designers are taught to avoid irregularity, but in a hypertext, as in a garden, it is the artful combination of regularity and irregularity that awakens interest and maintains attention.

I love that.

The short presentation is filled with metaphors for experience that resonate for me. I love delight and serendipity.

The whole presentation is a kind of meditation. About a notion of a gentle stroll through a garden. When you take your time you might notice things you never noticed before. I have a comic “Was that there before?” on that theme. I’m a big fan of garden as metaphor. I’ve been thinking in terms of human relationships along those lines for several years. I wrote about that recently in Al & My Friendship-as-Garden Theory.

I am glad to learn more history on the term digital garden.


In looking more at gardens I discovered that in August last year there was an IndieWeb Carnival last year on the topic. So… What’s an IndieWeb Carnival?

Each month, the carnival has a different host. At the beginning of the month, the host comes up with the topic, and posts it both on their website and here. Then, other people post their submissions and alert the host about them. At the end of the month, the host collects all the received submissions and posts an overview of it.

Source: IndieWeb Carnival, on the IndieWeb Wiki.


Mark Sutherland hosted the IndieWeb Carnival for August 2023 with the theme of Gardening.

I found 5 participating posts from that IndieWeb Carnival by searching. There may be more out there but if so they may not have been “spidered” by search engines either inadvertently or intentionally. (Jo’s post on Search Engine Hostility is worth your time.)

Mistrust-Based Technology Choices

The latest news in tech has been excitement about reports that Automattic has the intent to sell Tumblr and WordPress.com website data (read that as “your blog posts”) to a Large Language Model-based company for big dollars. Putting your stuff on a companies servers usually means they get to do what they want to with them, including make money selling it even if they don’t cut you in on the sale. This got me thinking about how it is I don’t have much in the way of content on those servers, and what I do have there I don’t feel strongly about whether it gets sold. I do use WordPress – the dot org version, which does not flow through and is not subject to the servers that Automattic runs. That’s my own view, but it also got me thinking of why I have not gone all-in on services writing on servers that host my own stuff and only appear there.


I chose blogger.com to start blogging back in 2001. I was late to the blogging world but I had a fine list of blogs I checked regularly and it appealed to me, to write things regularly.

Blogger gave me two choices as to where I could send those posts. I could choose a subdomain of blogger.com or maybe even set up a whole new domain and blogger would be the web host for it. Or I could do a trickier thing–using FTP to send the blog files somewhere when I published.

By that point I had used both AOL and earthlink’s hosting (Yes, ISPs used to give you web space! Do any do that anymore? I’m pretty sure Spectrum and Verizon don’t give me any web hosting with my cable modem and cell phone). And I’d had troubles with each. Sometimes it was flaky, or I hit limits. Using someone else’s server was inherently limited.

I chose the trickier thing out of an instinct: these were my words. They ought to live on my server. And I will be less limited by what I want to do with them if I have it on my host.

FTP publishing meant that sometimes I could not post because of downtime. As the blog grew it took longer to publish. Each time I published it would have to send all those individual HTML files to my server, and sometimes that took more than just a few seconds.

But it worked. And I put enough trust in blogger to use their fancy user interface and editing tools, but not enough to serve the content.

And it’s turned out that for me, making decisions based on mistrust has been the right choice. When I don’t have a thing as files on a thumb drive I don’t trust it. So how do I get that backup and keep it up.

Part of why I am involved with #IndieWeb things is my strong belief that people should own their stuff. And for me, that means if I put something up on someone else’s website I want a copy for myself at some point. In the case of this website, for example, anything I put on Instagram I pull back into my personal website.

That’s mistrust.

And I just remembered that I did the same thing with my del.icio.us bookmarks. That bookmarking site was sold, sucked, and died, and was exhumed more or less. Kind of a zombie case. Even if something goes on living, it might never be what it once was.

How does a site death happen? Products come out and the excitement is so strong. “LOOK AT THIS AWESOME NEW WEBSITE! USE IT! IT’S FREE! IT’S CHEAP! IT’S A FLOOR WAX! IT’S A DESSERT TOPPING!” Then the money runs out. Or the investors and owners cash out and sell the product or the whole. Or maybe they just get beaten in the marketplace. They don’t view it as their job to keep things online when they run out of money. Shimmer will go away. In a college marketing class I learned of the “product lifecycle:” introduction, growth, maturity, and decline. Teenage me was a natural contrarian, so I couldn’t help but think of Coca-Cola and McDonald’s. But exceptional products are exceptional. Not many companies, let alone products, live longer than an average human lifespan.

When a product I use dies I tend to put the email text as a blog post on this website. The shutdown tag includes mentions of Google Reader. Google Plus. tvtag. This is My Jam. And from 2008 here’s Yahoo! Mash Beta – which was a social media site I don’t remember. The IndieWeb website has a page called Site Deaths which documents the history of the phenomenon far better. It’s pretty sad.

If you find yourself thinking–maybe this time–this product–will be different. Don’t count on it. And it’s not new to this or even the last century: The Dead Media Project a list of dead media that goes back millennia.

In the long view, mistrust is a regrettably useful strategy to use when making technology choices.


Further reading: [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Another day, another…

This* is why I pay money to a registrar for my own domain and pay money to a hosting service for a web server and application server and databases and use open software that makes my data portable to myself as much as is practical.

* Different reason each week.

( originally published at xoxo.zone/@artlung/112005780524682934 )

2023 Top Albums

I like this image, from my last.fm account, from 2023. I forgot I grabbed this image and saved it. But includes many of my favorites: Zappa, Kitty, Lawrence, De La Soul, 2-Tone Ska, Roxy Music and things like Metric and Selena Gomez and Tessa Violet and an artist I never would have appreciated until I got older: Blossom Dearie.

People share their “wrap ups” from services like Spotify or Apple and they are so ephemeral. I’m a fan of keeping images of that and putting them on my blog so I can look later and remember the music that maybe a few laters I forgot worked for me.

I’m pretty sure Missing Persons is one I came back to, looking at old lists from old years after not listening to them for a long while.

Dark skies afternoon