# 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 31
# self = https://watcher.sour.is/conv/k3mizra
@fastidious What's this? πŸ€” What are you up to? 🀣
@fastidious What's this? πŸ€” What are you up to? 🀣
Clients will not be able to fetch this at all πŸ˜‚ yarnd will in fact spit warnings/errors in the logs when it encounters bad feeds (_this being an example_) 🀣
Clients will not be able to fetch this at all πŸ˜‚ yarnd will in fact spit warnings/errors in the logs when it encounters bad feeds (_this being an example_) 🀣
@prologic I am playing with the refactor_twt_options branch. I am afraid that CSS is over my head. I am not giving up yet, but not getting too far.
@prologic
> What’s this? πŸ€” What are you up to?

I have my server spit out that custom error 502 when yarnd is down.
@fastidious Ahh I see πŸ€”
@fastidious Ahh I see πŸ€”
I'd like to see a custom 502 response for /user/.*/twtxt.txt myself with basically a custom feed that behaves like a Twtxt feed πŸ€” This _could_ be interesting πŸ€”
I'd like to see a custom 502 response for /user/.*/twtxt.txt myself with basically a custom feed that behaves like a Twtxt feed πŸ€” This _could_ be interesting πŸ€”
@prologic
> custom 502 response for /user/.*/twtxt.txt myself with basically a custom feed that behaves like a Twtxt feed

It is possible, but reading that made me re-live one of 'Rick and Morty' episodes. 🀣
@fastidious I'd definately be curious how it appears to various clients for sure πŸ‘Œ
@fastidious I'd definately be curious how it appears to various clients for sure πŸ‘Œ
@prologic well, on Caddy, I can simply add this to the Yarnd server declaration:


handle_errors {
               rewrite * /twtxt.txt
               file_server
}


And all errors will show that file. More on Caddy's error handling.
@fastidious Noice! πŸ‘Œ I _wonder_ how I could achieve something similar with Traefik πŸ€” But first I'd need to see if it's even worth doing this, what it looks like to clients, etc. If it turns out to be useful, good one to add to the Wiki me thinks πŸ‘Œ
@fastidious Noice! πŸ‘Œ I _wonder_ how I could achieve something similar with Traefik πŸ€” But first I'd need to see if it's even worth doing this, what it looks like to clients, etc. If it turns out to be useful, good one to add to the Wiki me thinks πŸ‘Œ
this is how I'd achieve a similar result in Traveik. I _might_ explore this a bit later, it would require me to build a lightweight container that services an error page and maybe supports regex patterns to service other types of content like /user/*/twtxt.txt.
this is how I'd achieve a similar result in Traveik. I _might_ explore this a bit later, it would require me to build a lightweight container that services an error page and maybe supports regex patterns to service other types of content like /user/*/twtxt.txt.
@prologic @fastidious Just send 503 Service Unavailable without a body for feeds.
@lyse cool! I shall do that.
Or what do you mean, what it looks like to clients? I reckon clients will only parse the feed when it is served as HTTP 200. So my reasoning is, that if they don't parse it, one doesn't have to bother with creating a valid feed anyways.
I agree with @lyse There could be some confusion if posts appear in people's clients that are not on the master feed. What if the client keeps retrying and keeps getting the dummy feed over the course of several hours? It would clutter people's clients very quickly. This is a perfect use for the standard HTTP status codes, there's no reason to reinvent the wheel.
@lyse True
@lyse True
@mckinley Yeah you’re are right πŸ˜† Just a silly thought experiment πŸ˜‚
@mckinley Yeah you’re are right πŸ˜† Just a silly thought experiment πŸ˜‚
@mckinley The _reason_ for my silly thought experiment btw, was that @fastidious didn't just return a 5xx error when doing an upgrade on his pod, I _believe_ it was _actually_ an error page with a 200 OK which means that my pod (_and all other pods_) would have suddenly seen his feed as "empty". It's for this reason I _think_ the following line of code needs to guard against if len(twts) > 0 ...
@mckinley The _reason_ for my silly thought experiment btw, was that @fastidious didn't just return a 5xx error when doing an upgrade on his pod, I _believe_ it was _actually_ an error page with a 200 OK which means that my pod (_and all other pods_) would have suddenly seen his feed as "empty". It's for this reason I _think_ the following line of code needs to guard against if len(twts) > 0 ...
@prologic Good idea.
@mckinley Agreed πŸ‘Œ
@mckinley Agreed πŸ‘Œ