ServiceNow Cowsay Logger
My second programming teacher (for C and Unix) enlightened me about the fantastic cowsay - so I honor him today as tribute.
If you aren’t familiar with cowsay it’s merely a little program for displaying text with ASCII pictures of cows. Now you’re wondering how this relates to ServiceNow…. and it doesn’t. Besides that I think it’s cool and no one else has ever done it before.
In the original cowsay code, there are options for special eyes, tongues, speech bubbles and even support for various ASCII images. There is some latent code exposed to support these options, but I haven’t exposed them with functions yet, so just simple cows for now!
Most people back in the day piped the fortune command to cowsay, to make things more amusing. I also found a neat little public API for the Fortune adage, and was able to adapt that as well. It took me a bit of tinkering to realize I needed to specify a ‘User-Agent’ header though.
Instructions: Download the source code file and copy/paste to a script include named ‘Cowsay’.
Syntax usage:
var c = new Cowsay(); gs.print(c.say(c.fortune())); //or gs.print(c.say("ServiceSometimes"));