Last active
January 27, 2024 17:18
-
-
Save shmup/d644711dc4ad4654a4c5b8b6563ec672 to your computer and use it in GitHub Desktop.
quickly run any of the breathing moos on moolist.com with tt++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# quickly run any of the breathing moos on moolist.com with tt++ | |
# requires: curl, fzy (or fzf but update script), tt++ | |
# https://asciinema.org/a/633014 | |
set -euo pipefail | |
html_content=$(curl -s 'https://moolist.com/all.php') | |
telnet_uris=$( | |
echo "$html_content" | | |
grep 'Up' | # breathing moos only | |
grep -oP 'telnet://[^<]+' | | |
sed "s/'>.*//" | | |
sed 's/telnet:\/\///' | | |
sort | | |
uniq | |
) | |
selected_uri=$(echo "$telnet_uris" | fzy -l 50) | |
[[ -z $selected_uri ]] && exit 0 | |
host=$(echo "${selected_uri}" | awk -F':' '{print $1}') | |
port=$(echo "${selected_uri}" | awk -F':' '{print $2}') | |
tt++ -e "#session moo {$host} {$port}" | |
$0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was 1-upped in the best way by @scandum
Here is native tt++ implementation: