Skip to content

Instantly share code, notes, and snippets.

@loisaidasam loisaidasam/USAGE.txt
Last active Feb 15, 2018

Embed
What would you like to do?
Get a dose of what those silly folks at asciiartfarts.com are up to ...
#!/bin/bash
# Note, requires `pup`
# https://github.com/ericchiang/pup/
# https://stackoverflow.com/questions/368744/shell-scripting-die-on-any-error/368754#368754
set -e
# Temp files
file_html=$(mktemp)
file_ascii=$(mktemp)
# Download html
curl -Ss "http://www.asciiartfarts.com/random.cgi" > "$file_html"
# Write header + newline
cat "$file_html" | pup --plain 'td center h1 text{}' | tr '\n' ' ' > "$file_ascii"
echo "" >> "$file_ascii"
# Write ASCII
cat "$file_html" | pup --plain 'pre text{}' >> "$file_ascii"
# Echo
cat "$file_ascii"
# Remove temp files
rm ${file_html} ${file_ascii}
$ ./ascii-art-farts.sh
# 2204 : DON'T FORGET AHMET AND DIVA
_ ____ ____ ___ ___ _ _ _____ _
/ \ / ___| / ___|_ _|_ _| / \ _ __| |_ | ___|_ _ _ __| |_ ___
/ _ \ \___ \| | | | | | / _ \ | '__| __| | |_ / _` | '__| __/ __|
/ ___ \ ___) | |___ | | | | / ___ \| | | |_ | _| (_| | | | |_\__ \
/_/ \_\____/ \____|___|___| /_/ \_\_| \__| |_| \__,_|_| \__|___/
,@@@@@@@@@, REPEAT:
@@@@@@@@@@@@@@@ WHAT KIND OF ASSHOLE NAMES
@@@@@@@@@@@@@@@@@ HIS KIDS DWEEZIL AND MOON UNIT
@@@@@@@@@@@@@@@@@
@@@@@'_ _'@@@@@
@@@| o o |@@@ YOUR DEATH DOES NOT ALLEVIATE
'@| (_) |@' YOUR MORTAL SIN AGAINST HUMANITY
\ ___ / IN THE FORM OF UNREASONABLE
|\_`~`_/| CHILD NAMING PROCEDURES SIR
____/: `"` :\____
/`}}}}}\ /{{{{{`\
/ {{{{{ \ / }}}}} \
/ }}}}} \.-./ {{{{{ \
| {{{{{ / | \ }}}}} |
jgs | }}}}} \/|\/ {{{{{ |
| /{{{{{ '-' }}}}}\ |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.