# 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
@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. đ¤
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.
@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. ;-)