User Tools

Site Tools


tiempo_medioambiental_desde_la_terminal

Consultar desde la terminal el tiempo de una determinada ciudad

Agregar por ejemplo a /etc/bash.bashrc o /etc/.bashrc o $HOME/.bashrc.

tiempo(){ curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-<YOURZIPORLOCATION>}"|perl -ne '/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"';}

Ejemplo de consulta sobre Madrid.

$ tiempo Madrid

Tonight: Clear. Lows around 29. Patchy frost after midnight. North winds around 5 mph. 
Saturday: Mostly sunny. Highs around 58. East winds around 5 mph. 
Saturday Night: Mostly clear. Lows around 39. East winds around 5 mph. 
Sunday: Partly cloudy in the morning then becoming mostly cloudy. A 20 percent chance of showers. Highs around 67. Southeast winds around 10 mph. 
Sunday Night: Warmer. Showers and isolated thunderstorms. Lows around 55. South winds around 5 mph. Chance of rain 90 percent.
tiempo_medioambiental_desde_la_terminal.txt · Last modified: 2020/12/25 22:57 by 127.0.0.1