Con este comando podemos obtener la temperatura de Buenos Aires desde la linea de comandos de cualquier *nix conectado a internet. echo “Temperatura $(curl -s “http://www.google.com/ig/api?weather=Buenos%20Aires” | sed ‘s|.*<temp_c data=”([^”]*)”/>.*|1|’) grados en Buenos Aires“ desarmando el comando de la salida de curl -s “http://www.google.com/ig/api?weather=Buenos%20Aires” Obtenemos el siguiente XML: <xml_api_reply version=”1″>−<weather module_id=”0″ tab_id=”0″ mobile_row=”0″ mobile_zipped=”1″ row=”0″ section=”0″>−<forecast_information><city data=”Buenos Aires”/><postal_code data=”Buenos Aires”/><latitude_e6 data=””/><longitude_e6 data=””/><forecast_date data=”2010-02-12″/><current_date_time data=”2010-02-12 20:00:00 +0000″/><unit_system data=”US”/></forecast_information>−<current_conditions><condition data=”Clear”/><temp_f data=”88″/><temp_c data=”31″/><humidity data=”Humidity: 52%”/><icon data=”/ig/images/weather/sunny.gif”/><wind_condition data=”Wind: NE at 8 mph”/></current_conditions>−<forecast_conditions><day_of_week data=”Fri”/><low data=”64″/><high data=”86″/><icon data=”/ig/images/weather/sunny.gif”/><condition data=”Clear”/></forecast_conditions>−<forecast_conditions><day_of_week data=”Sat”/><low data=”60″/><high data=”87″/><icon data=”/ig/images/weather/sunny.gif”/><condition data=”Clear”/></forecast_conditions>−<forecast_conditions><day_of_week data=”Sun”/><low data=”57″/><high data=”73″/><icon data=”/ig/images/weather/chance_of_rain.gif”/><condition data=”Chance of Rain”/></forecast_conditions>−<forecast_conditions><day_of_week data=”Mon”/><low data=”57″/><high data=”73″/><icon data=”/ig/images/weather/chance_of_rain.gif”/><condition data=”Chance of Rain”/></forecast_conditions></weather></xml_api_reply> Para este caso lo que buscamos es esta parte, <temp_c data=”31″/> $ curl -s “http://www.google.com/ig/api?weather=Buenos%20Aires” | sed ‘s|.*<temp_c[…]