shithub: 9utils

ref: ee16926c2c31a31875a29ca3d34daa1a42772ec6
dir: /rc/tiempo/

View raw version
#!/bin/rc
rfork e

if (~ $#* 0) {
  echo 'tiempo [i|c] village\n'
  echo 'i - muestra imagen con la previsión\n'
  echo 'c - muestra el tiempo actual por consola\n'
}

opcion=$1
city=$2

switch($opcion){
case 'i'
  hget https://wttr.in/$city.png | page
case 'c'
  hget 'https://wttr.in/'$city'?format=%l:+%C+ temp:%t+ rain:%p\n'
}