.--.      .--.      .--.      .--.      .--.      .--.      .--.
:::::.\::::::::.\::::::::.\::::::::.\::::::::.\::::::::.\::::::::.\
'      `--'      `--'      `--'      `--'      `--'      `--'         

  DATE : 2022.01.07
  TIME : 11:05
AUTHOR : SNOWCRASH@SDF.ORG
  MOOD : RELAXED
 TITLE : GOPHER DIVERSIONS
 
  .--.      .--.      .--.      .--.      .--.      .--.      .--.
:::::.\::::::::.\::::::::.\::::::::.\::::::::.\::::::::.\::::::::.\
'      `--'      `--'      `--'      `--'      `--'      `--'         

I posted this to the SDF Gopher BBOARD but thought I'd post
something about it in the actual phlog. With some stressful family
issues going on I found myself looking for a distraction and
gopher turned out to be a good escape.

The Gopher BBOARD had a post by nickca about how to add the output
dynamically from the "oneliner" app to your gopher page, it was
quickly followup by zaphod42 who added "cowsay" to the mix to add
some fancy ASCII art magic.

Which I thought was really cool, but I wasn't so hot about adding
the oneliner output to my phlog, it's pretty random, and not
really to my liking.

"What if I could add some interesting facts?" I thought to myself.
And after doing some googling I found such a text file.  Below are
the steps I followed to implement:

=================================
(Resource) Random one-line fact text file:
https://raw.githubusercontent.com/assaf/dailyhi/master/facts.txt

Download to local gopher directory: 
cd gopher 
wget https://raw.githubusercontent.com/assaf/dailyhi/master/facts.txt

Grant other group read permission: 
chmod o+r facts.txt

Add to gophermap (should be one line, no breaks): 
=echo "`/usr/pkg/bin/perl -e 'srand; rand($.) < 1 && ( $line = $_ )
while <>; print $line' /ftp/pub/users/snowcrash/facts.txt`" | /usr/pkg/bin/cowsay -f tux

Substitute your user name in directory path.  You can see available art with 
the "cowsay -l" command.

The result is this being added wherever you add the command.
Exit gopher and go back and a new fact is displayed.

        _____________________________________                                                                                                    
       / Baby donkeys or baby mules are also \                                                                                                   
       \ known as "Foals."                   /                                                                                                   
        -------------------------------------                                                                                                    
          \                                                                                                                                      
           \                                                                                                                                     
               .--.                                                                                                                              
              |o_o |                                                                                                                             
              |:_/ |                                                                                                                             
             //   \ \                                                                                                                            
            (|     | )                                                                                                                           
           /'\_   _/`\                                                                                                                           
           \___)=(___/                                                                                                                           
                                                                                                                                                 
                                                                                                                                                 
I then started to think, it would be cool to add the weather to
the page for my area (Chicago). This led me down another rabbit
hole of options, I ultimately landed on using the wttr.in service
with this command:

=echo "`/usr/pkg/bin/curl -s wttr.in/Chicago?T?0?u`"

Which adds:

       Weather report: Chicago                                                                                                                   
                                                                                                                                                 
            \  /       Partly cloudy                                                                                                             
          _ /"".-.     6(-7) ?F                                                                                                                  
            \_(   ).   ? 4 mph                                                                                                                   
            /(___(__)  9 mi                                                                                                                      
                       0.0 in                   


The cool thing about this app is if you use it without the
"T?0?u" option it provides a colorized 3 day forecast. Not great
for gopher, but very cool thing to add to my SDF .bashrc to run on
login. All in all it was a fun diversion.

-Snowcrash