25/01/2021

2021/01/25#p1
0 comments: click to read or leave your own

Liked: Just One Thing, 50 of 101 - Nicholas Bate...

"Writing takes you out of your bunker, allows you to escape lockdown and is entirely private to you."

So true. It's been the same with coding over the past couple of weeks.

Most of my writing is public in one form or another. The journal is updated every day (the streak is up to 41 before today) but even some of that gets reworked on the blog. Still, this is my space on the web and even though it can be seen by others it feels mostly private.

Others just overhear me talking to myself.

cancel media
Leave a reply



Cancel comment

You can also:

Reply by email Reply by email Send a webmention Send a Webmention

2021/01/25#p2
1 comment: click to read or leave your own

In reply to: 🏔Tanzawa...

For example a "like" doesn't necessarily have an author name, just a url. Or even no author at all. How do I display these? Do I just not display them?

All pages sending webmentions should include author details, if they don't then the site's microformats aren't correctly set up. The liked URL should be marked with 'u-like-of' by the sender and detected as 'like-of' when checking them.

If they are detected as a like but with no other details perhaps a counter could be used but I personally wouldn't display them as it is getting away from the cross-site communication ideal of the indieweb.

cancel media
avatar
James Van Dyne says:Reply to James Van Dyne

Thanks - that's a good point about like's. I mostly raised the issue as one of the test webmentions didn't include an author name, just a url in the author dictionary. Displaying it like "example.com liked this post" would be awkward, so yes, I think just not displaying malformed webmentions is best.

Leave a reply



Cancel comment

You can also:

Reply by email Reply by email Send a webmention Send a Webmention

2021/01/25#p3
0 comments: click to read or leave your own

One thing I'd looked at adding (but was desperately trying to over-engineer) was support for fragmentions: linking to and highlighting specific sections of a page.

I remembered that I had written my own script in place of the WordPress plugin originally being used so repurposed this with a bit of an update:

function fragmention() {
  var loc = location.href;
  var locIndex = loc.indexOf("##");

  if (locIndex != -1) {
    var hash = loc.substring(locIndex+2).toLowerCase();
  }

  while (hash.indexOf('+') != -1) {
    hash = hash.replace("+", " ");
  }

  var pTags = document.getElementsByTagName("p");

  for (var p=0; p<pTags.length; p++) {
    var pContent = pTags[p].innerHTML.toLowerCase();

    if (pContent.indexOf(hash) != -1) {
      pTags[p].setAttribute("fragmention", "");
      pTags[p].scrollIntoView();
      break;
    }
  }
}
cancel media
Leave a reply



Cancel comment

You can also:

Reply by email Reply by email Send a webmention Send a Webmention

Colin Walker Colin Walker colin@colinwalker.blog