# 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 35
# self = https://watcher.sour.is/conv/cqzsjsq
This is how I store my blog posts:


$ ls -1
2021-02-28 15:34:42 Welcome
2021-02-28 15:35:21 How to add a navigation menu
2021-02-28 15:35:39 How to add custom titles
interesting... spaces and everything. I can see this would be easy to parse.
@eldersnake \n\n
\n<h1>Blog</h1>\n<h2>News and a collection of tips and tricks for <code>mkws</code></h2>\n<ol id=i>\n#!\nfind p -mindepth 1 | sort -r | while read -r f\ndo\ntest "${f##*.}" == "html" && continue;\nt=$(echo "${f##*/}" | cut -c21-)\n#!\n<li>\n<h2><a href=p/$(echo "$t" | pe).html>$t</a></h2>\n<time>$(echo "${f##*/}" | cut -c1-10 )</time>\n</li>\n#!\ndone\n#!\n</ol>\n
\n\nI have yet to come up with a solution for the description meta but I might formulate the first paragraph to be a good description, I'd rather not use any front matter.
@eldersnake \n\n
\n<h1>Blog</h1>\n<h2>News and a collection of tips and tricks for <code>mkws</code></h2>\n<ol id=i>\n#!\nfind p -mindepth 1 | sort -r | while read -r f\ndo\ntest "${f##*.}" == "html" && continue;\nt=$(echo "${f##*/}" | cut -c21-)\n#!\n<li>\n<h2><a href=p/$(echo "$t" | pe).html>$t</a></h2>\n<time>$(echo "${f##*/}" | cut -c1-10 )</time>\n</li>\n#!\ndone\n#!\n</ol>\n
\n\nI have yet to come up with a solution for the description meta but I might formulate the first paragraph to be a good description, I'd rather not use any front matter.
@eldersnake


<h1>Blog</h1>
<h2>News and a collection of tips and tricks for <code>mkws</code></h2>
<ol id=i>
#!
find p -mindepth 1 | sort -r | while read -r f
do
test "${f##*.}" == "html" && continue;
t=$(echo "${f##*/}" | cut -c21-)
#!
<li>
<h2><a href=p/$(echo "$t" | pe).html>$t</a></h2>
<time>$(echo "${f##*/}" | cut -c1-10 )</time>
</li>
#!
done
#!
</ol>


I have yet to come up with a solution for the description meta but I might formulate the first paragraph to be a good description, I'd rather not use any front matter.
@adi @eldersnake I get the updated field with lmt https://mkws.sh/lts.html wherever it's a good idea to have. (sitemap, atom feed)
@adi @eldersnake I get the updated field with lmt https://mkws.sh/lts.html wherever it's a good idea to have. (sitemap, atom feed)
@adi yeah I prefer not using front matter too, even to the point where I used the external meta files as you know. Which isn't perfect but I preferred that than adding an extra thing to separate and process in the one file.
@eldersnake But you can parse either the filename or the file itself to get titles for instance without a meta file and maybe use my first paragraph as description suggestion?
@eldersnake But you can parse either the filename or the file itself to get titles for instance without a meta file and maybe use my first paragraph as description suggestion?
@adi Yeah not a bad idea. Admittedly sometimes I make my meta descriptions a little bit personalised and not really anything to do with the first paragraph, but your way is probably more *proper*.
@eldersnake I'm not that good at writing so not sure if good or bad idea, not sure if the first paragraph would fit as a description and also read "normally" within the text.
@eldersnake I'm not that good at writing so not sure if good or bad idea, not sure if the first paragraph would fit as a description and also read "normally" within the text.
@adi It can do if you make the writing structure a little more rigid and deliberately make the first paragraph as a kind of intro to the article, etc. It's pretty much what happens on my site The Linux Rain.
@adi Speaking of that site, it currently runs on the flat file PHP Kirby CMS but one day I hope to convert it over to something like mkws.sh, which should be interesting. The current CMS makes liberal use of front matter etc.
@eldersnake

> I hope to convert it over to something like mkws.sh

And what's preventing you?
@eldersnake \n\n> I hope to convert it over to something like mkws.sh\n\nAnd what's preventing you?
@eldersnake \n\n> I hope to convert it over to something like mkws.sh\n\nAnd what's preventing you?
@adi @eldersnake I guess the _correct_ name is mkws the site's name is mkws.sh.
@adi @eldersnake I guess the _correct_ name is mkws the site's name is mkws.sh.
@adi @eldersnake You could use https://forestry.io/ as a frontend. I personally don't believe I would do it but it fits a blog well.
@adi @eldersnake You could use https://forestry.io/ as a frontend. I personally don't believe I would do it but it fits a blog well.
@adi True, on the name.
As for what's preventing me, just time and being prepared to switch a few things up. The existing site has a few things going on with the current CMS like auto-generating thumbnails, image resizing, a search function plus about 217 articles to convert over.
@adi True, on the name.\nAs for what's preventing me, just time and being prepared to switch a few things up. The existing site has a few things going on with the current CMS like auto-generating thumbnails, image resizing, a search function plus about 217 articles to convert over.
@eldersnake What's the format of the articles? Markdown?
@eldersnake What's the format of the articles? Markdown?
@adi @eldersnake I wonder how mkws would handle 217 articles. 😀
@adi @eldersnake I wonder how mkws would handle 217 articles. 😀
@adi Markdown with some sort of custom front matter. Not quite YAML but in that style.
@adi I actually think mkws would handle that many articles quite well, as long as no inefficient loops are used like I did with my twtxt.txt parsing originally.
@eldersnake Yeah, that awk script is a thing of beauty. 😁
@eldersnake Yeah, that awk script is a thing of beauty. 😁
@eldersnake @adi Take a look at https://imagemagick.org/script/command-line-processing.php for image processing.
@eldersnake @adi Take a look at https://imagemagick.org/script/command-line-processing.php for image processing.
@adi Awesome!