Contenu | Rechercher | Menus

Annonce

Ubuntu 16.04 LTS
Commandez vos DVD et clés USB Ubuntu-fr !

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

#1326 Le 09/09/2016, à 20:43

seelord

Re : [Conky] Alternative à weather.com (3)

Re,
Merci de lui avoir posé la question j'ai lu sa réponse j'ai mis un espace entre:

${alignr}"espace"${execpi 600 sed -n '9p' $HOME/1_accuweather/curr_cond}

Et la ça fonctionne ...

Edit: J'ai relu sa réponse et oui un espace à la fin de la ligne fonctionne aussi tongue

Ah oublié une chose importante .... Tu le remercieras de ma part wink

Dernière modification par seelord (Le 09/09/2016, à 23:39)


Rien ne sert d'avoir une grosse tête, suffit juste de mettre les pieds dans le plat...^^

Hors ligne

#1327 Le 11/09/2016, à 10:05

loutch

Re : [Conky] Alternative à weather.com (3)

Hello

Tu le remercieras de ma part 

Fait



@+

Dernière modification par loutch (Le 11/09/2016, à 10:06)

Hors ligne

#1328 Le 27/10/2016, à 12:45

ragamatrix

Re : [Conky] Alternative à weather.com (3)

loutch a écrit :

Re

Moi reste plus qu'a franciser tout ça .

Suis pas fana de ce genre d'icônes .
http://pix.tdct.org/upload/thumb/1473338641.png

@+

edit

Changer pour l'ancien pack d'icones j'aime mieux


http://pix.tdct.org/upload/thumb/1473343561.png


@+

Salut loutch,
pourrais-tu tu stp nous poster la config du conky ci-dessus ?
As-tu aussi ce genre de conky avec le script wunderground ?
Bonne aprem
cordialement raga wink

Dernière modification par ragamatrix (Le 27/10/2016, à 12:45)

Hors ligne

#1329 Le 29/10/2016, à 08:45

loutch

Re : [Conky] Alternative à weather.com (3)

@ ragamatrix

No Problemo

Il est un peu plus grand (5 cadres) que sur la capture d'écran mais pour avoir le même tu peux supprimer le 3' et 4' cadre ainsi que dans le 2' cadre la dernière ligne au-dessus des icônes fait appel au script wunderground.

1477727593.png

accuweather.fr

  
background yes
use_xft yes
xftfont GE Inspira:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 450 540
maximum_width 465
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white #dbc38f
default_outline_color black
alignment tl
gap_x 60
gap_y 60
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
 uppercase no
 
 color7 6495ee
 color9 red
 	
	lua_load ~/.conky/lua/image.lua
	
TEXT

${execi 600 bash $HOME/1_accuweather/1_accuweather -f2015 -h2015}
#### Prelier cadre ####
${voffset -14}${font LED_mono :style=Medium:size=58}${color 434343}${goto 30}${time %H}${goto 140}${time %M}${font LED_mono :size=20:style=Medium}${color 808080}${goto 233}${time %S}$font
#### Date ####
${voffset -30}${color white}${font GE Inspira:size=9}${alignc -108}${time %A, %d %B %Y}$font
### vent ####
${voffset -10}
${goto 310}${font GE Inspira:size=10}Vent : ${execi 90 sed -n '5p' $HOME/1_accuweather/curr_cond} 
${goto 310}Vitesse : ${execi 90 sed -n '6p' $HOME/1_accuweather/curr_cond}
${goto 310}Préssion : ${execi 90 sed -n '8p' $HOME/1_accuweather/curr_cond}
${goto 310}Indice UV : ${execi 90 sed -n '9p' $HOME/1_accuweather/curr_cond} $font
#### Ville ####
${voffset -36}${font GE Inspira:size=12:}Sarreguemines : ${font} Temp.: ${execi 90 sed -n '2p' $HOME/1_accuweather/curr_cond} °C   Res.: ${execi 90 sed -n '3p' $HOME/1_accuweather/curr_cond} °C  
${execi 90 sed -n '4p' $HOME/1_accuweather/curr_cond}
Alerte 1 : ${execi 600  sed -n '1p' $HOME/1_accuweather/Alertes}
Alerte 2 : ${execi 600  sed -n '2p' $HOME/1_accuweather/Alertes}
#### Deuxième cadre ####
#### Affichage date ####
${voffset -8}
${goto 20}${execi 3600 echo `date --date="1 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="1 day" | awk '{print $3}'`}\
${goto 115}${execi 3600 echo `date --date="2 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="2 day" | awk '{print $3}'`}\
${goto 215}${execi 3600 echo `date --date="3 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="3 day" | awk '{print $3}'`}\
${goto 305}${execi 3600 echo `date --date="4 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="4 day" | awk '{print $3}'`}\
${goto 400}${execi 3600 echo `date --date="5 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="5 day" | awk '{print $3}'`}
##### Affichage temperatures #####
${voffset -14}
${goto 20}${color7}${execi 90 sed -n '9p' $HOME/1_accuweather/first_days}°${color}/${color9}${execi 90 sed -n '8p' $HOME/1_accuweather/first_days}°${color}\
${goto 115}${color7}${execi 90 sed -n '14p' $HOME/1_accuweather/first_days}°${color}/${color9}${execi 90 sed -n '13p' $HOME/1_accuweather/first_days}°${color}\
${goto 215}${color7}${execi 90 sed -n '19p' $HOME/1_accuweather/first_days}°${color}/${color9}${execi 90 sed -n '18p' $HOME/1_accuweather/first_days}°${color}\
${goto 305}${color7}${execi 90 sed -n '24p' $HOME/1_accuweather/first_days}°${color}/${color9}${execi 90 sed -n '23p' $HOME/1_accuweather/first_days}°${color}\
${goto 400}${color7}${execi 90 sed -n '4p' $HOME/1_accuweather/last_days}°${color}/${color9}${execi 90 sed -n '3p' $HOME/1_accuweather/last_days}°${color}
##### Affichage direction du vent et vitesse #####
${voffset -17}${execi 1800 bash $HOME/2b_Wunderground_API/2b}
${goto 20}${execi 90 sed -n '98p' $HOME/2b_Wunderground_API/Simple_Forecast}-${execi 90 sed -n '96p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 115}${execi 90 sed -n '204p' $HOME/2b_Wunderground_API/Simple_Forecast}-${execi 90 sed -n '202p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 215}${execi 90 sed -n '310p' $HOME/2b_Wunderground_API/Simple_Forecast}-${execi 90 sed -n '308p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 305}${execi 90 sed -n '416p' $HOME/2b_Wunderground_API/Simple_Forecast}-${execi 90 sed -n '414p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 400}${execi 90 sed -n '522p' $HOME/2b_Wunderground_API/Simple_Forecast}-${execi 90 sed -n '520p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h
#### Troisième cadre ####
#### Conditions ####
${voffset 44}${font GE Inspira:size=8}
${execi 90 sed -n '10p' $HOME/1_accuweather/first_days| cut -c1-14}\
${goto 95}${execi 90 sed -n '15p' $HOME/1_accuweather/first_days| cut -c1-14}\
${goto 200}${execi 90 sed -n '20p' $HOME/1_accuweather/first_days| cut -c1-14}\
${goto 290}${execi 90 sed -n '25p' $HOME/1_accuweather/first_days| cut -c1-14}\
${goto 385}${execi 90 sed -n '10p' $HOME/1_accuweather/last_days| cut -c1-14}
${execi 90 sed -n '10p' $HOME/1_accuweather/first_days| cut -c15-29}\
${goto 95}${execi 90 sed -n '15p' $HOME/1_accuweather/first_days| cut -c15-29}\
${goto 200}${execi 90 sed -n '20p' $HOME/1_accuweather/first_days| cut -c15-29}\
${goto 290}${execi 90 sed -n '25p' $HOME/1_accuweather/first_days| cut -c15-29}\
${goto 385}${execi 90 sed -n '10p' $HOME/1_accuweather/last_days| cut -c15-29}$font
#### Quatrième cadre ####
${voffset 6}
${goto 25}LEVER/COUCHER DU SOLEIL                                               ${goto 270}LEVER/COUCHER DE LUNE
Lever du soleil ${execi 3600 sed -n '14p' $HOME/1_accuweather/curr_cond}       ${goto 250}Lever de lune ${execi 3600 sed -n '18p' $HOME/1_accuweather/curr_cond}
Coucher de soleil ${execi 3600 sed -n '15p' $HOME/1_accuweather/curr_cond}     ${goto 250}Coucher de lune ${execi 3600 sed -n '19p' $HOME/1_accuweather/curr_cond}
Durée ${execi 3600 sed -n '16p' $HOME/1_accuweather/curr_cond}                 ${goto 250}Durée ${execi 3600 sed -n '20p' $HOME/1_accuweather/curr_cond}
                                                                               ${goto 250}${execi 600  sed -n '6p' $HOME/2b_Wunderground_API/Moon_Sun}  Vis. ${execi 600  sed -n '2p' $HOME/2b_Wunderground_API/Moon_Sun}% 
#### Cinquième cadre ####
${voffset -18}
${color FFFFFF}${goto 10}${voffset 16}${cpu cpu0}%\
${goto 55}${exec expr `cat /sys/class/hwmon/hwmon2/temp1_input` / 1000} °\
${goto 105}${execi 120 hddtemp -n /dev/sda} °\
${goto 155}${hwmon 1 temp 1} °\
${goto 200}${memperc}%\
${goto 255}${fs_used_perc /}%\
${goto 305}${fs_used_perc /home}%\
${goto 350}${downspeed wlp2s0}\
${goto 400}${upspeed wlp2s0}
${color 6495ee}${goto 10}CPU\
${goto 50}Temp\
${goto 100}Disque\
${goto 150}Carte\
${goto 200}Ram\
${goto 250}Racine\
${goto 300}Home\
${goto 350}Entrant\
${goto 400}Sortant $color
${goto 250}Signal : ${wireless_link_qual wlp2s0} %${goto 350}${totaldown wlp2s0}${goto 400}${totalup wlp2s0}
${color FFFFFF}${font caviar dreams:size=8}Uptime: ${uptime_short}
${color FFFFFF}${font caviar dreams:size=8}Processes: ${processes}
${color FFFFFF}${font caviar dreams:size=8}Running: ${running_processes}
${voffset -54}
${color 6495ee}${font caviar dreams:size=8}${alignr 20}${nodename}
${color 6495ee}${font caviar dreams:size=8}${alignr 20}Mageia 5 $machine
${color 6495ee}${font caviar dreams:size=8}${alignr 20}Kernel: ${kernel}${color}
#### Affichage des cadres utilisés dans le conky ####
${voffset -935}
#### premier cadre ####
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 40 450 112}
${lua fDrawImage $HOME/1_accuweather/fond/flip_bg.png 22 3 100 100}
${lua fDrawImage $HOME/1_accuweather/fond/flip_bg.png 132 3 100 100}
#### Second cadre ####
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 155 450 85}
#### Troisième cadre ####
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 245 450 45}
#### Quatrième cadre ####
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 295 450 85}
#### Cinquième cadre ####
${lua fDrawImage $HOME/1_accuweather/fond/base.png 0 385 450 85}
#### icônes premier cadre ####
${lua fDrawImage $HOME/1_accuweather/forecast_2015/forecast_0.png 215 70 110 70}\
${lua fDrawImage $HOME/1_accuweather/Wind1.png 370 40 90 90}
#### icônes Second cadre ####
${lua fDrawImage $HOME/1_accuweather/forecast_2015/forecast_2.png -10 190 90 55}\
${lua fDrawImage $HOME/1_accuweather/forecast_2015/forecast_3.png  85 190 90 55}\
${lua fDrawImage $HOME/1_accuweather/forecast_2015/forecast_4.png 185 190 90 55}\
${lua fDrawImage $HOME/1_accuweather/forecast_2015/forecast_5.png 280 190 90 55}\
${lua fDrawImage $HOME/1_accuweather/forecast_2015/forecast_6.png 375 190 90 55}
#### icônes Quatrième cadre ####
${lua fDrawImage $HOME/1_accuweather/Forecast_Images_2015/1.png 140 305 110 70}\
${lua fDrawImage $HOME/1_accuweather/Forecast_Images_2015/33.png 350 305 110 70}
${voffset - 900}

wunderground un peu différent

1477727761.png

  
background yes
use_xft yes
xftfont GE Inspira:size=9
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager
double_buffer yes
minimum_size 450 440
maximum_width 455
text_buffer_size 2048
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
default_color white #dbc38f
default_outline_color black
alignment tl
gap_x 60
gap_y 60
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
# Fonctionne uniquement avec les polices Fixes
#use_spacer yes
imlib_cache_size 0 
 uppercase no
 
 color7 6495ee
 color9 red
 	
	lua_load ~/.conky/lua/image.lua
	
TEXT

#### Lancement du script récupérant les données météo ####
${execi 1800 bash $HOME/2b_Wunderground_API/2b}
#### Premier cadre ####
##### Heure #####
${voffset -14}${font LED_mono :style=Medium:size=55}${color 434343}${goto 32}${time %H}${goto 142}${time %M}${font LED_mono :size=20:style=Medium}${color 808080}${goto 235}${time %S}$font
##### Date #####
${voffset -36}${color white}${font GE Inspira:size=9:style=Bold}${alignc -108}${exec date "+%A %d %B %Y"}
##### Affichage infos vent ######
${voffset 10}${color white}${font GE Inspira:size=9}${goto 300}Vent : ${execi 600  sed -n '73p' $HOME/2b_Wunderground_API/Conditions-fr}          
${goto 300}Vitesse : ${execi 600  sed -n '74p' $HOME/2b_Wunderground_API/Hourly} km/h
${goto 300}Pluie : ${execi 600  sed -n '57p' $HOME/2b_Wunderground_API/Simple_Forecast} mm
##### ville + heure mise à jour #####
${voffset -18}${goto 15}${font Ubuntu:size=10}${color white}Sarreguemines : $font ${execi 600  sed -n '63p' $HOME/2b_Wunderground_API/Conditions-fr}
  Temp.: ${execi 600  sed -n '67p' $HOME/2b_Wunderground_API/Conditions} °C     Res.: ${execi 600  sed -n '113p' $HOME/2b_Wunderground_API/Conditions} °C
  Alerte 1 : ${execi 600  sed -n '1p' $HOME/2b_Wunderground_API/Alertes}
  Alerte 2 : ${execi 600  sed -n '2p' $HOME/2b_Wunderground_API/Alertes}  ${alignr 14}Dernière mise à jour : ${execi 600  sed -n '53p' $HOME/2b_Wunderground_API/Conditions | cut -c18-22}
#### Deuxième cadre ####
##### Affichage temperature #####
${voffset -8}
${goto 20}${color9}${execi 600  sed -n '145p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}/${color7}${execi 600  sed -n '150p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 95}${color9}${execi 600  sed -n '251p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}/${color7}${execi 600  sed -n '256p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 170}${color9}${execi 600  sed -n '357p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}/${color7}${execi 600  sed -n '362p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 245}${color9}${execi 600  sed -n '463p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}/${color7}${execi 600  sed -n '468p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 320}${color9}${execi 600  sed -n '569p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}/${color7}${execi 600  sed -n '574p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}\
${goto 400}${color9}${execi 600  sed -n '675p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}/${color7}${execi 600  sed -n '680p' $HOME/2b_Wunderground_API/Simple_Forecast}°${color}  $color



##### Affichage vitesse du vent #####
${voffset -20}
${goto 20}${execi 90 sed -n '96p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 95}${execi 90 sed -n '202p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 168}${execi 90 sed -n '308p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 248}${execi 90 sed -n '414p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 324}${execi 90 sed -n '520p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h\
${goto 398}${execi 90 sed -n '626p' $HOME/2b_Wunderground_API/Simple_Forecast}km/h
##### Affichage direction du vent #####
${voffset -17}
${goto 20}${execi 90 sed -n '98p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 95}${execi 90 sed -n '204p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 168}${execi 90 sed -n '310p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 248}${execi 90 sed -n '416p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 324}${execi 90 sed -n '522p' $HOME/2b_Wunderground_API/Simple_Forecast}\
${goto 398}${execi 90 sed -n '628p' $HOME/2b_Wunderground_API/Simple_Forecast}
##### Affichage Date #####
${voffset -17}
${goto 20}${execi 3600 echo `date --date="1 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="1 day" | awk '{print $3}'`}\
${goto 95}${execi 3600 echo `date --date="2 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="2 day" | awk '{print $3}'`}\
${goto 168}${execi 3600 echo `date --date="3 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="3 day" | awk '{print $3}'`}\
${goto 248}${execi 3600 echo `date --date="4 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="4 day" | awk '{print $3}'`}\
${goto 324}${execi 3600 echo `date --date="5 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="5 day" | awk '{print $3}'`}\
${goto 398}${execi 3600 echo `date --date="6 day" | awk '{print $1}' | cut -c1-3`}.${execi 3600 echo `date --date="6 day" | awk '{print $3}'`}
#### Troisième cadre ####
${voffset 1}
${goto 25}LEVER/COUCHER DU SOLEIL                                               ${goto 270}LEVER/COUCHER DE LUNE
${voffset -15}
Lever du soleil : ${execi 600  sed -n '16p' $HOME/2b_Wunderground_API/Moon_Sun} h ${execi 600  sed -n '18p' $HOME/2b_Wunderground_API/Moon_Sun}       ${goto 250}Lever de lune : ${execi 600  sed -n '26p' $HOME/2b_Wunderground_API/Moon_Sun} h ${execi 600  sed -n '28p' $HOME/2b_Wunderground_API/Moon_Sun}
Coucher de soleil : ${execi 600  sed -n '21p' $HOME/2b_Wunderground_API/Moon_Sun} h ${execi 600  sed -n '23p' $HOME/2b_Wunderground_API/Moon_Sun}     ${goto 250}Coucher de lune : ${execi 600  sed -n '31p' $HOME/2b_Wunderground_API/Moon_Sun} h ${execi 600  sed -n '33p' $HOME/2b_Wunderground_API/Moon_Sun}
Indice UV : ${execi 600  sed -n '121p' $HOME/2b_Wunderground_API/Conditions}                                                                                                                                            ${goto 250}Phase : ${execi 600  sed -n '6p' $HOME/2b_Wunderground_API/Moon_Sun}
Prévision pluie : ${execi 600  sed -n '133p' $HOME/2b_Wunderground_API/Conditions} mm                                                                                                                                    ${goto 250}Visibilitée : ${execi 600  sed -n '2p' $HOME/2b_Wunderground_API/Moon_Sun} %
#### Troisième cadre ####                                                                
${color FFFFFF}${goto 10}${voffset 10}${cpu cpu0}%\
${goto 55}${exec expr `cat /sys/class/hwmon/hwmon2/temp1_input` / 1000} °\
${goto 105}${execi 120 hddtemp -n /dev/sda} °\
${goto 155}${hwmon 1 temp 1} °\
${goto 200}${memperc}%\
${goto 255}${fs_used_perc /}%\
${goto 305}${fs_used_perc /home}%\
${goto 350}${downspeed wlp2s0}\
${goto 400}${upspeed wlp2s0}
${color 6495ee}${goto 10}CPU\
${goto 50}Temp\
${goto 100}Disque\
${goto 150}Carte\
${goto 200}Ram\
${goto 250}Racine\
${goto 300}Home\
${goto 350}Entrant\
${goto 400}Sortant $color
${goto 250}Signal : ${wireless_link_qual wlp2s0} %${goto 350}${totaldown wlp2s0}${goto 400}${totalup wlp2s0}
${color FFFFFF}${font caviar dreams:size=8}Uptime: ${uptime_short}
${color FFFFFF}${font caviar dreams:size=8}Processes: ${processes}
${color FFFFFF}${font caviar dreams:size=8}Running: ${running_processes}
${voffset -54}
${color 6495ee}${font caviar dreams:size=8}${alignr 20}${nodename}
${color 6495ee}${font caviar dreams:size=8}${alignr 20}Mageia 5 $machine
${color 6495ee}${font caviar dreams:size=8}${alignr 20}Kernel: ${kernel}
#### Affichage des cadres utilisés dans le conky ####
${voffset -935}
#### premier cadre ####
${lua fDrawImage $HOME/2b_Wunderground_API/fond/base.png 0 40 450 110}
${lua fDrawImage $HOME/2b_Wunderground_API/fond/flip_bg.png 22 3 100 100}
${lua fDrawImage $HOME/2b_Wunderground_API/fond/flip_bg.png 132 3 100 100}
#### Second cadre ####
${lua fDrawImage $HOME/2b_Wunderground_API/fond/base.png 0 155 450 85}
#### Troisième cadre ####
${lua fDrawImage $HOME/2b_Wunderground_API/fond/base.png 0 245 450 85}
#### Quatrième cadre ####
${lua fDrawImage $HOME/2b_Wunderground_API/fond/base.png 0 335 450 85}
#### icônes premier cadre ####
${lua fDrawImage $HOME/2b_Wunderground_API/Now.png 205 75 100 70}
${lua fDrawImage $HOME/2b_Wunderground_API/Wind1.png 370 55 90 90}
#### icônes Second cadre ####
${lua fDrawImage $HOME/2b_Wunderground_API/d2.png 0 165 65 45}
${lua fDrawImage $HOME/2b_Wunderground_API/d3.png 75 165 65 45}
${lua fDrawImage $HOME/2b_Wunderground_API/d4.png 150 165 65 45}
${lua fDrawImage $HOME/2b_Wunderground_API/d5.png 225 165 65 45}
${lua fDrawImage $HOME/2b_Wunderground_API/d6.png 300 165 65 45}
${lua fDrawImage $HOME/2b_Wunderground_API/d7.png 375 165 65 45}
#### icônes troisième cadre ####
${lua fDrawImage $HOME/2b_Wunderground_API/Forecast_Images/1.png 140 255 100 70}\
${lua fDrawImage $HOME/2b_Wunderground_API/Forecast_Images/33.png 350 255 100 70}
${voffset -450}

@+

Dernière modification par loutch (Le 29/10/2016, à 08:59)

Hors ligne

#1330 Le 29/10/2016, à 16:11

ragamatrix

Re : [Conky] Alternative à weather.com (3)

Merci beaucoup loutch et bon week-end wink ++

Hors ligne

#1331 Le 23/12/2016, à 10:24

jdt37b

Re : [Conky] Alternative à weather.com (3)

Bon jour,
Le conky méteo dont on a parlé ici ne fonctionne plus en version 1.10, y compris en le modifiant avec la nouvelle syntaxe (pb lua apparemment ?)
Je suis donc revenu en 1.09.
Mais, dans Xenial, qu'apporte de plus cette version 1.10  ?  (à part se retartiner les conkies ! smile )
Merci.


Shuttle SB61V40 : Pentium4 à 2Ghz 1Mo,  Carte Intel 82865g5 Graphics Controller,  Voyager (Xubuntu) 12.04.5 et 14.04.5 - 32 bits
Asus X72J : Intel i5 460M  4Go,  Radeon 5470,  Xubuntu 16.04.1  64 bits

Hors ligne

#1332 Le 17/01/2017, à 22:29

daniel38100

Re : [Conky] Alternative à weather.com (3)

Bonjour à tous ,

Je viens de mettre a jour le pack météo fond d'écran

Disponible ici Accuweather-3 v3.10

le recmeteo.py

#! /usr/bin/python3
# -*- coding: utf-8 -*-
# Par Didier-T Forum Ubuntu.fr
# Ajout notification par jpdipsy Forum Ubuntu.fr
# Ajout notification via DBus par ti_tux Forum Ubuntu.fr
# Ajout création repsauv si inexistant par jpdipsy Forum Ubuntu.fr
# Repris par Daniel38100 à partir de la version 2.00 en 01/2017


from socket import timeout
from urllib.request import Request, urlopen, URLError
from os import path, makedirs, system
from time import time, sleep, strftime, localtime
from re import search, compile, findall
from sys import argv
from gc import collect
from bs4 import BeautifulSoup, Tag, NavigableString
from datetime import date, datetime


Version='2.00a'

homedir=path.expanduser('~')

#### initialisation des variables
adressWeb="http://www.accuweather.com/fr/fr/belfort/133341/daily-weather-forecast/133341"
repsauv="~/essais"
huitHeures="oui"
nbFoisHuit=1
matin="oui"
apresmidi="oui"
soiree="oui"
nuit="oui"
nbJour=1
interval=30
notifi="oui"
externe=None
Id="sans"
demon="non"
fullnotify="non"
MAJP="oui"

for a in argv:
    if search("adressWeb=", a) is not None:
        adressWeb=compile("adressWeb=(.*)").search(a).group(1)
    if search("repsauv=", a) is not None:
        repsauv=compile("repsauv=(.*)").search(a).group(1)
    if search("huitHeures=", a) is not None:
        huitHeures=compile("huitHeures=(.*)").search(a).group(1)
    if search("nbJour=", a) is not None:
        nbJour=compile("nbJour=(.*)").search(a).group(1)
    if search("interval=", a) is not None:
        interval=compile("interval=(.*)").search(a).group(1)
    if search("notify=", a) is not None:
        notifi=compile("notify=(.*)").search(a).group(1)
    if search("notifyPartielle=", a) is not None:
        fullnotify=compile("notifyPartielle=(.*)").search(a).group(1)
    if search("matin=", a) is not None:
        matin=compile("matin=(.*)").search(a).group(1)
    if search("apresmidi=", a) is not None:
        apresmidi=compile("apresmidi=(.*)").search(a).group(1)
    if search("soiree=", a) is not None:
        soiree=compile("soiree=(.*)").search(a).group(1)
    if search("nuit=", a) is not None:
        nuit=compile("nuit=(.*)").search(a).group(1)
    if search("externe=", a) is not None:
        externe=compile("externe=(.*)").search(a).group(1)
    if search("nbFoisHuit=", a) is not None:
        nbFoisHuit=compile("nbFoisHuit=(.*)").search(a).group(1)
    if search("id=", a) is not None:
        Id=compile("id=(.*)").search(a).group(1)
    if search("demon=", a) is not None:
        demon=compile("demon=(.*)").search(a).group(1)
    if search("MAJP=", a) is not None:
        MAJP=compile("MAJP=(.*)").search(a).group(1)

nbJour=int(nbJour)
interval=int(interval)
repsauv=repsauv.replace("~", homedir)
notifi=str.lower(notifi)
fullnotify==str.lower(fullnotify)
huitHeures=str.lower(huitHeures)
nbFoisHuit=int(nbFoisHuit)
MAJP=str(MAJP)

#### fin initialisation des variables

#### Fonction de traitement des fichiers
def traitement(adress, fichier, repsauv):
    current_balise=None
    x=1
    user_agent='Mozilla/5.0 (X11; Linux x86_64)'
    headers={ 'User-Agent' : user_agent }
    while current_balise is None:
        response=None
        while response is None:
            try:
                html_page=urlopen(adress, timeout=10)
            except (URLError) as error:
                print("[\033[31mFAIL\033[0m] HTML ", error)
            except timeout:
                print("[\033[31mFAIL\033[0m] erreur timeout acces HTML")
            else:
                try:
                    currentCond=html_page.read()
                except (URLError) as error:
                    print("[\033[31mFAIL\033[0m] Lecture page ", error)
                except timeout:
                    print("[\033[31mFAIL\033[0m] erreur timeout lecture page")
                else:
#                    print("[\033[32m OK \033[0m] "+adress)
                    response="ok"
            if response is None:
                sleep(10)
        current_balise=1
    soup=BeautifulSoup(currentCond, "lxml")
    resultat=''
    inter=[]
#  Huit Heures -----------------------------------------------------
    if 'hourly-weather-forecast' in adress :
        page=soup.select("[class~=overview-hourly]")[0].find_all('td')+soup.select("[class~=precip-hourly]")[0].find_all('td')+soup.select("[class~=sky-hourly]")[0].find_all('td')
        info=BeautifulSoup(str(page), "lxml").find_all('div')+BeautifulSoup(str(page), "lxml").find_all('span')
        suppr='<div class='
        detail=['Heure','','','Temp°','RealFeel®','Vent (km/h)','Pluie','Neige','Verglas','Indice UV','Couverture nuageuse','Humidité','Point de rosée','Icone']
        for i in info :
            if suppr in str(i) :
                result=str(i).replace(str(i),'')
            else :
                result=str(i).replace('</span>','').replace('<span>','').replace('</div>','').replace('<div>','')
                inter.append(result)
        ico=BeautifulSoup(str(page), "lxml").select("[class~=icon]")
        x=1
        for i in ico:
            icone=str(i).replace('<div class="icon-weather icon ','').replace('"></div>','')
            x=x+1
            inter.append(icone)
        y=0
        for i in detail:
            x=1
            while x<9 :
                if i == '' :
                    x=x+1
                    y=y+1
                else :
                    resultat=resultat+str(i)+str(x)+': '+inter[y]+'\n'
                    y=y+1
                    x=x+1
# Jour ---------------------------------------------------------
    if 'daily-weather-forecast' in adress :
        page=soup.select("[class~=detail-tab-panel]")[0]
        page=str(page).replace('<span class="setting">Mx</span>','').replace('<span class="setting">Mi</span>','')
        info=BeautifulSoup(str(page), "lxml").find_all('strong')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.strong.string
            inter0.append(comment)
        inter.append('VentD jour: '+inter0[0].split(' ')[0])
        inter.append('VentF jour: '+inter0[0].split(' ')[1]+'km/h')
        inter.append('VentD nuit: '+inter0[10].split(' ')[0])
        inter.append('VentF nuit: '+inter0[10].split(' ')[1]+'km/h')
        inter.append('Rafale jour:'+inter0[1])
        inter.append('Rafale nuit:'+inter0[11])
        inter.append('UV jour: '+inter0[2])
        inter.append('UV nuit: '+inter0[12])
        inter.append('Prob orage jour: '+inter0[3])
        inter.append('Prob orage nuit: '+inter0[13])
        inter.append('Précipitations jour: '+inter0[4])
        inter.append('Précipitations nuit: '+inter0[14])
        inter.append('Pluie jour: '+inter0[5])
        inter.append('Pluie nuit: '+inter0[15])
        inter.append('Neige jour: '+inter0[6])
        inter.append('Neige nuit: '+inter0[16])
        inter.append('Verglas jour: '+inter0[7])
        inter.append('Verglas nuit: '+inter0[17])
        inter.append('Heures de précipitations jour: '+inter0[8])
        inter.append('Heures de précipitations nuit: '+inter0[18])
        inter.append('Heures de pluie jour: '+inter0[9])
        inter.append('Heures de pluie nuit: '+inter0[19])
        info=BeautifulSoup(str(page), "lxml").find_all('span')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.span.string
            inter0.append(comment)
        inter.append('Temp jour: '+inter0[0])
        inter.append('Temp nuit: '+inter0[3])
        inter.append('Temp ress jour:'+inter0[1].replace('RealFeel®',''))
        inter.append('Temp ress nuit:'+inter0[4].replace('RealFeel®',''))
        inter.append('Prob précipitations jour:'+inter0[2].replace('Précipitations',''))
        inter.append('Prob précipitations nuit:'+inter0[5].replace('Précipitations',''))
        con=BeautifulSoup(str(page), "lxml").select("[class~=cond]")
        inter0=[]
        for i in con:
            cond=str(i).replace('<div class="cond">','').replace('</div>','').replace('  ','').replace('\n','').replace('\r','')
            inter0.append(cond)
        inter.append('Cond jour: '+inter0[0])
        inter.append('Cond nuit: '+inter0[1])
        ico=BeautifulSoup(str(page), "lxml").select("[class~=icon]")
        inter0=[]
        for i in ico:
            icone=str(i).replace('<div class="icon ','').replace('"></div>','')
            inter0.append(icone)
        inter.append('Icone jour: '+inter0[0])
        inter.append('Icone nuit: '+inter0[1])
        page=soup.select("[id~=feature-history]")[0]
        info=BeautifulSoup(str(page), "lxml").find_all('td')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.td.string
            inter0.append(comment)
        inter.append('Maxjour: '+inter0[0])
        inter.append('Maxnormal: '+inter0[1])
        inter.append('Maxrecord: '+inter0[2])
        inter.append('Max1ans: '+inter0[3])
        inter.append('Minjour: '+inter0[4])
        inter.append('Minnormal: '+inter0[5])
        inter.append('Minrecord: '+inter0[6])
        inter.append('Min1ans: '+inter0[7])
        page=soup.select("[class~=time-period]")
        info=BeautifulSoup(str(page), "lxml").find_all('li')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i).replace('<span>','').replace('</span>',''), "lxml")
            comment=soup1.li.string
            inter0.append(comment)
        inter.append(inter0[0])
        inter.append(inter0[1])
        inter.append('Duree soleil'+inter0[2].replace('Durée',''))
        inter.append(inter0[3])
        inter.append(inter0[4])
        inter.append('Duree lune'+inter0[5].replace('Durée',''))
        for i in inter:
            resultat=resultat+i+'\n'

# quart --------------------------------------------------------
    if 'morning-weather-forecast' in adress or 'afternoon-weather-forecast' in adress or 'evening-weather-forecast' in adress or 'overnight-weather-forecast' in adress :
        page=soup.select("[class~=detail-tab-panel]")[0]
        con=BeautifulSoup(str(page), "lxml").select("[class~=cond]")
        for i in con:
            cond=str(i).replace('<span class="cond">','').replace('</span>','').replace('  ','').replace('\n','').replace('\r','')
        ico=BeautifulSoup(str(page), "lxml").select("[class~=icon]")
        for i in ico:
            icone=str(i).replace('<div class="icon ','').replace('"></div>','')
        tem=str(BeautifulSoup(str(page), "lxml").select("[class~=large-temp]")[0].select("[class~=small-temp]")[0])
        temmax=str(BeautifulSoup(str(page), "lxml").select("[class~=large-temp]")[0]).replace(str(tem),'').split('>')[1].split('<')[0]
        temmin=tem.split('/')[1].split('<')[0]
        realfeet=str(BeautifulSoup(str(page), "lxml").select("[class~=small-temp]")[1]).replace('<span class="small-temp"><em>RealFeel®</em>','').replace('</span>','').split('/')
        realfeetmin=realfeet[1]
        realfeetmax=realfeet[0]
        ventd=str(BeautifulSoup(str(page), "lxml").select("[class~=wind-point]")[0]).replace('<div class="wind-point ','').replace('"></div>','')
        stat=BeautifulSoup(str(page), "lxml").select("[class~=stats]")
        ventf=str(BeautifulSoup(str(stat), "lxml").select("[class~=wind]")[0]).replace('<li class="wind">','').replace('</li>','')
        inter.append('Cond: '+cond)
        inter.append('Icone: '+icone)
        inter.append('TempMin: '+temmin)
        inter.append('TempMax: '+temmax)
        inter.append('RealFeelMin: '+realfeetmin)
        inter.append('RealFeelMax: '+realfeetmax)
        inter.append('VentD: '+ventd)
        inter.append('VentF: '+ventf)
        stat=BeautifulSoup(str(page), "lxml").find_all('strong')
        detail=['Précipitations: ','Pluie: ','Neige: ','Humidité: ','Couverture nuageuse: ','Point de rosée: ','Visibilité: ']
        x=0
        for i in stat:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.strong.string
            inter.append(detail[x]+str(comment))
            x=x+1
        for i in inter:
            resultat=resultat+i+'\n'

# CC -----------------------------------------------------------
    if 'current-weather' in adress :
        page=soup.find_all('script')
        soup1=BeautifulSoup(str(page), "lxml")
        ville=compile(" city: '(.*)',").search(str(soup1)).group(1)
        longi=compile("lon: '(.*)',").search(str(soup1)).group(1)
        lat=compile("lat: '(.*)',").search(str(soup1)).group(1)
        inter.append("Ville: "+ville)
        inter.append("Lat: "+lat)
        inter.append("Long: "+longi)
        page=soup.select("[class~=detail-tab-panel]")[0]
        cond=str(BeautifulSoup(str(page), "lxml").select("[class~=cond]")[0]).split('>')[1].split('<')[0]
        icone=str(BeautifulSoup(str(page), "lxml").select("[class~=icon]")[0]).replace('<div class="icon ','').replace('"></div>','')
        temp=str(BeautifulSoup(str(page), "lxml").select("[class~=large-temp]")[0]).split('>')[1].split('<')[0]
        realfeel=str(BeautifulSoup(str(page), "lxml").select("[class~=small-temp]")[0]).split('>')[3].split('<')[0]
        ventd=str(BeautifulSoup(str(page), "lxml").select("[class~=wind-point]")[0]).replace('<div class="wind-point ','').replace('"></div>','')
        inter.append('Cond: '+cond)
        inter.append('Icone: '+icone)
        inter.append('Temp: '+temp)
        inter.append('RealFeel:'+realfeel)
        inter.append('VentD: '+ventd)
        stat=BeautifulSoup(str(page), "lxml").find_all('strong')
        detail=['VentF: ','Humidité: ','Pression: ','Indice UV: ','Couverture nuageuse: ','Plafond: ','Point de rosée: ','Visibilité: ']
        x=0
        for i in stat:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.strong.string
            inter.append(detail[x]+str(comment))
            x=x+1
        inter.append("Alerte: RAS")
        page=soup.select("[id~=feature-history]")[0]
        info=BeautifulSoup(str(page), "lxml").find_all('td')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.td.string
            inter0.append(comment)
        inter.append('Maxjour: '+inter0[0])
        inter.append('Maxnormal: '+inter0[1])
        inter.append('Maxrecord: '+inter0[2])
        inter.append('Max1ans: '+inter0[3])
        inter.append('Minjour: '+inter0[4])
        inter.append('Minnormal: '+inter0[5])
        inter.append('Minrecord: '+inter0[6])
        inter.append('Min1ans: '+inter0[7])
        histo=soup.find(id="feature-history")
        date=histo.find_all('th')
        jour=compile("(.*)/(.*)/(.*)").search(date[4].get_text())
        inter.append("jour: "+jour.group(1))
        inter.append("mois: "+jour.group(2))
        inter.append("année: "+str(int(jour.group(3))+1))
        date=str(datetime.now()).split(' ')[1].split(':')
        inter.append("heure: "+date[0])
        inter.append("minute: "+date[1])
        inter.append("seconde: "+date[2].split('.')[0])
        inter.append(str(int(time())))
        for i in inter:
            resultat=resultat+i+'\n'
# --------------------------------------------------------------
    fiche=open(fichier, "w")
    fiche.write(resultat)
    fiche.close()
    collect()
#### fin Fonction de traitement des fichiers

#### Mise en tache de fond
def demonise(ent, id1, id2, huitHeures, nbJour, interval, nbFoisHuit, Id, demon):
    dem=time()-(60*60)
    misajour=1
    while 1 :
        date=str(datetime.now()).split(' ')[1].split(':')
        heure=time()
        if huitHeures=="oui":
            x=0
            while x<nbFoisHuit:
                h=(x*8)+int(strftime('%H', localtime()))
                x=x+1
                traitement(ent+nb1+'/hourly-weather-forecast/'+nb2+'?hour='+str(h), repsauv+"/huitHeures"+str(x), repsauv)
                print("[\033[32m OK \033[0m] huitHeures "+str(x))
        if heure-dem >= 60*60 and MAJP=="oui":
            x=0
            while x<nbJour:
                x=x+1
                traitement(ent+nb1+'/daily-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Jour"+str(x), repsauv)
                print("[\033[32m OK \033[0m] Jour "+str(x))
                if matin=="oui":
                    traitement(ent+nb1+'/morning-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Matin"+str(x), repsauv)
                    print("[\033[32m OK \033[0m] Matin "+str(x))
                if apresmidi=="oui":
                    traitement(ent+nb1+'/afternoon-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/AM"+str(x), repsauv)
                    print("[\033[32m OK \033[0m] AM "+str(x))
                if soiree=="oui":
                    traitement(ent+nb1+'/evening-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Soiree"+str(x), repsauv)
                    print("[\033[32m OK \033[0m] Soiree "+str(x))
                if nuit=="oui":
                    traitement(ent+nb1+'/overnight-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Nuit"+str(x), repsauv)
                    print("[\033[32m OK \033[0m] Nuit "+str(x))
            dem=heure
        traitement(ent+nb1+'/current-weather/'+nb2, repsauv+"/CC", repsauv)
        print("[\033[32m OK \033[0m] CC")
#        system("lunaison.py")
#        print("[\033[32m OK \033[0m] Lunaison")
        if externe is not None:
                 system(externe)
        fin=time()
        duree=fin-heure
        if notifi == "oui":
            notify2.init('Recmeteo.py')
            if heure-dem == 0:
                mess=notify2.Notification('Accuweather', "Mise a jour complete à "+str(date[0])+":"+str(date[1])+":"+str(date[2]).split('.')[0]+" en "+str(round(duree,2)).replace('.','s')+" sec", '/opt/Accuweather/icones/accuweather-logo1.png')
                mess.show()
                print("[\033[32m OK \033[0m] Mise a jour complete à "+str(date[0])+":"+str(date[1])+":"+str(date[2]).split('.')[0]+" en "+str(round(duree,2)).replace('.','s'))
            else:
                if fullnotify == "oui" :
                    mess=notify2.Notification('Accuweather', "Mise a jour partiel à "+str(date[0])+":"+str(date[1])+":"+str(date[2]).split('.')[0]+" en "+str(round(duree,2)).replace('.','s'), '/opt/Accuweather/icones/accuweather-logo1.png')
                    mess.show()
                print("[\033[32m OK \033[0m] Mise a jour partiel à "+str(date[0])+":"+str(date[1])+":"+str(date[2]).split('.')[0]+" en "+str(round(duree,2)).replace('.','s'))
        start=heure
        pause=60*interval-int(duree)
        if pause < 0:
            pause=interval
        if demon == "non":
            print("[\033[33mINFO\033[0m] Mode démon non utilisé fin de recmeteo.py")
            exit()
        collect()
        sleep(pause)
        if Id != "sans":
            if not path.exists("/proc/"+Id):
                exit()


### Initialiation de DBus pour les notifications
if notifi == "oui":
    import notify2
### Vérification répertoire
if not path.exists(repsauv):
    makedirs(repsauv)
#### Lancement du script et initialisation de la tache de fond
nb1=findall('\d+', adressWeb)[0]
nb2=findall('\d+', adressWeb)[1]
ent=adressWeb[:adressWeb.find(nb1)]
fin=adressWeb.replace(ent+nb1, "")
fin=fin.replace(fin[:fin.find(nb2)]+nb2, "")
nb2=nb2+fin
#print("[\033[33mINFO\033[0m] Recmeteo Version =", Version)
demonise(ent, nb1, nb2, huitHeures, nbJour, interval, nbFoisHuit, Id, demon)

Dernière modification par daniel38100 (Le 17/01/2017, à 22:32)

Hors ligne

#1333 Hier à 15:08

daniel38100

Re : [Conky] Alternative à weather.com (3)

Bonjour @ tous

Mise a jour du pack meteo lua de Didier-T dispo ici météo.lua meteo-lua-2.deb v1.20 MAJ:21/01/17

meteo2.lua

-- Créé par Didier-T (forum.ubuntu-fr.org)
-- Nécessite imagemagick http://apt.ubuntu.com/p/imagemagick
-- Nécessite Curl
-- utilise recmeteo.py
-- Repris par Daniel38100 Forum Ubuntu.fr a partir de 1.20 en 01/1017

require "io"
require "os"
require 'cairo'

local Version = "v1.20"
local conditionJour = {}
local conditionNuit = {}
local conditionMatin = {}
local conditionAM = {}
local conditionSoiree = {}
local conditionNoct = {}
local InfoJour = {}
local conditioncourante = {}
local huitHeures = {}
local Rep, cmd, jours, matin, apresmidi, soiree, nuit, delais, r, repsauv, l, fichier_init, MAJ, tc, dermodif, VilleAdresse, start, cmd1, ID
local Debug = "Problème Info "
local home = os.getenv("HOME")
--Liste des accents et carractère non pris en charge par les patterns
local pat="%é%è%à%ä%â%ê%ô%ç%É%È%À%Â%Ä%Ê%Ô%Ç'"


--Trouve ID
function Get_ID()
    local proc, ret
    proc=io.open("/proc/self/stat", "r")
    ret=proc:read():match("%d*")
    return ret
end

--Francisation alerte
function fran_alerte(d)
    if d:match("(attendue)") ~= nil and d:match("(entre)") ~= nil then
        d = d:gsub("entre", "au")
        d = d:gsub("attendue ", "attendue du "):gsub("attendues ", "attendues du ")
    end
    if d:match("(On s'attend à de la)") ~= nil and d:match("(entre)") ~= nil then
        d = d:gsub("entre", "et")
    end
    if d:match("(depuis)") ~= nil and d:match("(dans)") ~= nil then
        d = d:gsub("depuis", "à partir de"):gsub("jusqu'à", "à partir de")
    end

    d = d:gsub("depuis","à partir de"):gsub("tard la", "tard dans la"):gsub("lorsqu'elle deviendra de la", "se transformant en"):gsub("lorsqu'elle", "puis"):gsub("et s'accumulera de", "de"):gsub("avant de finir", "jusqu'à"):gsub("la nuit du", "dans la nuit de")

    return d
end

--Traduction date
function trad_date(d)
    local date = d
    date = date:gsub("Monday", "Lundi"):gsub("Tuesday", "Mardi"):gsub("Wednesday", "Mercredi"):gsub("Thursday", "Jeudi"):gsub("Friday", "Vendredi"):gsub("Saturday", "Samedi"):gsub("Sunday", "Dimanche")

    date = date:gsub("lun", "Lun"):gsub("mar", "Mar"):gsub("mer", "Mer"):gsub("jeu", "Jeu"):gsub("ven", "Ven"):gsub("sam", "Sam"):gsub("dim", "Dim")

    date = date:gsub("Mon", "Lun"):gsub("Tue", "Mar"):gsub("Wed", "Mer"):gsub("Thu", "Jeu"):gsub("Fri", "Ven"):gsub("Sat", "Sam"):gsub("Sun", "Dim")

    date = date:gsub("January", "Janvier"):gsub("February", "Février"):gsub("March", "Mars"):gsub("April", "Avril"):gsub("May", "Mai"):gsub("June", "Juin"):gsub("July", "Juillet"):gsub("August", "Août"):gsub("September", "Septembre"):gsub("October", "Octobre"):gsub("November", "Novembre"):gsub("December", "Décembre")

    date = date:gsub("jan", "Jan"):gsub("fev", "Fév"):gsub("mar", "Mar"):gsub("avr", "Avr"):gsub("mai", "Mai"):gsub("jui", "Jui"):gsub("aou", "Aoû"):gsub("sep", "Sep"):gsub("oct", "Oct"):gsub("nov", "Nov"):gsub("dec", "Déc")

    date = date:gsub("Feb", "Fév"):gsub("Apr", "Avr"):gsub("May", "Mai"):gsub("Jun", "Juin"):gsub("Jul", "Juil"):gsub("Aug", "Aoû"):gsub("Dec", "Déc")

    return date
end

--Vérifier l'existence d'un fichier
function existe(file)
  local a = io.open(file, "r")
  local present
  if a then
    present = true
    io.close(a)
  else
    present = false
  end
  return present
end

--Formatage des pages web
function string.formatage(ligne)
ligne = ligne:gsub("&#244;", "ô"):gsub("&#226;", "â"):gsub("&#233;", "é"):gsub("&#232;", "è"):gsub("&#224;", "à"):gsub("&#231;", "ç"):gsub("&#234;", "ê"):gsub("&#246;", "ö"):gsub("&#238;", "î"):gsub("&#239;", "ï"):gsub("&#251;", "û"):gsub("&#252;", "ü"):gsub("&#39;", "'"):gsub("Poudreries", "Bourrasques de neige"):gsub("&#201;", "É"):gsub("&#176;",""):gsub("[\n\r]",""):gsub("&eacute;", "é")
return ligne
end

--Infos lunaison
function lunaison(r)
    local s, web, Lune

    web="http://www.calendrier-lunaire.net/"
    icone="http://www.calendrier-lunaire.net/module/LYmFzaWMtODMtaDItMTQyNzI5NzY4OS40ODk2LSNmZmZmZmYtMjk1LSMwMDAwMDAtMTQyNzI5NzY4OS0xLTA.png"
    f=assert(io.popen("curl --max-time 60 --retry 3 --silent '"..web.."' | grep -A63 '\"TBdoubleColTD5\"' | sed 's/%//g'"))
    line=f:read()
    i=0
    for line in f:lines() do
        print(line)
        i=i+1
--        if i==37 then
--            icone=line:match("src=\"([%w%p]*)\"")
        if i==46 then
            ephemerides1, ephemerides2=line:formatage():match("</strong>(%a*) (%a*)</li>")
        elseif i==47 then
            Visibilite=line:match("</strong>(%d*) </li>")
        elseif i==53 then
            Phases1=line:formatage():match("title=\"([%a%p%d"..pat.."]*)\" /")
        elseif i==54 then
            Phases2=line:formatage():match("title=\"([%a%p%d"..pat.."]*)\" /")
            Phases=Phases1..", "..Phases2
        elseif i==59 then
            Noeud_lunaire=line:match("</strong>([%a%d%p%s"..pat.."]*)<img")
        elseif i==58 then
            Apogee=line:match("</strong>([%a%d%p%s"..pat.."]*)<img")
        elseif i==57 then
            Perigee=line:match("</strong>([%a%d%p%s"..pat.."]*)<img")
        elseif i==49 then
            Distance=line:match("</strong>(%d*) Km</li>")
        elseif i==50 then
            Age=line:match("</strong>([%a%d%s]*)</li>")
        elseif i==3 then
            Lever_LuneHeure, Lever_LuneMinute=line:match(": ([%d%p]*):([%d%p]*)</div>")
        elseif i==4 then
            Coucher_LuneHeure, Coucher_LuneMinute=line:match(": ([%d%p]*):([%d%p]*)</div>")
            if Coucher_LuneHeure==nil then
                Coucher_LuneHeure="N/A"
                Coucher_LuneMinute="N/A"
            end
        elseif i==51 then
            Eclipse_total=line:match("</strong> ([%a%p%d%s"..pat.."]*)</a>")
        end
    end
    f:close()
    if Noeud_lunaire:match("(%d+)") ~= nil then Noeud_lunaire = Noeud_lunaire:match("(%d+)") end

    if Apogee:match("(%d+)") ~= nil then Apogee = Apogee:match("(%d+)") end
    if Perigee:match("(%d+)") ~= nil then Perigee = Perigee:match("(%d+)") end
    ephemerides = ephemerides1.." "..ephemerides2
    Eclipse_total = datelune(Eclipse_total)
    s = "${exec wget --tries=3 -q -O "..r.."/lune.png http://www.calendrier-lunaire.net/"..icone.."}"
    conky_parse( s )
--    conky_parse( "${exec convert "..r.."/lune.png -transparent '#ffffff' "..r.."/lune.png}" )

end

function datelune(d)
    local j, m, a = d:gsub("Janvier", "01"):gsub("Février", "02"):gsub("Mars", "03"):gsub("Avril", "04"):gsub("Mais", "05"):gsub("Juin", "06"):gsub("Juillet", "07"):gsub("Août", "08"):gsub("Septembre", "09"):gsub("Octobre", "10"):gsub("Novembre", "11"):gsub("Décembre", "12"):match("le (%d+) (%d+) (%d+)")
    d = os.time{year=a, month=m, day=j}

    return d

end


--Détermine icône vent
function direction_vent(i)

    if i == "Calme" then
        return 0
    elseif i == "N" then
        return 10
    elseif i == "NNE" then
        return 11
    elseif i == "NE" then
        return 12
    elseif i == "ENE" then
        return 13
    elseif i == "E" then
        return 14
    elseif i == "ESE" then
        return 15
    elseif i == "SE" then
        return 16
    elseif i == "SSE" then
        return 17
    elseif i == "S" then
        return 2
    elseif i == "SSO" then
        return 3
    elseif i == "SO" then
        return 4
    elseif i == "OSO" then
        return 5
    elseif i == "O" then
        return 6
    elseif i == "ONO" then
        return 7
    elseif i == "NO" then
        return 8
    elseif i == "NNO" then
        return 9
    else
        return 1
    end

end


--Renvoi vent direction pleine en toute lettre
function vent_plein(d)

    local b

    if string.len(d) == 1 then
        if string.find(d, "N") ~= nil then
            b = string.gsub(d, "N", "Nord")
        elseif string.find(d, "S") ~= nil then
            b = string.gsub(d, "S", "Sud")
        elseif string.find(d, "E") ~= nil then
            b = string.gsub(d, "E", "Est")
        elseif string.find(d, "O") ~= nil then
            b = string.gsub(d, "O", "Ouest")
        end
    else
        b = d
    end

    return b

end


--Détermine l'icône vent en tenant conte de la force du vent
function icone_vent(d, fo)

    local f = tonumber(fo)
    local n

    if f <= Palier then
        n = d
    elseif f <= Palier*2 then
        n = d + 17
    elseif f <= Palier*3 then
        n = d + 34
    elseif f >= (Palier*3)+1 then
        n = d + 51
    end

    if n <= 9 then
        n = "0"..n
    end

    return n

end


--Découpage descriptions sur deux lignes
function decoupage(d)

    local l1, l2, n, p1, p2, n1, n2, l1b, l2b, dm, dp
    if string.len(d) >= 22 then
        n = math.ceil(string.len(d)/2)
        dm = string.sub(d, 1, n)
        dp = string.sub(d, n)
        p1 = string.find(dp, " ")
        local b = 1
        p2 = nil
        if string.find(dm, ' ') then
            while p2 == nil do
                b = b+1
                p2 = string.find(dm, ' ', -b)
            end
        end
        if p1 ~= nil then p1 = n+p1-1 end

        if p1 == nil and p2 == nil then p1 = string.find(d, " ") end
        if p2 == nil then p2 = p1 end
        if p1 == nil then p1 = p2 end
        if p1-n >= n-p2 then
            l1b = string.sub(d, 1, p2-1)
            l2b = string.sub(d, p2+1)
        else
            l1b = string.sub(d, 1, p1-1)
            l2b = string.sub(d, p1+1)
        end
    else
        l1b = d
        l2b = " "
    end
    n1 = math.ceil((22 - string.len(l1b))/2)
    l1 = string.rep(" ", n1)..l1b
    n2 = math.ceil((22 - string.len(l2b))/2)
    l2 = string.rep(" ", n2)..l2b

--Retour information avec espaces ligne 1 & 2 et sans espaces ligne 1 & 2
    return l1, l2, l1b, l2b

end


--initialisation paramètres
function conky_init(cfg)
    print("[\27[1;43mINFO\27[0m] "..cfg)
    notifyPartielle="oui"

    local pos1

    cfg = string.gsub(cfg, "~", home)
    cfg = string.gsub(cfg, "$HOME", home)
    fichier_init = cfg

    local file = assert(io.open(cfg, "rb") )
    local line = file:read()
    for line in file:lines() do
        pos1 = string.find(line, '#')
        if pos1 ~= nil then
            line = string.sub(line, 1, pos1-1)
        end
        pos1 = string.find(line, '=')
        if string.find(line, 'repsauv=') ~= nil then
            repsauv = string.sub(line, pos1+1)
        elseif string.find(line, 'TempShell=') ~= nil then
            r = string.sub(line, pos1+1)
        elseif string.find(line, 'repscript=') ~= nil then
            repscript = string.sub(line, pos1+1)
        elseif string.find(line, 'web=') ~= nil then
            cmd1 = string.sub(line, pos1+1)
        elseif string.find(line, 'periode=') ~= nil then
            jours = string.sub(line, pos1+1)
        elseif string.find(line, 'matinée=') ~= nil then
            matin = string.sub(line, pos1+1)
        elseif string.find(line, 'am=') ~= nil then
            apresmidi = string.sub(line, pos1+1)
        elseif string.find(line, 'soiree=') ~= nil then
            soiree = string.sub(line, pos1+1)
        elseif string.find(line, 'nuit=') ~= nil then
            nuit = string.sub(line, pos1+1)
        elseif string.find(line, 'Prev8heures=') ~= nil then
            huit = string.sub(line, pos1+1)
        elseif string.find(line, 'Palier=') ~= nil then
            Palier = tonumber(string.sub(line, pos1+1))
        elseif string.find(line, 'update=') ~= nil then
            delais = string.sub(line, pos1+1)
        elseif string.find(line, 'notify=') ~= nil then
            notify = string.sub(line, pos1+1)
        elseif string.find(line, 'nbFoisHuit=') ~= nil then
            nbFoisHuit = string.sub(line, pos1+1)
        elseif string.find(line, 'notifyPartielle=') ~= nil then
            notifyPartielle = string.sub(line, pos1+1)
        end
    end
    io.close(file)
    ID = Get_ID()
    r = r:gsub("~", home):gsub("$HOME", home)
    repsauv = repsauv:gsub("~", home):gsub("$HOME", home)
    repscript = repscript:gsub("~", home):gsub("$HOME", home)

print("", "version = "..Version.."\n", "web = "..cmd1.."\n", "Pévision Nb jours = "..jours.."\n", "Pévision Matin = "..matin.."\n", "Pévision Après Midi = "..apresmidi.."\n", "Pévision Soirée = "..soiree.."\n", "Pévision Nuit = "..nuit.."\n","Prévision sur 8 heures = "..huit.."\n","nbFoisHuit= "..nbFoisHuit.."\n", "Délais = "..delais.."\n", "Chemin de travail = "..r.."\n","Palier = "..Palier.."\n", "Chemin de sauvegarde = "..repsauv.."\n", "Chemin script = "..repscript.."\n", "Notification = "..notify.."\n", "ID = "..ID)

--Création répertoire de travail
    cmd, l = cmd1:match("([%a%p%d]*)/[%a%p]*/([%d%p%a]*)")
    l1 = cmd:match("[%a%p]*/(%a*)/%d*")

    Rep = r.."/"..l1.."/"..l
    if os.execute("cd "..Rep) ~= 0 then
        os.execute("mkdir "..r.."/"..l1.."&& mkdir "..Rep)
    end

--initialisation compteurs
    t = os.time()-delais
    tc = t
    start = 1

--Vérification existence repsauv

    if os.execute("cd "..repsauv) ~= 0 then
--création de repsauv si inexistant
        local pos1 = 1
        local chemin = nil
        local cheminsup = nil
        while pos1 ~= nil do
            pos1 = string.find(repsauv, '/', pos1+1)
            if pos1 ~= nil then
                cheminsup = string.sub(repsauv, pos1)
                chemin = string.gsub(repsauv, cheminsup, "")
            else
                cheminsup = ""
                chemin = repsauv
            end
            if os.execute("cd "..chemin) ~= 0 then
                os.execute("mkdir "..chemin)
            end
        end
    end

    start=1

    MAJ ="0"

end

--Mise à jour météo
function conky_Meteo_Maj()

    local s = '${if_gw}${lua conky_Meteo_enligne}${else}${lua conky_Meteo_horsligne}${endif}'
    conky_parse( s )
    return " "
end

--hors ligne récupération de données
function conky_Meteo_horsligne()
    local value
    if dermodif2 == nil or dermodif2 ~= conky_parse("${exec date -r "..repsauv.."/CC '+%s'}") then
        dermodif2=conky_parse("${exec date -r "..repsauv.."/CC '+%s'}")
--Récupération dernière condition courante
        local file = assert(io.open(repsauv.."/CC", "r") )
        local line = file:read()
        local i = 0
        local donee = {}
        for line in file:lines() do
            i = i+1
            donee[i] = line
        end
        io.close(file)
        local t = {"Ville", "latitude", "longitude", "Cond", "Icone", "Temp", "Tempr", "VentDir", "VentForce", "Humidite", "Pression", "Uv", "CouvNuage", "Plafond", "PointRosee", "Visibilite", "Alerte", "HistoMaxJour", "HistoMaxNormalJour", "HistoMaxRecordJour", "HistoMax1Ans", "HistoMinJour", "HistoMinNormalJour", "HistoMinRecordJour", "HistoMin1Ans", "DateJour", "DateMois", "DateAnnee"}
        i=0
        for i = 1,table.getn(t) do
            donee[i]=donee[i]:match("[%a%p%d"..pat.."]*: ([%s%a%p%d"..pat.."]*)")
            value=donee[i]:match("(%d*)")
            if value ~= "" then
                donee[i] = value
            end
            conditioncourante[t[i]] = donee[i]
        end
--Récupération de l'heure de mise a jour
        time = donee[table.getn(t)+1]
        conditioncourante.Date = os.time{year=conditioncourante.DateAnnee, month=conditioncourante.DateMois, day=conditioncourante.DateJour, hour=0}
--Traitement condition courrante
        if conditioncourante.VentDir == "CLM" then
            conditioncourante.VentDir = "Calme"
            conditioncourante.VentForce = "0"
        end
        conditioncourante.Alerte = fran_alerte(conditioncourante.Alerte)
        conditioncourante.VentIcone = icone_vent(direction_vent(conditioncourante.VentDir), conditioncourante.VentForce)
        conditioncourante.VentPlein = vent_plein(conditioncourante.VentDir)
        conditioncourante.CondMeteo1, conditioncourante.CondMeteo2, conditioncourante.CondMeteo1se, conditioncourante.CondMeteo2se = decoupage(conditioncourante.Cond)
        conditioncourante.Alerte1, conditioncourante.Alerte2, conditioncourante.Alerte1se, conditioncourante.Alerte2se = decoupage(conditioncourante.Alerte)
        print("[\27[1;42m OK \27[0m] Condition courante")

--Récupération prévision

        for j = 1,jours do
            local file = assert(io.open(repsauv.."/Jour"..j, "r"))
            local line = file:read()
            local i = 0
            local donee = {}
            for line in file:lines() do
                i = i+1
                donee[i] = line
            end
            io.close(file)
            local infojournee = {}
            local t = {"VentDirJour", "VentForceJour", "VentDirNuit", "VentForceNuit", "VentRafalesJour", "VentRafalesNuit", "UvJour", "UvNuit", "ProbOrageJour", "ProbOrageNuit", "NivPrecJour", "NivPrecNuit", "QPluieJour", "QPluieNuit", "QNeigeJour", "QNeigeNuit", "EVerglasJour", "EVerglasNuit", "HeurePrecJour", "HeurePrecNuit", "HeurePluieJour", "HeurePluieNuit", "TempJour", "TempNuit", "RealFeelJour", "RealFeelNuit", "ProbPrecJour", "ProbPrecNuit", "CondMeteoJour", "CondMeteoNuit", "IconeJour", "IconeNuit", "HistoMaxJour", "HistoMaxNormalJour", "HistoMaxRecordJour", "HistoMax1Ans", "HistoMinJour", "HistoMinNormalJour", "HistoMinRecordJour", "HistoMin1Ans", "SoleilLever", "SoleilDuree", "SoleilCoucher", "LuneLever", "LuneDuree", "LuneCoucher", "DateJour", "DateMois", "DateAnnee"}
            i=0
            for i = 1,table.getn(t) do
                donee[i]=donee[i]:match("[%a%p%d"..pat.."]*: ([%s%a%p%d"..pat.."]*)")
                if donee[i]:find(":") == nil then
                    value=donee[i]:match("(%d*)")
                    if value ~= "" then
                        donee[i] = value
                    end
                end
                infojournee[t[i]] = donee[i]
            end

--Trie des infos
            local info = {}
            local y ={"VentDirJour", "VentForceJour", "VentRafalesJour", "UvJour", "ProbOrageJour", "NivPrecJour", "QPluieJour", "QNeigeJour", "EVerglasJour", "HeurePrecJour", "HeurePluieJour", "TempJour", "RealFeelJour", "ProbPrecJour", "CondMeteoJour", "IconeJour"}
            local t = {"VentDir", "VentForce", "VentRafales", "Uv", "ProbOrage", "NivPrec", "QPluie", "QNeige", "EVerglas", "HrPrecJour", "HrPluieJour", "Temp", "TempRes", "ProbPrec", "CondMeteo",  "Icone"}
            conditionJour[j] = {}
            i=0
            for i = 1, table.getn(t) do
                info[t[i]] = infojournee[y[i]]
            end
            conditionJour[j] = info
            local info1 = {}
            local y = {"VentDirNuit", "VentForceNuit", "VentRafalesNuit", "UvNuit", "ProbOrageNuit", "NivPrecNuit", "QPluieNuit", "QNeigeNuit", "EVerglasNuit", "HeurePrecNuit", "HeurePluieNuit", "TempNuit", "RealFeelNuit", "ProbPrecNuit", "CondMeteoNuit", "IconeNuit"}
            local t = {"VentDir", "VentForce", "VentRafales", "Uv", "ProbOrage", "NivPrec", "QPluie", "QNeige", "EVerglas", "HrPrecNuit", "HrPluieNuit", "Temp", "TempRes", "ProbPrec", "CondMeteo", "Icone"}
            conditionNuit[j] = {}
            i=0
            for i = 1, table.getn(t) do
                info1[t[i]] = infojournee[y[i]]
            end
            conditionNuit[j] = info1
            local info2 = {}

            InfoJour[j] = {}
            InfoJour[j].Jour = os.time{year=infojournee.DateAnnee, month=infojournee.DateMois, day=infojournee.DateJour, hour=0}
            InfoJour[j].LeverSoleilH, InfoJour[j].LeverSoleilM = infojournee.SoleilLever:match("(%d*):(%d*)")
            InfoJour[j].CoucherSoleilH, InfoJour[j].CoucherSoleilM = infojournee.SoleilCoucher:match("(%d*):(%d*)")
            InfoJour[j].Histo_Max =infojournee.HistoMax1Ans
            InfoJour[j].Histo_Min =infojournee.HistoMin1Ans

--Traitement condition courrante
            if conditionJour[j].VentDir == "CLM" then
                conditionJour[j].VentDir = "Calme"
                conditionJour[j].VentForce = "0"
            end
            conditionJour[j].VentIcone = icone_vent(direction_vent(conditionJour[j].VentDir), conditionJour[j].VentForce)
            conditionJour[j].RafalesIcone = icone_vent(direction_vent(conditionJour[j].VentDir), conditionJour[j].VentRafales)
            conditionJour[j].VentP = vent_plein(conditionJour[j].VentDir)
            conditionJour[j].CondMeteo1, conditionJour[j].CondMeteo2, conditionJour[j].CondMeteo1se, conditionJour[j].CondMeteo2se = decoupage(conditionJour[j].CondMeteo)
            if conditionNuit[j].VentDir == "Calme" then
                conditionNuit[j].VentForce = "0"
            end
            conditionNuit[j].VentIcone = icone_vent(direction_vent(conditionNuit[j].VentDir), conditionNuit[j].VentForce)
            conditionNuit[j].RafalesIcone = icone_vent(direction_vent(conditionNuit[j].VentDir), conditionNuit[j].VentRafales)
            conditionNuit[j].VentP = vent_plein(conditionNuit[j].VentDir)
            conditionNuit[j].CondMeteo1, conditionNuit[j].CondMeteo2, conditionNuit[j].CondMeteo1se, conditionNuit[j].CondMeteo2se = decoupage(conditionNuit[j].CondMeteo)
            print("[\27[1;42m OK \27[0m] Prévision "..j)

--Récupération quart de journée
            local t = {"CondMeteo", "Icone", "TempMin", "TempMax", "TempMinR", "TempMaxR", "VentDir", "VentForce", "ProbPrec", "QPluie", "QNeige", "Humidite", "CouvNuage", "PointRosee", "Visibilite"}
            if matin == "oui" then
                local file = assert(io.open(repsauv.."/Matin"..j, "r"))
                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                conditionMatin[j] = {}
                local info3 = {}
                for i = 1,table.getn(t) do
                    donee[i]=donee[i]:match("[%a%p%d"..pat.."]*: ([%s%a%p%d"..pat.."]*)")
                    value=donee[i]:match("(%d*)")
                    if value ~= "" then
                        donee[i] = value
                    end
                    info3[t[i]] = donee[i]
                end
                conditionMatin[j] = info3
                io.close(file)
                if conditionMatin[j].VentDir == "CLM" then
                    conditionMatin[j].VentDir = "Calme"
                    conditionMatin[j].VentForce = "0"
                end
                conditionMatin[j].VentIcone = icone_vent(direction_vent(conditionMatin[j].VentDir), conditionMatin[j].VentForce)
                conditionMatin[j].VentP = vent_plein(conditionMatin[j].VentDir)
                conditionMatin[j].CondMeteo1, conditionMatin[j].CondMeteo2, conditionMatin[j].CondMeteo1se, conditionMatin[j].CondMeteo2se = decoupage(conditionMatin[j].CondMeteo)
                print("[\27[1;42m OK \27[0m] Matin "..j)
            end


            if apresmidi == "oui" then
                local file = assert(io.open(repsauv.."/AM"..j, "r"))
                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                conditionAM[j] = {}
                local info3 = {}
                for i = 1,table.getn(t) do
                    donee[i]=donee[i]:match("[%a%p%d"..pat.."]*: ([%s%a%p%d"..pat.."]*)")
                    value=donee[i]:match("(%d*)")
                    if value ~= "" then
                        donee[i] = value
                    end
                    info3[t[i]] = donee[i]
                end
                conditionAM[j] = info3
                io.close(file)
                if conditionAM[j].VentDir == "CLM" then
                    conditionAM[j].VentDir = "Calme"
                    conditionAM[j].VentForce = "0"
                end
                conditionAM[j].VentIcone = icone_vent(direction_vent(conditionAM[j].VentDir), conditionAM[j].VentForce)
                conditionAM[j].VentP = vent_plein(conditionAM[j].VentDir)
                conditionAM[j].CondMeteo1, conditionAM[j].CondMeteo2, conditionAM[j].CondMeteo1se, conditionAM[j].CondMeteo2se = decoupage(conditionAM[j].CondMeteo)
                print("[\27[1;42m OK \27[0m] Apres Midi "..j)
            end


            if soiree == "oui" then
                local file = assert(io.open(repsauv.."/Soiree"..j, "r"))
                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                io.close(file)
                conditionSoiree[j] = {}
                local info3 = {}
                for i = 1,table.getn(t) do
                    donee[i]=donee[i]:match("[%a%p%d"..pat.."]*: ([%s%a%p%d"..pat.."]*)")
                    value=donee[i]:match("(%d*)")
                    if value ~= "" then
                        donee[i] = value
                    end
                    info3[t[i]] = donee[i]
                end
                conditionSoiree[j] = info3
                if conditionSoiree[j].VentDir == "CLM" then
                    conditionSoiree[j].VentDir = "Calme"
                    conditionSoiree[j].VentForce = "0"
                end
                conditionSoiree[j].VentIcone = icone_vent(direction_vent(conditionSoiree[j].VentDir), conditionSoiree[j].VentForce)
                conditionSoiree[j].VentP = vent_plein(conditionSoiree[j].VentDir)
                conditionSoiree[j].CondMeteo1, conditionSoiree[j].CondMeteo2, conditionSoiree[j].CondMeteo1se, conditionSoiree[j].CondMeteo2se = decoupage(conditionSoiree[j].CondMeteo)
                print("[\27[1;42m OK \27[0m] Soiree "..j)
            end

            if nuit == "oui" then
                local file = assert(io.open(repsauv.."/Nuit"..j, "r"))
                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                io.close(file)
                conditionNoct[j] = {}
                local info3 = {}
                for i = 1,table.getn(t) do
                    donee[i]=donee[i]:match("[%a%p%d"..pat.."]*: ([%s%a%p%d"..pat.."]*)")
                    value=donee[i]:match("(%d*)")
                    if value ~= "" then
                        donee[i] = value
                    end
                    info3[t[i]] = donee[i]
                end
                conditionNoct[j] = info3
                if conditionNoct[j].VentDir == "CLM" then
                    conditionNoct[j].VentDir = "Calme"
                    conditionNoct[j].VentForce = "0"
                end
                conditionNoct[j].VentIcone = icone_vent(direction_vent(conditionNoct[j].VentDir), conditionNoct[j].VentForce)
                conditionNoct[j].VentP = vent_plein(conditionNoct[j].VentDir)
                conditionNoct[j].CondMeteo1, conditionNoct[j].CondMeteo2, conditionNoct[j].CondMeteo1se, conditionNoct[j].CondMeteo2se = decoupage(conditionNoct[j].CondMeteo)
                print("[\27[1;42m OK \27[0m] Nuit "..j)
            end
        end


        if huit == "oui" then
            local info4 = {}
            local info3 = {}
            for y = 1,nbFoisHuit do
                local file = assert(io.open(repsauv.."/huitHeures"..y, "r"))
                t = {"Heure", "TempMax", "TempMaxR", "Humidite", "Pluie", "Neige", "Verglas", "Vent", "UV", "CouvNuage", "PointRosee", "Icone"}

                local line = file:read()
                local i = 0
                local donee = {}
                for line in file:lines() do
                    i = i+1
                    donee[i] = line
                end
                io.close(file)
                for j = 1,8 do
                    x=j+((y-1)*8)
                    huitHeures[x] = {}
                    info3[x] = {}
                end
                x=0
                for i = 1,table.getn(t) do
                    for j = 1,8 do
                        x=x+1
                        local k=j+((y-1)*8)
                        donee[x]=donee[x]:match("[%a%p%d"..pat.."]*: ([%s%a%p%d"..pat.."]*)")
                        if i ~= 8 then
                            value=donee[x]:match("(%d*)")
                            if value ~= "" then
                                donee[x] = value
                            end
                        end
                        table.insert(info3[k],i,donee[x])
                    end
                end
            end
            for j = 1,8*nbFoisHuit do
                info4 = {}
                for i = 1,table.getn(t) do
                    info4[t[i]]=info3[j][i]
                end
                huitHeures[j]=info4
                huitHeures[j].VentForce, huitHeures[j].VentDir=huitHeures[j].Vent:match("(%d*) (%a*)")
                if huitHeures[j].VentDir == "CLM" then
                    huitHeures[j].VentDir = "Calme"
                    huitHeures[j].VentForce = "0"
                end
                huitHeures[j].VentIcone = icone_vent(direction_vent(huitHeures[j].VentDir), huitHeures[j].VentForce)
                huitHeures[j].VentP = vent_plein(huitHeures[j].VentDir)
            end
            print("[\27[1;42m OK \27[0m] huit heures")
        end

--Récupération lunaison
        local file = assert(io.open(repsauv.."/lunaison", "r"))
        local line = file:read()
        local i = 0
        local donee = {}
        for line in file:lines() do
            i = i+1
            donee[i] = line
        end
        ephemerides = donee[1]
        ephemerides1 = donee[2]
        ephemerides2 = donee[3]
        Visibilite = donee[4]
        Phases = donee[5]
        Phases1 = donee[6]
        Phases2 = donee[7]
        Noeud_lunaire = donee[8]
        Apogee = donee[9]
        Perigee = donee[10]
        Distance = donee[11]
        Age = donee[12]
        Lever_LuneHeure = donee[13]
        Lever_LuneMinute = donee[14]
        Coucher_LuneHeure = donee[15]
        Coucher_LuneMinute = donee[16]
        Eclipse_total = donee[17]
        io.close(file)


        if MAJ == "0" then
            MAJ = "1"
        else
            MAJ = "0"
        end


        collectgarbage()
    end
    return ""
end

--en ligne mise à jour
function conky_Meteo_enligne()
    if start==1 then
--      os.execute("pkill -f \"python "..repscript.."/recmeteo_python_2.py adressWeb="..cmd1.." repsauv="..repsauv.." huitHeures="..huit.." nbFoisHuit="..nbFoisHuit.." nbJour="..jours.." interval="..delais.." matin="..matin.." apresmidi="..apresmidi.." soiree="..soiree.." nuit="..nuit.." notify="..notify.."\"")
        os.execute("python3 "..repscript.."/recmeteo.py adressWeb="..cmd1.." repsauv="..repsauv.." huitHeures="..huit.." nbFoisHuit="..nbFoisHuit.." nbJour="..jours.." interval="..delais.." matin="..matin.." apresmidi="..apresmidi.." soiree="..soiree.." nuit="..nuit.." notify="..notify.." notifyPartielle="..notifyPartielle.." id="..ID.." demon=oui MAJP=oui &")
    end
    if dermodif == nil or dermodif ~= conky_parse("${exec date -r "..repsauv.."/CC '+%s'}") then
        dermodif=conky_parse("${exec date -r "..repsauv.."/CC '+%s'}")
            if 3600 <= os.difftime(os.time(), tc) or start == 1 then
                start = 2
                tc = os.time()
--                lunaison(r)
--                print("[\27[1;42m OK \27[0m] lunaison")
                if repsauv ~= nil then
--lancement sauvegarde
                    sauvegarde()
                end
            end
            conky_Meteo_horsligne()

        collectgarbage()
    end
    return " "
end


--Retour d'information météo

--Condition courrante

function conky_Meteo_IconeM(r, x, y, w, h)
    conky_fDrawImage(r.."/icone_meteo/"..conditioncourante.Icone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_TempRes()
    return conditioncourante.Tempr
end

function conky_Meteo_TempAct()
    return conditioncourante.Temp
end

function conky_Meteo_CondMeteo()
    return conditioncourante.Cond
end

function conky_Meteo_CondMeteo1()
    return conditioncourante.CondMeteo1
end

function conky_Meteo_CondMeteo2()
    return conditioncourante.CondMeteo2
end

function conky_Meteo_CondMeteo1se()
    return conditioncourante.CondMeteo1se
end

function conky_Meteo_CondMeteo2se()
    return conditioncourante.CondMeteo2se
end

function conky_Meteo_Alerte()
    return conditioncourante.Alerte
end

function conky_Meteo_Alerte1()
    return conditioncourante.Alerte1
end

function conky_Meteo_Alerte2()
    return conditioncourante.Alerte2
end

function conky_Meteo_Alerte1se()
    return conditioncourante.Alerte1se
end

function conky_Meteo_Alerte2se()
    return conditioncourante.Alerte2se
end

function conky_Meteo_VentDir()
    return conditioncourante.VentDir
end

function conky_Meteo_VentDirP()
    return conditioncourante.VentPlein
end

function conky_Meteo_VentForce()
    return conditioncourante.VentForce
end

function conky_Meteo_IconeV(r, x, y, w, h)
    conky_fDrawImage(r.."/vent/"..conditioncourante.VentIcone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_Humidite()
    return tonumber(conditioncourante.Humidite)
end

function conky_Meteo_Rose()
    return tonumber(conditioncourante.PointRosee)
end

function conky_Meteo_Pression()
    return tonumber(conditioncourante.Pression)
end

function conky_Meteo_Visibilite()
    return tonumber(conditioncourante.Visibilite)
end

function conky_Meteo_Date(format)
    format = string.gsub(format, "_", " ")
    return trad_date(os.date(format, conditioncourante.Date))
end

function conky_Meteo_Ville()
    return conditioncourante.Ville
end

function conky_Meteo_CouvNuage()
    return tonumber(conditioncourante.CouvNuage)
end

function conky_Meteo_Uv()
    return conditioncourante.Uv
end

function conky_Meteo_latitude()
    return conditioncourante.latitude
end

function conky_Meteo_longitude()
    return conditioncourante.longitude
end

function conky_Meteo_Heure()
    return os.date("%H")
end

function conky_Meteo_Minute()
    return os.date("%M")
end


--Prévision Météo

--Jour

function conky_Meteo_Jour_CondMeteo(j)
    return conditionJour[tonumber(j)].CondMeteo
end

function conky_Meteo_Jour_CondMeteo1(j)
    return conditionJour[tonumber(j)].CondMeteo1
end

function conky_Meteo_Jour_CondMeteo2(j)
    return conditionJour[tonumber(j)].CondMeteo2
end

function conky_Meteo_Jour_CondMeteo1se(j)
    return conditionJour[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Jour_CondMeteo2se(j)
    return conditionJour[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Jour_Temp(j)
    return tonumber(conditionJour[tonumber(j)].Temp)
end

function conky_Meteo_Jour_TempRes(j)
    return tonumber(conditionJour[tonumber(j)].TempRes)
end

function conky_Meteo_Jour_ProbPrec(j)
    return tonumber(conditionJour[tonumber(j)].ProbPrec)
end

function conky_Meteo_Jour_VentDir(j)
    return conditionJour[tonumber(j)].VentDir
end

function conky_Meteo_Jour_VentDirP(j)
    return conditionJour[tonumber(j)].VentP
end

function conky_Meteo_Jour_VentForce(j)
    return tonumber(conditionJour[tonumber(j)].VentForce)
end

function conky_Meteo_Jour_VentRafales(j)
    return tonumber(conditionJour[tonumber(j)].VentRafales)
end

function conky_Meteo_Jour_Uv(j)
    return tonumber(conditionJour[tonumber(j)].Uv)
end

function conky_Meteo_Jour_ProbOrage(j)
    return tonumber(conditionJour[tonumber(j)].ProbOrage)
end

function conky_Meteo_Jour_NivPrec(j)
    return tonumber(conditionJour[tonumber(j)].NivPrec)
end

function conky_Meteo_Jour_QPluie(j)
    return tonumber(conditionJour[tonumber(j)].QPluie)
end

function conky_Meteo_Jour_QNeige(j)
    return tonumber(conditionJour[tonumber(j)].QNeige)
end

function conky_Meteo_Jour_EVerglas(j)
    return tonumber(conditionJour[tonumber(j)].EVerglas)
end

function conky_Meteo_Jour_IconeM(r, x, y, w, h, j)
    conky_fDrawImage(r.."/icone_meteo/"..conditionJour[tonumber(j)].Icone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_Jour_IconeV(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..conditionJour[tonumber(j)].VentIcone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_Jour_IconeR(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..conditionJour[tonumber(j)].RafalesIcone..".png", x, y, w, h)
    return ""
end


--Nuit

function conky_Meteo_Nuit_CondMeteo(j)
    return conditionNuit[tonumber(j)].CondMeteo
end

function conky_Meteo_Nuit_CondMeteo1(j)
    return conditionNuit[tonumber(j)].CondMeteo1
end

function conky_Meteo_Nuit_CondMeteo2(j)
    return conditionNuit[tonumber(j)].CondMeteo2
end

function conky_Meteo_Nuit_CondMeteo1se(j)
    return conditionNuit[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Nuit_CondMeteo2se(j)
    return conditionNuit[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Nuit_Temp(j)
    return tonumber(conditionNuit[tonumber(j)].Temp)
end

function conky_Meteo_Nuit_TempRes(j)
    return tonumber(conditionNuit[tonumber(j)].TempRes)
end

function conky_Meteo_Nuit_ProbPrec(j)
    return tonumber(conditionNuit[tonumber(j)].ProbPrec)
end

function conky_Meteo_Nuit_VentDir(j)
    return conditionNuit[tonumber(j)].VentDir
end

function conky_Meteo_Nuit_VentDirP(j)
    return conditionNuit[tonumber(j)].VentP
end

function conky_Meteo_Nuit_VentForce(j)
    return tonumber(conditionNuit[tonumber(j)].VentForce)
end

function conky_Meteo_Nuit_VentRafales(j)
    return tonumber(conditionNuit[tonumber(j)].VentRafales)
end

function conky_Meteo_Nuit_ProbOrage(j)
    return tonumber(conditionNuit[tonumber(j)].ProbOrage)
end

function conky_Meteo_Nuit_NivPrec(j)
    return tonumber(conditionNuit[tonumber(j)].NivPrec)
end

function conky_Meteo_Nuit_QPluie(j)
    return tonumber(conditionNuit[tonumber(j)].QPluie)
end

function conky_Meteo_Nuit_QNeige(j)
    return tonumber(conditionNuit[tonumber(j)].QNeige)
end

function conky_Meteo_Nuit_EVerglas(j)
    return tonumber(conditionNuit[tonumber(j)].EVerglas)
end

function conky_Meteo_Nuit_IconeM(r, x, y, w, h, j)
    conky_fDrawImage(r.."/icone_meteo/"..conditionNuit[tonumber(j)].Icone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_Nuit_IconeV(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..conditionNuit[tonumber(j)].VentIcone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_Nuit_IconeR(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..conditionNuit[tonumber(j)].RafalesIcone..".png", x, y, w, h)
    return ""
end


--Infos sur la journée

function conky_Meteo_Jour(format, j)
    format = string.gsub(format, "_", " ")
    return trad_date(os.date(format, InfoJour[tonumber(j)].Jour))
end

function conky_Meteo_HLeverSoleil(j)
    return InfoJour[tonumber(j)].LeverSoleilH
end

function conky_Meteo_MLeverSoleil(j)
    return InfoJour[tonumber(j)].LeverSoleilM
end

function conky_Meteo_LeverSoleil(j)
    return tonumber((InfoJour[tonumber(j)].LeverSoleilH*60)+InfoJour[tonumber(j)].LeverSoleilM)
end

function conky_Meteo_HCoucherSoleil(j)
    return InfoJour[tonumber(j)].CoucherSoleilH
end

function conky_Meteo_MCoucherSoleil(j)
    return InfoJour[tonumber(j)].CoucherSoleilM
end

function conky_Meteo_CoucherSoleil(j)
    return tonumber((InfoJour[tonumber(j)].CoucherSoleilH*60)+InfoJour[tonumber(j)].CoucherSoleilM)
end

function conky_Meteo_HDureeJour(j)
    return InfoJour[tonumber(j)].CoucherSoleilH-InfoJour[tonumber(j)].LeverSoleilH
end

function conky_Meteo_MDureeJour(j)
    return os.date("%M", ((((InfoJour[tonumber(j)].CoucherSoleilH*3600)-3600)+(InfoJour[tonumber(j)].CoucherSoleilM*60))-(((InfoJour[tonumber(j)].LeverSoleilH*3600))+(InfoJour[tonumber(j)].LeverSoleilM*60))))
end

function conky_Meteo_Histo_Min(j)
    return InfoJour[tonumber(j)].Histo_Min
end

function conky_Meteo_Histo_Max(j)
    return InfoJour[tonumber(j)].Histo_Max
end


--Matin

function conky_Meteo_Matin_CondMeteo(j)
    return conditionMatin[tonumber(j)].CondMeteo
end

function conky_Meteo_Matin_CondMeteo1(j)
    return conditionMatin[tonumber(j)].CondMeteo1
end

function conky_Meteo_Matin_CondMeteo2(j)
    return conditionMatin[tonumber(j)].CondMeteo2
end

function conky_Meteo_Matin_CondMeteo1se(j)
    return conditionMatin[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Matin_CondMeteo2se(j)
    return conditionMatin[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Matin_TempMax(j)
    return tonumber(conditionMatin[tonumber(j)].TempMax)
end

function conky_Meteo_Matin_TempMin(j)
    return tonumber(conditionMatin[tonumber(j)].TempMin)
end

function conky_Meteo_Matin_TempMaxRes(j)
    return tonumber(conditionMatin[tonumber(j)].TempMaxR)
end

function conky_Meteo_Matin_TempMinRes(j)
    return tonumber(conditionMatin[tonumber(j)].TempMinR)
end

function conky_Meteo_Matin_ProbPrec(j)
    return tonumber(conditionMatin[tonumber(j)].ProbPrec)
end

function conky_Meteo_Matin_VentDir(j)
    return conditionMatin[tonumber(j)].VentDir
end

function conky_Meteo_Matin_VentDirP(j)
    return conditionMatin[tonumber(j)].VentP
end

function conky_Meteo_Matin_VentForce(j)
    return tonumber(conditionMatin[tonumber(j)].VentForce)
end

function conky_Meteo_Matin_QPluie(j)
    return tonumber(conditionMatin[tonumber(j)].QPluie)
end

function conky_Meteo_Matin_QNeige(j)
    return tonumber(conditionMatin[tonumber(j)].QNeige)
end

function conky_Meteo_Matin_Humidite(j)
    return tonumber(conditionMatin[tonumber(j)].Humidite)
end

function conky_Meteo_Matin_CouvNuage(j, r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditionMatin[tonumber(j)].CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_Matin_Rose(j)
    return tonumber(conditionMatin[tonumber(j)].PointRosee)
end

function conky_Meteo_Matin_Visibilite(j)
    return tonumber(conditionMatin[tonumber(j)].Visibilite)
end

function conky_Meteo_Matin_IconeM(r, x, y, w, h, j)
    conky_fDrawImage(r.."/icone_meteo/"..conditionMatin[tonumber(j)].Icone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_Matin_IconeV(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..conditionMatin[tonumber(j)].VentIcone..".png", x, y, w, h)
    return ""
end


--Après Midi

function conky_Meteo_AM_CondMeteo(j)
    return conditionAM[tonumber(j)].CondMeteo
end

function conky_Meteo_AM_CondMeteo1(j)
    return conditionAM[tonumber(j)].CondMeteo1
end

function conky_Meteo_AM_CondMeteo2(j)
    return conditionAM[tonumber(j)].CondMeteo2
end

function conky_Meteo_AM_CondMeteo1se(j)
    return conditionAM[tonumber(j)].CondMeteo1se
end

function conky_Meteo_AM_CondMeteo2se(j)
    return conditionAM[tonumber(j)].CondMeteo2se
end

function conky_Meteo_AM_TempMax(j)
    return tonumber(conditionAM[tonumber(j)].TempMax)
end

function conky_Meteo_AM_TempMin(j)
    return tonumber(conditionAM[tonumber(j)].TempMin)
end

function conky_Meteo_AM_TempMaxRes(j)
    return tonumber(conditionAM[tonumber(j)].TempMaxR)
end

function conky_Meteo_AM_TempMinRes(j)
    return tonumber(conditionAM[tonumber(j)].TempMinR)
end

function conky_Meteo_AM_ProbPrec(j)
    return tonumber(conditionAM[tonumber(j)].ProbPrec)
end

function conky_Meteo_AM_VentDir(j)
    return conditionAM[tonumber(j)].VentDir
end

function conky_Meteo_AM_VentDirP(j)
    return conditionAM[tonumber(j)].VentP
end

function conky_Meteo_AM_VentForce(j)
    return tonumber(conditionAM[tonumber(j)].VentForce)
end

function conky_Meteo_AM_QPluie(j)
    return tonumber(conditionAM[tonumber(j)].QPluie)
end

function conky_Meteo_AM_QNeige(j)
    return tonumber(conditionAM[tonumber(j)].QNeige)
end

function conky_Meteo_AM_Humidite(j)
    return tonumber(conditionAM[tonumber(j)].Humidite)
end

function conky_Meteo_AM_CouvNuage(j, r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditionAM[tonumber(j)].CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_AM_Rose(j)
    return tonumber(conditionAM[tonumber(j)].PointRosee)
end

function conky_Meteo_AM_Visibilite(j)
    return tonumber(conditionAM[tonumber(j)].Visibilite)
end

function conky_Meteo_AM_IconeM(r, x, y, w, h, j)
    conky_fDrawImage(r.."/icone_meteo/"..conditionAM[tonumber(j)].Icone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_AM_IconeV(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..conditionAM[tonumber(j)].VentIcone..".png", x, y, w, h)
    return ""
end


--Soirée

function conky_Meteo_Soiree_CondMeteo(j)
    return conditionSoiree[tonumber(j)].CondMeteo
end

function conky_Meteo_Soiree_CondMeteo1(j)
    return conditionSoiree[tonumber(j)].CondMeteo1
end

function conky_Meteo_Soiree_CondMeteo2(j)
    return conditionSoiree[tonumber(j)].CondMeteo2
end

function conky_Meteo_Soiree_CondMeteo1se(j)
    return conditionSoiree[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Soiree_CondMeteo2se(j)
    return conditionSoiree[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Soiree_TempMax(j)
    return tonumber(conditionSoiree[tonumber(j)].TempMax)
end

function conky_Meteo_Soiree_TempMin(j)
    return tonumber(conditionSoiree[tonumber(j)].TempMin)
end

function conky_Meteo_Soiree_TempMaxRes(j)
    return tonumber(conditionSoiree[tonumber(j)].TempMaxR)
end

function conky_Meteo_Soiree_TempMinRes(j)
    return tonumber(conditionSoiree[tonumber(j)].TempMinR)
end

function conky_Meteo_Soiree_ProbPrec(j)
    return tonumber(conditionSoiree[tonumber(j)].ProbPrec)
end

function conky_Meteo_Soiree_VentDir(j)
    return conditionSoiree[tonumber(j)].VentDir
end

function conky_Meteo_Soiree_VentDirP(j)
    return conditionSoiree[tonumber(j)].VentP
end

function conky_Meteo_Soiree_VentForce(j)
    return tonumber(conditionSoiree[tonumber(j)].VentForce)
end

function conky_Meteo_Soiree_QPluie(j)
    return tonumber(conditionSoiree[tonumber(j)].QPluie)
end

function conky_Meteo_Soiree_QNeige(j)
    return tonumber(conditionSoiree[tonumber(j)].QNeige)
end

function conky_Meteo_Soiree_Humidite(j)
    return tonumber(conditionSoiree[tonumber(j)].Humidite)
end

function conky_Meteo_Soiree_CouvNuage(j, r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditionSoiree[tonumber(j)].CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_Soiree_Rose(j)
    return tonumber(conditionSoiree[tonumber(j)].PointRosee)
end

function conky_Meteo_Soiree_Visibilite(j)
    return tonumber(conditionSoiree[tonumber(j)].Visibilite)
end

function conky_Meteo_Soiree_IconeM(r, x, y, w, h, j)
    conky_fDrawImage(r.."/icone_meteo/"..conditionSoiree[tonumber(j)].Icone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_Soiree_IconeV(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..conditionSoiree[tonumber(j)].VentIcone..".png", x, y, w, h)
    return ""
end


--Nuit

function conky_Meteo_Noct_CondMeteo(j)
    return conditionNoct[tonumber(j)].CondMeteo
end

function conky_Meteo_Noct_CondMeteo1(j)
    return conditionNoct[tonumber(j)].CondMeteo1
end

function conky_Meteo_Noct_CondMeteo2(j)
    return conditionNoct[tonumber(j)].CondMeteo2
end

function conky_Meteo_Noct_CondMeteo1se(j)
    return conditionNoct[tonumber(j)].CondMeteo1se
end

function conky_Meteo_Noct_CondMeteo2se(j)
    return conditionNoct[tonumber(j)].CondMeteo2se
end

function conky_Meteo_Noct_TempMax(j)
    return tonumber(conditionNoct[tonumber(j)].TempMax)
end

function conky_Meteo_Noct_TempMin(j)
    return tonumber(conditionNoct[tonumber(j)].TempMin)
end

function conky_Meteo_Noct_TempMaxRes(j)
    return tonumber(conditionNoct[tonumber(j)].TempMaxR)
end

function conky_Meteo_Noct_TempMinRes(j)
    return tonumber(conditionNoct[tonumber(j)].TempMinR)
end

function conky_Meteo_Noct_ProbPrec(j)
    return tonumber(conditionNoct[tonumber(j)].ProbPrec)
end

function conky_Meteo_Noct_VentDir(j)
    return conditionNoct[tonumber(j)].VentDir
end

function conky_Meteo_Noct_VentDirP(j)
    return conditionNoct[tonumber(j)].VentP
end

function conky_Meteo_Noct_VentForce(j)
    return tonumber(conditionNoct[tonumber(j)].VentForce)
end

function conky_Meteo_Noct_QPluie(j)
    return tonumber(conditionNoct[tonumber(j)].QPluie)
end

function conky_Meteo_Noct_QNeige(j)
    return tonumber(conditionNoct[tonumber(j)].QNeige)
end

function conky_Meteo_Noct_Humidite(j)
    return tonumber(conditionNoct[tonumber(j)].Humidite)
end

function conky_Meteo_Noct_CouvNuage(j, r)
    if r == nil then r = 100 end
    local Couv = (tonumber(conditionNoct[tonumber(j)].CouvNuage) / 100) * r
    if Couv - math.floor(Couv) <= 0.5 then
        Couv = math.floor(Couv)
    else
        Couv = math.ceil(Couv)
    end
    return Couv
end

function conky_Meteo_Noct_Rose(j)
    return tonumber(conditionNoct[tonumber(j)].PointRosee)
end

function conky_Meteo_Noct_Visibilite(j)
    return tonumber(conditionNoct[tonumber(j)].Visibilite)
end

function conky_Meteo_Noct_IconeM(r, x, y, w, h, j)
    conky_fDrawImage(r.."/icone_meteo/"..conditionNoct[tonumber(j)].Icone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_Noct_IconeV(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..conditionNoct[tonumber(j)].VentIcone..".png", x, y, w, h)
    return ""
end

--Huit prochaines heures


function conky_Meteo_huitHeures_VentDirP(j)
    return huitHeures[tonumber(j)].VentP
end

function conky_Meteo_huitHeures_IconeV(r, x, y, w, h, j)
    conky_fDrawImage(r.."/vent/"..huitHeures[tonumber(j)].VentIcone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_huitHeures_Heure(j)
    return tonumber(huitHeures[tonumber(j)].Heure)
end

function conky_Meteo_huitHeures_IconeM(r, x, y, w, h, j)
    conky_fDrawImage(r.."/icone_meteo/"..huitHeures[tonumber(j)].Icone..".png", x, y, w, h)
    return ""
end

function conky_Meteo_huitHeures_Temp(j)
    return tonumber(huitHeures[tonumber(j)].TempMax)
end

function conky_Meteo_huitHeures_TempR(j)
    return tonumber(huitHeures[tonumber(j)].TempMaxR)
end

function conky_Meteo_huitHeures_VentDir(j)
    return huitHeures[tonumber(j)].VentDir
end

function conky_Meteo_huitHeures_VentForce(j)
    return tonumber(huitHeures[tonumber(j)].VentForce)
end

function conky_Meteo_huitHeures_Humidite(j)
    return tonumber(huitHeures[tonumber(j)].Humidite)
end

function conky_Meteo_huitHeures_CouvNuage(j)
    return tonumber(huitHeures[tonumber(j)].CouvNuage)
end

function conky_Meteo_huitHeures_Rose(j)
    return tonumber(huitHeures[tonumber(j)].PointRosee)
end

function conky_Meteo_huitHeures_ProbPluie(j)
    return tonumber(huitHeures[tonumber(j)].Pluie)
end

function conky_Meteo_huitHeures_ProbNeige(j)
    return tonumber(huitHeures[tonumber(j)].Neige)
end

function conky_Meteo_huitHeures_ProbVerglas(j)
    return tonumber(huitHeures[tonumber(j)].Verglas)
end

function conky_Meteo_huitHeures_Uv(j)
    return tonumber(huitHeures[tonumber(j)].UV)
end

--Lunaison

function conky_Lune_ephemerides()
    return ephemerides
end

function conky_Lune_ephemerides1()
    return ephemerides1
end

function conky_Lune_ephemerides2()
    return ephemerides2
end

function conky_Lune_Visibilite()
    return Visibilite
end

function conky_Lune_Phases()
    return Phases
end

function conky_Lune_Phases1()
    return Phases1
end

function conky_Lune_Phases2()
    return Phases2
end

function conky_Lune_Noeudlunaire()
    return Noeud_lunaire
end

function conky_Lune_Apogee()
    return Apogee
end

function conky_Lune_Perigee()
    return Perigee
end

function conky_Lune_Distance()
    return Distance
end

function conky_Lune_Age()
    return Age
end

function conky_Lune_HLeverLune()
    return Lever_LuneHeure
end

function conky_Lune_MLeverLune()
    return Lever_LuneMinute
end

function conky_Lune_HCoucherLune()
    return Coucher_LuneHeure
end

function conky_Lune_MCoucherLune()
    return Coucher_LuneMinute
end

function conky_Lune_EclipseTotal()
    if format == nil then format = "%A_%d_%B_%Y_à_%H:%M" end
    format = string.gsub(format, "_", " ")
    return trad_date(os.date(format, Eclipse_total))
end

--Fonction d'affichage
function conky_fDrawImage(path,x,y,w,h,arc)

    path = string.gsub(path, "~", home)
    path = string.gsub(path, "$HOME", home)

    local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)

    local function fDrawImage(path,x,y,w,h,arc)
        x=x+(w/2)
        y=y+(h/2)
        local img =  cairo_image_surface_create_from_png(path)
        local w_img, h_img = cairo_image_surface_get_width (img), cairo_image_surface_get_height (img)

        local cr = cairo_create (cs)
        cairo_translate (cr, x, y)

        if arc then
            cairo_rotate (cr, arc)
        end

        cairo_scale (cr, w/w_img, h/h_img)
        cairo_set_source_surface (cr, img, -w_img/2, -h_img/2)
        cairo_paint (cr)
        cairo_destroy(cr)
        cairo_surface_destroy (img)
    end
    fDrawImage(path,x,y,w,h,arc)
    cairo_surface_destroy(cs)
    return ""
end


--Informations sur le lua
function conky_Version()
    return Version
end

function conky_Meteo_fichier_init()
    return fichier_init
end

function conky_Meteo_etat_MAJ()
    return MAJ
end


--Sauvegarde des données
function sauvegarde()

--[[sauvegarde lunaison
    local file = assert(io.open(repsauv.."/lunaison", "w+"))
    file:write ("\n", ephemerides, "\n")
    file:write (ephemerides1, "\n")
    file:write (ephemerides2, "\n")
    file:write (Visibilite, "\n")
    file:write (Phases, "\n")
    file:write (Phases1, "\n")
    file:write (Phases2, "\n")
    file:write (Noeud_lunaire, "\n")
    file:write (Apogee, "\n")
    file:write (Perigee, "\n")
    file:write (Distance, "\n")
    file:write (Age, "\n")
    file:write (Lever_LuneHeure, "\n")
    file:write (Lever_LuneMinute, "\n")
    file:write (Coucher_LuneHeure, "\n")
    file:write (Coucher_LuneMinute, "\n")
    file:write (Eclipse_total, "\n")
    io.close(file)
]]--
--modification des droits utilisateur
--    os.execute('chmod o+rw- '..r..'/*lun*')
    os.execute('chmod -R o+rw- '..repsauv)
    os.execute('chmod -R o+rw- '..Rep)
end

recmeteo.py

#! /usr/bin/python3
# -*- coding: utf-8 -*-
# Par Didier-T Forum Ubuntu.fr
# Ajout notification par jpdipsy Forum Ubuntu.fr
# Ajout notification via DBus par ti_tux Forum Ubuntu.fr
# Ajout création repsauv si inexistant par jpdipsy Forum Ubuntu.fr
# Repris par Daniel38100 Forum Ubuntu.fr a partir de 2.00a en 01/1017


from socket import timeout
from urllib.request import Request, urlopen, URLError
from os import path, makedirs, system
from time import time, sleep, strftime, localtime
from re import search, compile, findall
from sys import argv
from gc import collect
from bs4 import BeautifulSoup, Tag, NavigableString
from datetime import date, datetime


Version='2.00a'

homedir=path.expanduser('~')

#### initialisation des variables
adressWeb="http://www.accuweather.com/fr/fr/belfort/133341/daily-weather-forecast/133341"
repsauv="~/essais"
huitHeures="oui"
nbFoisHuit=1
matin="oui"
apresmidi="oui"
soiree="oui"
nuit="oui"
nbJour=1
interval=30
notifi="oui"
externe=None
Id="sans"
demon="non"
fullnotify="non"
MAJP="oui"
lune="oui"

for a in argv:
    if search("adressWeb=", a) is not None:
        adressWeb=compile("adressWeb=(.*)").search(a).group(1)
    if search("repsauv=", a) is not None:
        repsauv=compile("repsauv=(.*)").search(a).group(1)
    if search("huitHeures=", a) is not None:
        huitHeures=compile("huitHeures=(.*)").search(a).group(1)
    if search("nbJour=", a) is not None:
        nbJour=compile("nbJour=(.*)").search(a).group(1)
    if search("interval=", a) is not None:
        interval=compile("interval=(.*)").search(a).group(1)
    if search("notify=", a) is not None:
        notifi=compile("notify=(.*)").search(a).group(1)
    if search("notifyPartielle=", a) is not None:
        fullnotify=compile("notifyPartielle=(.*)").search(a).group(1)
    if search("matin=", a) is not None:
        matin=compile("matin=(.*)").search(a).group(1)
    if search("apresmidi=", a) is not None:
        apresmidi=compile("apresmidi=(.*)").search(a).group(1)
    if search("soiree=", a) is not None:
        soiree=compile("soiree=(.*)").search(a).group(1)
    if search("nuit=", a) is not None:
        nuit=compile("nuit=(.*)").search(a).group(1)
    if search("externe=", a) is not None:
        externe=compile("externe=(.*)").search(a).group(1)
    if search("nbFoisHuit=", a) is not None:
        nbFoisHuit=compile("nbFoisHuit=(.*)").search(a).group(1)
    if search("id=", a) is not None:
        Id=compile("id=(.*)").search(a).group(1)
    if search("demon=", a) is not None:
        demon=compile("demon=(.*)").search(a).group(1)
    if search("MAJP=", a) is not None:
        MAJP=compile("MAJP=(.*)").search(a).group(1)

nbJour=int(nbJour)
interval=int(interval)
repsauv=repsauv.replace("~", homedir)
notifi=str.lower(notifi)
fullnotify==str.lower(fullnotify)
huitHeures=str.lower(huitHeures)
nbFoisHuit=int(nbFoisHuit)
MAJP=str(MAJP)

#### fin initialisation des variables

#### Fonction de traitement des fichiers
def traitement(adress, fichier, repsauv):
    current_balise=None
    x=1
    user_agent='Mozilla/5.0 (X11; Linux x86_64)'
    headers={ 'User-Agent' : user_agent }
    while current_balise is None:
        response=None
        while response is None:
            try:
                html_page=urlopen(adress, timeout=10)
            except (URLError) as error:
                print("[\033[31mFAIL\033[0m] HTML ", error)
            except timeout:
                print("[\033[31mFAIL\033[0m] erreur timeout acces HTML")
            else:
                try:
                    currentCond=html_page.read()
                except (URLError) as error:
                    print("[\033[31mFAIL\033[0m] Lecture page ", error)
                except timeout:
                    print("[\033[31mFAIL\033[0m] erreur timeout lecture page")
                else:
#                    print("[\033[32m OK \033[0m] "+adress)
                    response="ok"
            if response is None:
                sleep(10)
        current_balise=1
    soup=BeautifulSoup(currentCond, "lxml")
    resultat='\n'
    inter=[]
#  Huit Heures -----------------------------------------------------
    if 'hourly-weather-forecast' in adress :
        page=soup.select("[class~=overview-hourly]")[0].find_all('td')+soup.select("[class~=precip-hourly]")[0].find_all('td')+soup.select("[class~=sky-hourly]")[0].find_all('td')
        info=BeautifulSoup(str(page), "lxml").find_all('div')+BeautifulSoup(str(page), "lxml").find_all('span')
        suppr='<div class='
        detail=['Heure','','','Temp°','RealFeel®','Vent (km/h)','Pluie','Neige','Verglas','Indice UV','Couverture nuageuse','Humidité','Point de rosée','Icone']
        for i in info :
            if suppr in str(i) :
                result=str(i).replace(str(i),'')
            else :
                result=str(i).replace('</span>','').replace('<span>','').replace('</div>','').replace('<div>','')
                inter.append(result)
        ico=BeautifulSoup(str(page), "lxml").select("[class~=icon]")
        x=1
        for i in ico:
            icone=str(i).replace('<div class="icon-weather icon i-','').replace('"></div>','')
            x=x+1
            inter.append(icone)
        y=0
        for i in detail:
            x=1
            while x<9 :
                if i == '' :
                    x=x+1
                    y=y+1
                else :
                    resultat=resultat+str(i)+str(x)+': '+inter[y]+'\n'
                    y=y+1
                    x=x+1
# Jour ---------------------------------------------------------
    if 'daily-weather-forecast' in adress :
        page=soup.select("[class~=detail-tab-panel]")[0]
        page=str(page).replace('<span class="setting">Mx</span>','').replace('<span class="setting">Mi</span>','')
        info=BeautifulSoup(str(page), "lxml").find_all('strong')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.strong.string
            inter0.append(comment)
        inter.append('VentD jour: '+inter0[0].split(' ')[0].replace('W','O'))
        inter.append('VentF jour: '+inter0[0].split(' ')[1]+'km/h')
        inter.append('VentD nuit: '+inter0[10].split(' ')[0])
        inter.append('VentF nuit: '+inter0[10].split(' ')[1]+'km/h')
        inter.append('Rafale jour:'+inter0[1])
        inter.append('Rafale nuit:'+inter0[11])
        inter.append('UV jour: '+inter0[2])
        inter.append('UV nuit: '+inter0[12])
        inter.append('Prob orage jour: '+inter0[3])
        inter.append('Prob orage nuit: '+inter0[13])
        inter.append('Précipitations jour: '+inter0[4])
        inter.append('Précipitations nuit: '+inter0[14])
        inter.append('Pluie jour: '+inter0[5])
        inter.append('Pluie nuit: '+inter0[15])
        inter.append('Neige jour: '+inter0[6])
        inter.append('Neige nuit: '+inter0[16])
        inter.append('Verglas jour: '+inter0[7])
        inter.append('Verglas nuit: '+inter0[17])
        inter.append('Heures de précipitations jour: '+inter0[8])
        inter.append('Heures de précipitations nuit: '+inter0[18])
        inter.append('Heures de pluie jour: '+inter0[9])
        inter.append('Heures de pluie nuit: '+inter0[19])
        info=BeautifulSoup(str(page), "lxml").find_all('span')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.span.string
            inter0.append(comment)
        inter.append('Temp jour: '+inter0[0])
        inter.append('Temp nuit: '+inter0[3])
        inter.append('Temp ress jour:'+inter0[1].replace('RealFeel®',''))
        inter.append('Temp ress nuit:'+inter0[4].replace('RealFeel®',''))
        inter.append('Prob précipitations jour:'+inter0[2].replace('Précipitations',''))
        inter.append('Prob précipitations nuit:'+inter0[5].replace('Précipitations',''))
        con=BeautifulSoup(str(page), "lxml").select("[class~=cond]")
        inter0=[]
        for i in con:
            cond=str(i).replace('<div class="cond">','').replace('</div>','').replace('  ','').replace('\n','').replace('\r','')
            inter0.append(cond)
        inter.append('Cond_jour: '+inter0[0])
        inter.append('Cond_nuit: '+inter0[1])
        ico=BeautifulSoup(str(page), "lxml").select("[class~=icon]")
        inter0=[]
        for i in ico:
            icone=str(i).replace('<div class="icon i-','').replace('"></div>','')
            inter0.append(icone)
        inter.append('Icone jour: '+inter0[0])
        inter.append('Icone nuit: '+inter0[1])
        page=soup.select("[id~=feature-history]")[0]
        info=BeautifulSoup(str(page), "lxml").find_all('td')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.td.string
            inter0.append(comment)
        inter.append('Maxjour: '+inter0[0])
        inter.append('Maxnormal: '+inter0[1])
        inter.append('Maxrecord: '+inter0[2])
        inter.append('Max1ans: '+inter0[3])
        inter.append('Minjour: '+inter0[4])
        inter.append('Minnormal: '+inter0[5])
        inter.append('Minrecord: '+inter0[6])
        inter.append('Min1ans: '+inter0[7])
        page=soup.select("[class~=time-period]")
        info=BeautifulSoup(str(page), "lxml").find_all('li')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i).replace('<span>','').replace('</span>',''), "lxml")
            comment=soup1.li.string
            inter0.append(comment)
        inter.append(inter0[0])
        inter.append(inter0[1])
        inter.append('Duree soleil'+inter0[2].replace('Durée',''))
        inter.append(inter0[3])
        inter.append(inter0[4])
        inter.append('Duree lune'+inter0[5].replace('Durée',''))
        histo=soup.find(id="feature-history")
        date=histo.find_all('th')
        jour=compile("(.*)/(.*)/(.*)").search(date[4].get_text())
        inter.append("jour: "+jour.group(1))
        inter.append("mois: "+jour.group(2))
        inter.append("année: "+str(int(jour.group(3))+1))
        for i in inter:
            resultat=resultat+i+'\n'

# quart --------------------------------------------------------
    if 'morning-weather-forecast' in adress or 'afternoon-weather-forecast' in adress or 'evening-weather-forecast' in adress or 'overnight-weather-forecast' in adress :
        page=soup.select("[class~=detail-tab-panel]")[0]
        con=BeautifulSoup(str(page), "lxml").select("[class~=cond]")
        for i in con:
            cond=str(i).replace('<span class="cond">','').replace('</span>','').replace('  ','').replace('\n','').replace('\r','')
        ico=BeautifulSoup(str(page), "lxml").select("[class~=icon]")
        for i in ico:
            icone=str(i).replace('<div class="icon i-','').replace('"></div>','')
        tem=str(BeautifulSoup(str(page), "lxml").select("[class~=large-temp]")[0].select("[class~=small-temp]")[0])
        temmax=str(BeautifulSoup(str(page), "lxml").select("[class~=large-temp]")[0]).replace(str(tem),'').split('>')[1].split('<')[0]
        temmin=tem.split('/')[1].split('<')[0]
        realfeet=str(BeautifulSoup(str(page), "lxml").select("[class~=small-temp]")[1]).replace('<span class="small-temp"><em>RealFeel®</em>','').replace('</span>','').split('/')
        realfeetmin=realfeet[1]
        realfeetmax=realfeet[0]
        ventd=str(BeautifulSoup(str(page), "lxml").select("[class~=wind-point]")[0]).replace('<div class="wind-point ','').replace('"></div>','')
        stat=BeautifulSoup(str(page), "lxml").select("[class~=stats]")
        ventf=str(BeautifulSoup(str(stat), "lxml").select("[class~=wind]")[0]).replace('<li class="wind">','').replace('</li>','')
        inter.append('Cond: '+cond)
        inter.append('Icone: '+icone)
        inter.append('TempMin: '+temmin)
        inter.append('TempMax: '+temmax)
        inter.append('RealFeelMin: '+realfeetmin)
        inter.append('RealFeelMax:'+realfeetmax)
        inter.append('VentD: '+ventd)
        inter.append('VentF: '+ventf)
        stat=BeautifulSoup(str(page), "lxml").find_all('strong')
        detail=['Précipitations: ','Pluie: ','Neige: ','Humidité: ','Couverture nuageuse: ','Point de rosée: ','Visibilité: ']
        x=0
        for i in stat:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.strong.string
            inter.append(detail[x]+str(comment))
            x=x+1
        for i in inter:
            resultat=resultat+i+'\n'

# CC -----------------------------------------------------------
    if 'current-weather' in adress :
        page=soup.find_all('script')
        soup1=BeautifulSoup(str(page), "lxml")
        ville=compile(" city: '(.*)',").search(str(soup1)).group(1)
        longi=compile("lon: '(.*)',").search(str(soup1)).group(1)
        lat=compile("lat: '(.*)',").search(str(soup1)).group(1)
        inter.append("Ville: "+ville)
        inter.append("Lat: "+lat)
        inter.append("Long: "+longi)
        page=soup.select("[class~=detail-tab-panel]")[0]
        cond=str(BeautifulSoup(str(page), "lxml").select("[class~=cond]")[0]).split('>')[1].split('<')[0]
        icone=str(BeautifulSoup(str(page), "lxml").select("[class~=icon]")[0]).replace('<div class="icon i-','').replace('"></div>','')
        temp=str(BeautifulSoup(str(page), "lxml").select("[class~=large-temp]")[0]).split('>')[1].split('<')[0]
        realfeel=str(BeautifulSoup(str(page), "lxml").select("[class~=small-temp]")[0]).split('>')[3].split('<')[0]
        ventd=str(BeautifulSoup(str(page), "lxml").select("[class~=wind-point]")[0]).replace('<div class="wind-point ','').replace('"></div>','')
        inter.append('Cond: '+cond)
        inter.append('Icone: '+icone)
        inter.append('Temp: '+temp)
        inter.append('RealFeel:'+realfeel)
        inter.append('VentD: '+ventd)
        stat=BeautifulSoup(str(page), "lxml").find_all('strong')
        detail=['VentF: ','Humidité: ','Pression: ','Indice UV: ','Couverture nuageuse: ','Plafond: ','Point de rosée: ','Visibilité: ']
        x=0
        for i in stat:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.strong.string
            inter.append(detail[x]+str(comment))
            x=x+1
        inter.append("Alerte: RAS")
        page=soup.select("[id~=feature-history]")[0]
        info=BeautifulSoup(str(page), "lxml").find_all('td')
        inter0=[]
        for i in info:
            soup1=BeautifulSoup(str(i), "lxml")
            comment=soup1.td.string
            inter0.append(comment)
        inter.append('Maxjour: '+inter0[0])
        inter.append('Maxnormal: '+inter0[1])
        inter.append('Maxrecord: '+inter0[2])
        inter.append('Max1ans: '+inter0[3])
        inter.append('Minjour: '+inter0[4])
        inter.append('Minnormal: '+inter0[5])
        inter.append('Minrecord: '+inter0[6])
        inter.append('Min1ans: '+inter0[7])
        histo=soup.find(id="feature-history")
        date=histo.find_all('th')
        jour=compile("(.*)/(.*)/(.*)").search(date[4].get_text())
        inter.append("jour: "+jour.group(1))
        inter.append("mois: "+jour.group(2))
        inter.append("année: "+str(int(jour.group(3))+1))
        date=str(datetime.now()).split(' ')[1].split(':')
        inter.append("heure: "+date[0])
        inter.append("minute: "+date[1])
        inter.append("seconde: "+date[2].split('.')[0])
        inter.append(str(int(time())))
        for i in inter:
            resultat=resultat+i+'\n'
# Lunaison -----------------------------------------------------
    if 'http://www.calendrier-lunaire.net/' in adress :
        page=soup.select("[class~=TBdoubleColTD8]")[0]
        soup1=BeautifulSoup(str(page), 'lxml')
        resultat=str(soup1.ul['content']).replace('\t','')

# --------------------------------------------------------------
    fiche=open(fichier, "w")
    fiche.write(resultat)
    fiche.close()
    collect()
#### fin Fonction de traitement des fichiers

#### Mise en tache de fond
def demonise(ent, id1, id2, huitHeures, nbJour, interval, nbFoisHuit, Id, demon):
    dem=time()-(60*60)
    misajour=1
    while 1 :
        date=str(datetime.now()).split(' ')[1].split(':')
        heure=time()
        if heure-dem >= 60*60 and MAJP=="oui":
            x=0
            while x<nbJour:
                x=x+1
                traitement(ent+nb1+'/daily-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Jour"+str(x), repsauv)
                print("[\033[32m OK \033[0m] Jour "+str(x))
                if matin=="oui":
                    traitement(ent+nb1+'/morning-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Matin"+str(x), repsauv)
                    print("[\033[32m OK \033[0m] Matin "+str(x))
                if apresmidi=="oui":
                    traitement(ent+nb1+'/afternoon-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/AM"+str(x), repsauv)
                    print("[\033[32m OK \033[0m] AM "+str(x))
                if soiree=="oui":
                    traitement(ent+nb1+'/evening-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Soiree"+str(x), repsauv)
                    print("[\033[32m OK \033[0m] Soiree "+str(x))
                if nuit=="oui":
                    traitement(ent+nb1+'/overnight-weather-forecast/'+nb2+"?day="+str(x), repsauv+"/Nuit"+str(x), repsauv)
                    print("[\033[32m OK \033[0m] Nuit "+str(x))
            if lune == "oui":
                traitement('http://www.calendrier-lunaire.net/', repsauv+"/lunaison", repsauv)
                print("[\033[32m OK \033[0m] Lunaison")
            dem=heure
        if huitHeures=="oui":
            x=0
            while x<nbFoisHuit:
                h=(x*8)+int(strftime('%H', localtime()))
                x=x+1
                traitement(ent+nb1+'/hourly-weather-forecast/'+nb2+'?hour='+str(h), repsauv+"/huitHeures"+str(x), repsauv)
                print("[\033[32m OK \033[0m] huitHeures "+str(x))
        traitement(ent+nb1+'/current-weather/'+nb2, repsauv+"/CC", repsauv)
        print("[\033[32m OK \033[0m] CC")
        if externe is not None:
                 system(externe)
        fin=time()
        duree=fin-heure
        if notifi == "oui":
            notify2.init('Recmeteo.py')
            if heure-dem == 0:
                mess=notify2.Notification('Accuweather', "Mise a jour complete à "+str(date[0])+":"+str(date[1])+":"+str(date[2]).split('.')[0]+" en "+str(round(duree,2)).replace('.','s')+" sec", '/opt/Accuweather/icones/accuweather-logo1.png')
                mess.show()
                print("[\033[32m OK \033[0m] Mise a jour complete à "+str(date[0])+":"+str(date[1])+":"+str(date[2]).split('.')[0]+" en "+str(round(duree,2)).replace('.','s'))
            else:
                if fullnotify == "oui" :
                    mess=notify2.Notification('Accuweather', "Mise a jour partiel à "+str(date[0])+":"+str(date[1])+":"+str(date[2]).split('.')[0]+" en "+str(round(duree,2)).replace('.','s'), '/opt/Accuweather/icones/accuweather-logo1.png')
                    mess.show()
                print("[\033[32m OK \033[0m] Mise a jour partiel à "+str(date[0])+":"+str(date[1])+":"+str(date[2]).split('.')[0]+" en "+str(round(duree,2)).replace('.','s'))
        start=heure
        pause=60*interval-int(duree)
        if pause < 0:
            pause=interval
        if demon == "non":
            print("[\033[33mINFO\033[0m] Mode démon non utilisé fin de recmeteo.py")
            exit()
        collect()
        sleep(pause)
        if Id != "sans":
            if not path.exists("/proc/"+Id):
                exit()


### Initialiation de DBus pour les notifications
if notifi == "oui":
    import notify2
### Vérification répertoire
if not path.exists(repsauv):
    makedirs(repsauv)
#### Lancement du script et initialisation de la tache de fond
nb1=findall('\d+', adressWeb)[0]
nb2=findall('\d+', adressWeb)[1]
ent=adressWeb[:adressWeb.find(nb1)]
fin=adressWeb.replace(ent+nb1, "")
fin=fin.replace(fin[:fin.find(nb2)]+nb2, "")
nb2=nb2+fin
#print("[\033[33mINFO\033[0m] Recmeteo Version =", Version)
demonise(ent, nb1, nb2, huitHeures, nbJour, interval, nbFoisHuit, Id, demon)

1485004993.png

avec le météo fond d'écran accuweather-3.deb v3.10 MAJ:18/01/2017

Dernière modification par daniel38100 (Hier à 20:48)

Hors ligne

#1334 Hier à 23:56

daniel38100

Re : [Conky] Alternative à weather.com (3)

A tous

Correction lunaison MAJ v1.21météo.lua meteo-lua-2.deb v1.21 MAJ:21/01/17

1485039564.png

Et passage à v3.11 pour météo fond d'écran accuweather-3.deb v3.11 MAJ:22/01/2017

Dernière modification par daniel38100 (Aujourd'hui à 00:53)

Hors ligne