# 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 13
# self = https://watcher.sour.is/conv/buulkxq
been playing with making fun scripts using charm CLI's gum library :P
one that gets lyrics from an open lyrics database's API and accepts input for artist & song names: https://asciinema.org/a/697860
and one that uses a user-provided last.fm API key to pull what's currently playing or what last played on your account :) https://asciinema.org/a/697874
been playing with making fun scripts using charm CLI's gum library :P
one that gets lyrics from an open lyrics database's API and accepts input for artist & song names: https://asciinema.org/a/697860
and one that uses a user-provided last.fm API key to pull what's currently playing or what last played on your account :) https://asciinema.org/a/697874
@kat definitely a fun way to get better at bash scripting by hand (AKA learn how it works besides the extreme basics i know) and use gum to make them cute too
@kat definitely a fun way to get better at bash scripting by hand (AKA learn how it works besides the extreme basics i know) and use gum to make them cute too
@kat To improve you shell programming skills, I highly recommend to check out shellcheck
: https://github.com/koalaman/shellcheck It points out common errors and gives some suggestions on how to improve the code. Some details in shell scripting are very tricky to get right at first. Even after decades of shell programming, I run into "corner cases" every now and then.
E.g. in getlyr
's line 7 it warns:
echo -e $(gum style --italic --foreground "#f4b8e4" "'$artist', '$song'")
^-- SC2046: Quote this to prevent word splitting.
For more information:
https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt...
Most likely not all that problematic in this application, but it's good to know about this underlying concept. Word splitting is basically splitting tokens on whitespace, this can lead to interesting consequences as illustrated by this little code:
$ echo $(echo "Hello World")
Hello World
$ echo "$(echo "Hello World")"
Hello World
In the first case the shells sees two whitespace-separated tokens or arguments for the echo
command. This basically becomes echo Hello World
. So, echo
joins them by a single space. In the second one it sees one argument for the echo
command, so echo
simply echos this single argument that contains three spaces.
@lyse ahhh thank you so so much!!!! i've heard of shellcheck but haven't checked it out properly - will try it for my scripts :D i really appreciate it
@lyse ahhh thank you so so much!!!! i've heard of shellcheck but haven't checked it out properly - will try it for my scripts :D i really appreciate it