# 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 22
# self = https://watcher.sour.is/conv/iphs6mq
Such a bad idea Please stop writing shell scripts !
@adi writing Perl code ;P
Stopping writing shell scripts 😛 Regarding Perl, I don't believe I have ever written more than 10-15 lines of Perl code in my life.
@adi I’m having more and more mixed feelings about shell scripts myself. I used to love them (heck, my Gopher server is a Bash script), but they have so many pitfalls and especially working in teams can be a real nightmare. 🤔
@adi I’m having more and more mixed feelings about shell scripts myself. I used to love them (heck, my Gopher server is a Bash script), but they have so many pitfalls and especially working in teams can be a real nightmare. 🤔
@adi I’m having more and more mixed feelings about shell scripts myself. I used to love them (heck, my Gopher server is a Bash script), but they have so many pitfalls and especially working in teams can be a real nightmare. 🤔
Source to Gopher server?
Having a Gopher server in shell sounds weird, maybe C or Go would be better for that, but for small, simple, UNIX automations nothing beats shell. Keywords are small and simple. If things get complex, either create a new script or switch languages.
Having a Gopher server in shell sounds weird, mâine C or Go would be better for that, but for small, simple, UNIX automations nothing beats shell. Keywords are small and simple. If things get complex, either create a new script or switch languages.
I'm insisting on small and simple and "building afresh" as to not complicate.
@adi https://uninformativ.de/git/sgopherd Yeah, it’s kind of weird. Let’s just say, I wouldn’t do it this way again.
@adi https://uninformativ.de/git/sgopherd Yeah, it’s kind of weird. Let’s just say, I wouldn’t do it this way again.
@adi https://uninformativ.de/git/sgopherd Yeah, it’s kind of weird. Let’s just say, I wouldn’t do it this way again.
@movq WOW I hesitate between being admirative or thinking your crazy.
@movq Yeah, wrong tool for the job, just rewrite in C or Go. Not shells' fault.
@movq Yeah, wrong tool for the job, just rewrite in C or Go.
Problem: Sometimes you don't have anything else than Bash, Perl, or Python 2.6. Sad to say, but this is it in most companies. They run old hardware and old software. Maybe because of some weird security policies or just because they have closed systems. And sometimes you are forced to write PowerShell 2.0 Scripts because no other PowerShell version is available ... :(
@movq i'm smiling at this one. gets the job done.
@adi I wasn’t really using sgopherd as an example for “shell is bad”. I brought it up, because I wrote sgopherd in a time where I was a hardcore fanboy of shell scripts. :-) If anything, this is an example of how far you can go with shell. It’s a bit weird/unusual, yes, but at the end of the day, it’s not a particularly complicated program: It just reads a short string from stdin and then looks up and prints the requested file to stdout. It’s basically a bridge between inetd and cat (plus a little bit of magic).

sgopherd doesn’t implement any “server” functionality. That’s the job of inetd. Implementing a full server with stuff like socket handling *as a shell script* would indeed be inappropriate, if you ask me. But that’s not what this is.

Also, in the case of sgopherd, it hardly matters to me if it’s shell or Rust or whatever. It’s mostly a personal toy project of mine, so, meh, whatever. If I were to rewrite it *today*, I wouldn’t use shell again, but it’s not a complete disaster that demands a rewrite immediately, either.

I should probably write up a short blog post or something about the reasons where I *don’t* like shell scripts. 🤔*
@adi I wasn’t really using sgopherd as an example for “shell is bad”. I brought it up, because I wrote sgopherd in a time where I was a hardcore fanboy of shell scripts. :-) If anything, this is an example of how far you can go with shell. It’s a bit weird/unusual, yes, but at the end of the day, it’s not a particularly complicated program: It just reads a short string from stdin and then looks up and prints the requested file to stdout. It’s basically a bridge between inetd and cat (plus a little bit of magic).

sgopherd doesn’t implement any “server” functionality. That’s the job of inetd. Implementing a full server with stuff like socket handling *as a shell script* would indeed be inappropriate, if you ask me. But that’s not what this is.

Also, in the case of sgopherd, it hardly matters to me if it’s shell or Rust or whatever. It’s mostly a personal toy project of mine, so, meh, whatever. If I were to rewrite it *today*, I wouldn’t use shell again, but it’s not a complete disaster that demands a rewrite immediately, either.

I should probably write up a short blog post or something about the reasons where I *don’t* like shell scripts. 🤔*
@adi I wasn’t really using sgopherd as an example for “shell is bad”. I brought it up, because I wrote sgopherd in a time where I was a hardcore fanboy of shell scripts. :-) If anything, this is an example of how far you can go with shell. It’s a bit weird/unusual, yes, but at the end of the day, it’s not a particularly complicated program: It just reads a short string from stdin and then looks up and prints the requested file to stdout. It’s basically a bridge between inetd and cat (plus a little bit of magic).

sgopherd doesn’t implement any “server” functionality. That’s the job of inetd. Implementing a full server with stuff like socket handling *as a shell script* would indeed be inappropriate, if you ask me. But that’s not what this is.

Also, in the case of sgopherd, it hardly matters to me if it’s shell or Rust or whatever. It’s mostly a personal toy project of mine, so, meh, whatever. If I were to rewrite it *today*, I wouldn’t use shell again, but it’s not a complete disaster that demands a rewrite immediately, either.

I should probably write up a short blog post or something about the reasons where I *don’t* like shell scripts. 🤔*
@movq Oh, wow. More tests than anything else! I'm happily surprised. I wish my work mates would do that too. ;-)