4 ms·
function weather(){curl -s "http://api.openweathermap.org/data/2.5/weather?q=$1&units=metric" | jq .main.temp | figlet -kcf big} $ weather london
by rnhmjoj 11y ago
function weather(){curl -s "http://api.openweathermap.org/data/2.5/weather?q=$1&units=metric" | jq .main.temp | figlet -kcf big}
$ weather london
__ _ _ ___ _____
/_ || || | |__ \ | ____|
| || || |_ ) || |__
| ||__ _| / / |___ \
| | | | _ / /_ ___) |
|_| |_|(_)|____||____/
- q3k 11y agoBut that's not web-scale and written in a functional language!
- gknoy 11y agoPerhaps I'm a bash noob, but when I try to paste that in my shell, it complains about a syntax error near `{curl`. Am I doing something wrong?
- cocoflunchy 11y agoThere are spacing issues for me. Try function weather() { curl -s "http://api.openweathermap.org/data/2.5/weather?q=$1&units=metric" | jq .main.temp | figlet -kcf big ;}
- rnhmjoj 11y agoI wrote this in zsh. It seems in bash you need to add a space before the bracket
- tacticiankerala 11y agoMay be you should post a gist. The line is getting truncated.
- rnhmjoj 11y agoIt should scroll horizontally.
- tacticiankerala 11y agomy bad :(
- taternuts 11y agoCool! for fahrenheit you can change the units to imperial function weather(){curl -s "http://api.openweathermap.org/data/2.5/weather?q=$1&units=imperial" | jq .main.temp | figlet -kcf big}