# I am the Watcher. I am your guide through this vast new twtiverse.
#
# Usage:
# https://watcher.sour.is/api/plain/users View list of users and latest twt date.
# https://watcher.sour.is/api/plain/twt View all twts.
# https://watcher.sour.is/api/plain/mentions?uri=:uri View all mentions for uri.
# https://watcher.sour.is/api/plain/conv/:hash View all twts for a conversation subject.
#
# Options:
# uri Filter to show a specific users twts.
# offset Start index for quey.
# limit Count of items to return (going back in time).
#
# twt range = 1 25
# self = https://watcher.sour.is/conv/golikrq
I managed to make a template for pp
that produces an HTML list of twts for a given twtxt file, similar to the way I have it on my website. It even turns HTTP URLs into hyperlinks. It definitely needs some work, but I think I've reached the limit of POSIX sh. I don't know of any way to compare dates or change the format of a timestamp without GNU date
. rev
isn't a POSIX utility either so I can't have reverse chronological order without doing some awk
sorcery or something.
@mckinley I realized I had more to say than I thought and, rather than make a chain of twts, I made a blog post instead. Here's a screenshot what the template makes when it's fed my twtxt feed. I'm going to bed, man.
@mckinley I realized I had more to say than I thought and, rather than make a chain of twts, I made a blog post instead. Here's a screenshot what the template makes when it's fed my twtxt feed. I'm going to bed, man.
@adi Thank you, that looks to be almost exactly what I'm looking for. I'll take a closer look later.
@adi Thank you, that looks to be almost exactly what I'm looking for. I'll take a closer look later.
@mckinley_tt So I just learned that tac
is Linux-specific. And ISO 8601 and RFC 3339 formatted timestamps should be easily sortable with sort
(which hopefully is POSIX-compliant). Or where is the matter there?
@mckinley @lyse Right, tac
is the one that reverses lines. Apologies, I always get the two mixed up. What I want to do is automate the HTMLized twtxt pages on my website. I'll need to remove comments, sort the feed chronologically which can definitely be done with sort
, and then separate the feed into three month periods. Then I'll pass that three month chunk into pp
which will use the template to generate HTML. I'll need dateutils or something similar to separate the feed into blocks as well as changing the date format to something more readable for the HTML.
@mckinley @lyse Right, tac
is the one that reverses lines. Apologies, I always get the two mixed up. What I want to do is automate the HTMLized twtxt pages on my website. I'll need to remove comments, sort the feed chronologically which can definitely be done with sort
, and then separate the feed into three month periods. Then I'll pass that three month chunk into pp
which will use the template to generate HTML. I'll need dateutils or something similar to separate the feed into blocks as well as changing the date format to something more readable for the HTML.
@mckinley I didn't know about rev
, pretty cool. :-) Ahhh, the quarterly grouping, alright! Some things are just much easier done in languages like Python. However, trying to stick to POSIX shells is always a good challenge. ;-) One addition to sort
: That of course only works if the timezones are not all over the place. But for a personal twtxt feed that should be no problem.
@lyse There is absolutely no question that this is not a job for a shell script. I've gone this far out of a want to use pp
for something useful but now I don't think it's possible to properly escape backslashes in twts without the use of temporary files. I'm thinking this one might have to be put in the folder of purgatory with the rest.
@lyse There is absolutely no question that this is not a job for a shell script. I've gone this far out of a want to use pp
for something useful but now I don't think it's possible to properly escape backslashes in twts without the use of temporary files. I'm thinking this one might have to be put in the folder of purgatory with the rest.
@adi Nice! Didn't know tail
had an -r
option.
@adi Yes, that's correct.
@adi Yes, that's correct.