The cowsay/cowthink in the Browser
This page generates an ASCII picture of a cow saying/thinking something provided by the user.
It also provides the API which is rate-limit.
API (Application Programming Interface)
The API following has a rate-limit 1 call per second.https://helloacm.com/api/cowsay/?msg=CowSayIt will return JSON-encoded data (example):
" ________\n< CowSay >\n --------\n \\ ^__^\n \\ (oo)\\_______\n (__)\\ )\\\/\\\n ||----w |\n || ||\n"
https://helloacm.com/api/cowsay/?msg=CowSay&f=tuxIt will return JSON-encoded data (example):
" ________\n< CowSay >\n --------\n \\\n \\\n .--.\n |o_o |\n |:_\/ |\n \/\/ \\ \\\n (| | )\n \/'\\_ _\/`\\\n \\___)=(___\/\n\n"
https://helloacm.com/api/cowthink/?msg=CowSay&f=tuxIt will return JSON-encoded data (example):
" ________\n( CowSay )\n --------\n o\n o\n .--.\n |o_o |\n |:_\/ |\n \/\/ \\ \\\n (| | )\n \/'\\_ _\/`\\\n \\___)=(___\/\n\n"The parameter msg can also be specified via the $_POST method. Note: The f parameter can only be in the list of animals otherwise will be set to default. The API is rate-limit by 1 second per call.
Principle
We use the linux command cowsay and/or cowthink.NAME cowsay/cowthink - configurable speaking/thinking cow (and a bit more) SYNOPSIS cowsay [-e eye_string] [-f cowfile] [-h] [-l] [-n] [-T tongue_string] [-W column] [-bdgpstwy] DESCRIPTION Cowsay generates an ASCII picture of a cow saying something provided by the user. If run with no arguments, it accepts standard input, word-wraps the message given at about 40 columns, and prints the cow saying the given message on standard output. To aid in the use of arbitrary messages with arbitrary whitespace, use the -n option. If it is specified, the given message will not be word-wrapped. This is possibly useful if you want to make the cow think or speak in figlet(6). If -n is specified, there must not be any command-line argu鈥[m ments left after all the switches have been processed. The -W specifies roughly where the message should be wrapped. The default is equivalent to -W 40 i.e. wrap words at or before the 40th column. If any command-line arguments are left over after all switches have been processed, they become the cow's message. The program will not accept standard input for a message in this case. There are several provided modes which change the appearance of the cow depending on its particular emotional/physical state. The -b option initiates Borg mode; -d causes the cow to appear dead; -g invokes greedy mode; -p causes a state of paranoia to come over the cow; -s makes the cow appear thoroughly stoned; -t yields a tired cow; -w is somewhat the opposite of -t, and initiates wired mode; -y brings on the cow's youthful appearance. The user may specify the -e option to select the appearance of the cow's eyes, in which case the first two characters of the argument string eye_string will be used. The default eyes are 'oo'. The tongue is similarly configurable through -T and tongue_string; it must be two characters and does not appear by default. However, it does appear in the 'dead' and 'stoned' modes. Any config uration done by -e and -T will be lost if one of the provided modes is used. The -f option specifies a particular cow picture file (``cowfile'') to use. If the cowfile spec contains '/' then it will be interpreted as a path relative to the current directory. Otherwise, cowsay will search the path specified in the COWPATH environment variable. To list all cowfiles on the current COWPATH, invoke cowsay with the -l switch. If the program is invoked as cowthink then the cow will think its message instead of saying it. /usr/games/cowsay version [unknown] calling Getopt::Std::getopts (version 1.07 [paranoid]), running under Perl version 5.18.2. Usage: cowsay [-OPTIONS [-MORE_OPTIONS]] [--] [PROGRAM_ARG1 ...] The following single-character options are accepted: With arguments: -e -f -T -W Boolean (without arguments): -b -d -g -h -l -L -n -N -p -s -t -w -y Options may be merged together. -- stops processing of options. Space is not required between options and their arguments. [Now continuing due to backward compatibility and excessive paranoia. See 'perldoc Getopt::Std' about $Getopt::Std::STANDARD_HELP_VERSION.]