Shortly before Indie Web Camp, I got the idea to refactor neonblog as a feed reader for my own posts, so I could reuse the same code to render webmentions, reply contexts, and feeds. I didn't have external feeds working yet, but contributed parts of that code to the demo.
Got an #indieweb feed reader running: http://notenoughneon.com/feed.php Its still pretty buggy.
8 replies
Testing POSSE 2, plz ignore.
2 replies
Testing POSSE, plz ignore.
2 replies
Having to wear a scarf in 90 degree weather because of office air conditioning.
New development: the neighbors got a dog. He's a barker.
2 replies

Generate relative timestamps

Here's a way to generate short relative timestamps like "10m", "2d", "6 Jul". This jQuery code rewrites the content of time tags found on a page, using the value of the datetime property. By leaving static timestamp text in the tag, you can also retain backwards compatibility with non javascript clients.

$("time").each(function() {
    var month = ["Jan","Feb","Mar","Apr","May","Jun",
                 "Jul","Aug","Sep","Oct","Nov","Dec"];
    var dt = new Date($(this).attr("datetime"));
    var delta = $.now() - dt.getTime();
    if (delta < 1000*60*60) {
        $(this).text(Math.floor(Math.max(0,delta/(1000*60))) + "m");
    } else if (delta < 1000*60*60*24) {
        $(this).text(Math.floor(delta/(1000*60*60)) + "h");
    } else if (delta < 1000*60*60*24*30) {
        $(this).text(Math.floor(delta/(1000*60*60*24)) + "d");
    } else if (delta < 1000*60*60*24*365) {
        $(this).text(dt.getDate() + " " + month[dt.getMonth()]);
    } else {
        $(this).text(dt.getDate() + " " + month[dt.getMonth()]
            + " " + dt.getFullYear());
    }
    return true;
});
Testing POSSE via brid.gy
Anyone know who made these lamps at boxer ramen?
Here is a long note that should cause the eliding feature to kick in, adding a link to the original and preserving hashtags. Eliding was the hardest part of implementing POSSE to twitter. #indieweb