Created
May 25, 2021 18:07
-
-
Save haskie-lambda/64e6e4f515369450aac37dba59e639f3 to your computer and use it in GitHub Desktop.
the wise cow and some other wise entities spreading random life advice
This file contains hidden or 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
cowcite(){ | |
args=(-b -d -g -L -n -N -p -s -t -w -y); | |
animals=(bong bud-frogs bunny cower daemon default dragon dragon-and-cow default elephant default ghostbusters head-in default kiss kosh default milk moofasa moose mutilated default sheep skeleton stegosaurus default three-eyes turkey turtle tux default www); | |
arg=${args[ $(( RANDOM % 13 )) ]}; | |
animal=${animals[ $(( RANDOM % 32 )) ]}; | |
curl -s http://bash.org/\?random | | |
grep -E '<p class="qt">.*</p>' | | |
head -n 1 | | |
sed -E 's%.*<p class="qt">(.*)</p>.*%\1%' | | |
sed -e 's/&/&/g; s/\</</g; s/\>/>/g; s/\"/"/g; s/\'/'"'"'/g' | | |
cowsay -f "$animal" "$arg" -- ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment