Page 1 of 1

[Tutorial] ASCII Weather

Posted: Fri Feb 02, 2018 10:26 am
by Phillski
I'm sure at some point we have all wanted to know what the weather forecast is but did not want to leave the safety of our SSH session. Well, now you can with a simple command.

Just enter this into your command line to install.

This version is now obsolete (still works just fine but is only supports 2 column output)

Code: Select all

echo -e "\nfunction weather() { curl\$@?2n; }" >> ~/.bashrc
source ~/.bashrc

New Version that will return an expanded weather report if your session is wide enough (and incorporates WarHawks suggestion).

Code: Select all

echo -e "\nfunction weather()\n{\nif [ \$COLUMNS -lt 125 ]\nthen\n  curl\$@?2n\nelse\n  curl\$@\nfi\n}" >> ~/.bashrc && source ~/.bashrc

To use just type 'weather' at the prompt and you will get the weather forecast for your current IP based location:
Scrolling up gets you this:
Weather2.png (10.3 KiB) Viewed 764 times
Should you wish to get the weather report for a different location ... well, you can do that too!
Here's the output for 'weather NewYork':
If you're running a session that is nice and wide it will (now) return an expanded weather report.
In this example columns=132 and rows=43:

Re: [Tutorial] ASCII Weather

Posted: Fri Feb 02, 2018 2:44 pm
by WarHawk
Oh that is SO COOL!!!! should make this part of the build!

Very neat!!!!

I go thru my .bashrc and make the alias's a bit different
alias ll='ls -lah'

this way to get a full directory listing...i just type ll also uncommented the color stuff so my command prompts and stuff are color

Very awesome!!! Thanks for this!

oh you can make that command all one line too

Code: Select all

echo -e "\nfunction weather() { curl\$@?2n; }" >> ~/.bashrc && source ~/.bashrc

Re: [Tutorial] ASCII Weather

Posted: Mon Feb 05, 2018 10:31 am
by Phillski
Glad you like it, just for fun you can even check the weather on the moon :)

The world needs more fun ASCII stuff.