# 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 52
# self = https://watcher.sour.is/conv/o2bcfia
@eldersnake What are you using to render your twtxt.txt on https://www.andrewjvpowell.com/twts/ ? It is #picoblog by @hxii or just the Atom feed ?
@darch custom I guess. I'm running sed on the raw twtxt.txt file to convert the tags to Markdown friendly links, saving it to a temporary file and then looping through it line by line and putting the lines through smu (Markdown). This is run inside the mkws SSG by @adi . It's probably not the most efficient code but it works!
@darch custom I guess. I'm running sed on the raw twtxt.txt file to convert the tags to Markdown friendly links, saving it to a temporary file and then looping through it line by line and putting the lines through smu (Markdown). This is run inside the mkws SSG by @adi . It's probably not the most efficient code but it works!
This does mean it's only updated when I push another site update of course, so it's not a live feed. I could Cron that too, but eh, I don't mind synchronizing once or twice a day for now.
This does mean it's only updated when I push another site update of course, so it's not a live feed. I could Cron that too, but eh, I don't mind synchronizing once or twice a day for now.
@darch @eldersnake I guess a better idea would be to just convert the twtxt file to Markdown via an awk script and then run the whole output through smu?
@darch @eldersnake I guess a better idea would be to just convert the twtxt file to Markdown via an awk script and then run the whole output through smu?
@darch @eldersnake I guess a better idea would be to just convert the twtxt file to Markdown via an awk script and then run the whole output through smu?
@adi probably yeah, the main reason I even do the line by line is so I can more effortlessly wrap each line in my HTML container divs.
@adi probably yeah, the main reason I even do the line by line is so I can more effortlessly wrap each line in my HTML container divs.
@eldersnake Ah, I understand, I would probably convert the whole twxt to Markdown in one go via awk if possible and rerun through another awk to add wrapper divs but probably those would be better represented as lis so no need for the wrapping part.
@eldersnake Ah, I understand, I would probably convert the whole twxt to Markdown in one go via awk if possible and rerun through another awk to add wrapper divs but probably those would be better represented as lis so no need for the wrapping part.
@eldersnake Ah, I understand, I would probably convert the whole twxt to Markdown in one go via awk if possible and rerun through another awk to add wrapper divs but probably those would be better represented as lis so no need for the wrapping part.
@adi good point! I might have a go of that today.
@adi good point! I might have a go of that today.
@adi @eldersnake https://pastebin.com/UtGXjG9k. You have the date in the "$1" variable. tail -r is BSD specific, you could use tac or awk also I believe for reversing the lines.
@adi @eldersnake https://pastebin.com/UtGXjG9k. You have the date in the "$1" variable. tail -r is BSD specific, you could use tac or awk also I believe for reversing the lines.
@adi @eldersnake https://pastebin.com/UtGXjG9k. You have the date in the "$1" variable. tail -r is BSD specific, you could use tac or awk also I believe for reversing the lines.
@adi @eldersnake Just run ./twtmd < ./twtxt.txt | smu > t.html
@adi @eldersnake Just run ./twtmd < ./twtxt.txt | smu > t.html
@adi @eldersnake Just run ./twtmd < ./twtxt.txt | smu > t.html
@adi @eldersnake Just run ./twtmd < ./twtxt.txt | smu > t.html
@adi Legend! Works great, thanks man. awk still isn't my strong area, so that helps. It's definitely that bit quicker to generate as you would expect too, being more efficient. You wouldn't also have some clues how to format the date? AFAIK you can't run the date command inside awk?
@adi Legend! Works great, thanks man. awk still isn't my strong area, so that helps. It's definitely that bit quicker to generate as you would expect too, being more efficient. You wouldn't also have some clues how to format the date? AFAIK you can't run the date command inside awk?
@adi Just realised a basic gsub on the date string stripping the 'T' and 'Z' does a respectable enough output.
@adi Just realised a basic gsub on the date string stripping the 'T' and 'Z' does a respectable enough output.
@eldersnake You can run date inside awk http://onetipperday.sterding.com/2015/08/use-getline-to-capture-system-command.html
@eldersnake You can run date inside awk http://onetipperday.sterding.com/2015/08/use-getline-to-capture-system-command.html
@eldersnake You can run date inside awk http://onetipperday.sterding.com/2015/08/use-getline-to-capture-system-command.html
@adi Aha! Interesting, thank you. Programs like awk continue to surprise me (in a good way).
@adi Aha! Interesting, thank you. Programs like awk continue to surprise me (in a good way).
@eldersnake Can effortlessness be more or less? 😛
@eldersnake Can effortlessness be more or less? 😛
@eldersnake Can effortlessness be more or less? 😛
@adi In terms of wrapping them in HTML it's no more effort really, plus it's just a lot more efficient than calling smu a billion times (slight exaggeration) line by line.
@adi In terms of wrapping them in HTML it's no more effort really, plus it's just a lot more efficient than calling smu a billion times (slight exaggeration) line by line.
@adi What's your opinion on pagination? I was able to implement a rudimentary pagination on my twts page by using split on the twtxt.txt and a nested call to pp, but I dunno, I don't love it. Do people generally not mind loading a longer HTML page if its still mostly just text?
@adi What's your opinion on pagination? I was able to implement a rudimentary pagination on my twts page by using split on the twtxt.txt and a nested call to pp, but I dunno, I don't love it. Do people generally not mind loading a longer HTML page if its still mostly just text?
@eldersnake The _problem_ in my opinion is that it can get a bit too long. you get to a point where you start to loose interest. Maybe Latest N is better in your case? I mean what's your upper bound here? You can't just keep going infinium 🤣
@eldersnake The _problem_ in my opinion is that it can get a bit too long. you get to a point where you start to loose interest. Maybe Latest N is better in your case? I mean what's your upper bound here? You can't just keep going infinium 🤣
@eldersnake The _problem_ in my opinion is that it can get a bit too long. you get to a point where you start to loose interest. Maybe Latest N is better in your case? I mean what's your upper bound here? You can't just keep going infinium 🤣
@prologic Yeah exactly kind of what I'm thinking, a typical twtxt.txt file will end up being pretty long and a HTML page with an ever decreasing scrollbar size might not be a good thing lol xD Yeah latest *N* is probably the *simplest* solution...
@prologic Yeah exactly kind of what I'm thinking, a typical twtxt.txt file will end up being pretty long and a HTML page with an ever decreasing scrollbar size might not be a good thing lol xD Yeah latest *N* is probably the *simplest* solution...
@eldersnake It wasn't a technical question, it was philosophical regarding effortlessness. By definition an action is effortless no more no less.
@eldersnake It wasn't a technical question, it was philosophical regarding effortlessness. By definition an action is effortless no more no less.
@eldersnake It wasn't a technical question, it was philosophical regarding effortlessness. By definition an action is effortless no more no less.
@adi @eldersnake Agree with _latest_ N.
@adi @eldersnake Agree with _latest_ N.
@adi @eldersnake Agree with _latest_ N.
@adi @eldersnake As for real pagination a combination of head and tail I guess?
@adi @eldersnake As for real pagination a combination of head and tail I guess?
@adi @eldersnake As for real pagination a combination of head and tail I guess?