All pastes #2107668 Raw Edit

script meteo bash

public shellscript v1 · immutable
#2107668 ·published 2012-01-30 06:16 UTC
rendered paste body
*** Fichier meteo.sh ***#!/bin/bashset -xv######################################################################### METEO                                                                ################################################################################################### VARIABLES             ##########################VILLE=palaiseauLANG=fr########################## FONCTIONS             ##########################function get_meteo {		curl "http://www.google.com/ig/api?weather=$VILLE&hl=$LANG" 2>/dev/null | iconv -f iso8859-1 -t utf-8 | xgrep -x $parse_xml | sed -f $HOME/scripts/meteo/weather.sed > .current_weather 	bash $HOME/.current_weather}#----------------------------------------------------------------------#################################################### PROGRAMME PRINCIPAL                            ###################################################JOUR="today"case $JOUR in	today) parse_xml="/xml_api_reply/weather/current_conditions"		   echo $parse_xml		   ;;	esac	get_meteoecho $conditionexit*** Fichier weather.sed ***/<.*-->/d/current_conditions/ds/ data//gs/  </export /gs/\/>//gs/&#xA0;//gs/Humidit&#xE9\;\ \:\ //gs/&#xE0;/a/g*** Fichier .current_weather généré ***export condition="Ciel nuageux"export temp_f="30"export temp_c="-1"export humidity="80%"export icon="/ig/images/weather/cloudy.gif"export wind_condition="Vent : N a 10 km/h"