You are not logged in.

#326 2015-12-06 18:20:56

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

Just monitor it, especially later tonight, as I haven't tested it for tonight/early am conditions.

You were right.

After 18.00 clock / 6 PM and the exchange TODAY; TONIGHT and
>> EARLY AM

it shows the
Irm5BOrR
Teo,
it has time.  wink

Offline

#327 2015-12-06 18:27:13

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,483

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Try with this

#!/bin/bash

#function: test_image
test_image () {
    case $1 in
         1)
           echo a
         ;;
         2|3)
           echo b 
         ;;
         4|5)
           echo c
         ;;
         6)
           echo d
         ;;
         7)
           echo e
         ;;
         8)
           echo f
         ;;
         11)
           echo 0
         ;;
         12)
           echo h
         ;;
         13|14)
           echo g
         ;;
         15)
           echo m
         ;;
         16|17)
           echo k
         ;;
         18)
           echo i
         ;;
         19)
           echo q
         ;;
         20|21|23)
           echo o
         ;;
         22)
           echo r
         ;;
         24|31)
           echo E
         ;;
         25)
           echo v
         ;;
         26)
           echo x
         ;;
         29)
           echo y
         ;;
         30)
           echo 5
         ;;
         32)
           echo 6
         ;;
         33)
           echo A
         ;;
         34|35)
           echo B
         ;;
         36|37)
           echo C
         ;;
         38)
           echo D
         ;;
         39|40)
           echo G
         ;;
         41|42)
           echo K
         ;;
         43|44)
           echo O
         ;;
         *)
		   echo -
		 ;;   
        esac
} 


kill -STOP $(pidof conky)
killall wget

#put your Accuweather address here
address="http://www.accuweather.com/de/de/berlin/10178/weather-forecast/178087"
#address="http://www.accuweather.com/en/us/los-angeles-ca/90012/weather-forecast/347625"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
wget -O $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond_raw "$curr_addr"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton_raw "$addr1"

addr2="$addr1"?day=6
wget -O $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days_raw "$addr2"

#current conditions
if [[ -s $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond_raw ]]; then

    sed -i '/detail-now/,/#details/!d' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond_raw
    egrep -i '"cond"|icon i-|detail-tab-panel' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond_raw > $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    sed -i -e 's/&#246\;/ö/g' -e 's/&#228\;/ä/g' -e 's/&#252\;/ü/g' -e 's/&#196\;/Ä/g' -e 's/&#214\;/Ö/g' -e 's/&#220\;/Ü/g' -e 's/&#223\;/ß/g' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    sed -i -e 's/^.*"cond">//g' -e 's/&deg/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' -e 's/-[a-z].*$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    
    image=$(sed -n 2p $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond)
    sed -i 2s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond

fi

#First 5 days
if [[ -s $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton_raw ]]; then

    sed -i '/feed-tabs/,/\.feed-tabs/!d' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton_raw
    egrep -i 'Abend|Heute|H abd|Nacht|icon i-|cond|temp|>Mo<|>Di<|>Mi<|>Do<|>Fr<|>Sa<|>So<' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton_raw > $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    sed -i -e 's/&#246\;/ö/g' -e 's/&#228\;/ä/g' -e 's/&#252\;/ü/g' -e 's/&#196\;/Ä/g' -e 's/&#214\;/Ö/g' -e 's/&#220\;/Ü/g' -e 's/&#223\;/ß/g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    sed -i -e 's/TT<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
	sed -i -e 's/Heute/HEUTE/' -e 's/H abd/HEUTE ABEND/' -e 's/Mo$/MONTAG/' -e 's/Di$/DIENSTAG/' -e 's/Mi$/MITTWOCH/' -e 's/Do$/DONNERSTAG/' -e 's/Fr$/FREITAG/' -e 's/Sa$/SAMSTAG/' -e 's/So$/SONNTAG/' -e 's/-[a-z]$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    time=$(sed -n 1p $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton)
    image=$(sed -n 2p $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton)
	if [[ $time == HEUTE ]]; then
	    sed -i 2s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
	elif [[ $time == ABEND || $time == NACHT || $time == "HEUTE ABEND" ]]; then
	    sed -i 2s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
        sed -i 3a- $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
	fi
    for (( i=7; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton)
	      sed -i ${i}s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
	  done

fi

#Next 5 days
if [[ -s $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days_raw ]]; then

    sed -i '/feed-tabs/,/\.feed-tabs/!d' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days_raw
    egrep -i 'icon i-|cond|temp|>Mo<|>Di<|>Mi<|>Do<|>Fr<|>Sa<|>So<' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days_raw > $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    sed -i -e 's/&#246\;/ö/g' -e 's/&#228\;/ä/g' -e 's/&#252\;/ü/g' -e 's/&#196\;/Ä/g' -e 's/&#214\;/Ö/g' -e 's/&#220\;/Ü/g' -e 's/&#223\;/ß/g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    sed -i -e 's/TT<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
	sed -i -e 's/Mo$/MONTAG/' -e 's/Di$/DIENSTAG/' -e 's/Mi$/MITTWOCH/' -e 's/Do$/DONNERSTAG/' -e 's/Fr$/FREITAG/' -e 's/Sa$/SAMSTAG/' -e 's/So$/SONNTAG/' -e 's/-[a-z]$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    for (( i=2; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days)
	      sed -i ${i}s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
	  done

fi

kill -CONT $(pidof conky)

and keep monitoring.
Thanks for the feedback.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#328 2015-12-06 19:02:49

fvirgola80
Member
From: Italy / Rome
Registered: 2015-10-08
Posts: 262

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

I can't efficiently run the conky files as I don't have a lua supporting conky installed, but in the first one, conky is asking for a radar.gif imgae, whereas the script produces a radar.png one.

The second one works OK, provided I comment out the lua lines:
http://i.imgur.com/THIXbq2t.jpg

But do you think it's worth ? or work on another conky ?


Nothing happens by chance

Offline

#329 2015-12-06 19:05:55

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,483

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

If you make the first conky to show the radar.png image, then why not?
...if it suits your needs...


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#330 2015-12-06 19:17:24

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

mRXT0MZw
OK
I am watching and will report.  smile

Offline

#331 2015-12-06 19:37:58

fvirgola80
Member
From: Italy / Rome
Registered: 2015-10-08
Posts: 262

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

If you make the first conky to show the radar.png image, then why not?
...if it suits your needs...

But you when the radar is not active conky part ?


Nothing happens by chance

Offline

#332 2015-12-06 20:24:38

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,866

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

RE: unklar testing the conky at different times of the day.

My first thought was to use "faketime" as I have with calendar conkys ... but that won't work well to get future weather.   DUH!  roll

If it did I'd use it for an RSS feed on next weeks loto!

OffTopic

Check it out

We now return you to our regularly scheduled Teo's weather scripts.

Teo, you are awesome.  You just can't help helping people.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Online

#333 2015-12-06 21:48:41

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,483

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

fvirgola80 wrote:

But you when the radar is not active conky part ?

Can you explain your question a bit more?

Sector11 wrote:

Teo, you are awesome.  You just can't help helping people.

Just an exception for unklar, I won't do other translations any time soon.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#334 2015-12-06 23:12:27

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Teo wrote:

Just an exceptions for unklar...

A great honor for me.

S11 has said, "a picture says more than 1000 words".

@Teo
Gold Boy the script is working reliably. The box stays on ...
I'll be back.
4N1Y3GSq

Offline

#335 2015-12-06 23:22:34

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hm, to switch again Broken  sad

KHsae2Hd

    [ <=>                                             ] 85.181      --.-K/s   in 0,07s   

2015-12-07 00:06:48 (1,12 MB/s) - »/home/unklar/1a_accuweather_conkyweather_font_Deutsch/last_days_raw« gespeichert [85181]

sed: -e Ausdruck #1, Zeichen 9: Nicht beendeter `s'-Befehl
sed: -e Ausdruck #1, Zeichen 16: Nicht beendeter `s'-Befehl
sed: -e Ausdruck #1, Zeichen 6: Nicht beendeter `s'-Befehl
sed: -e Ausdruck #1, Zeichen 10: Nicht beendeter `s'-Befehl

Last edited by unklar (2015-12-06 23:26:46)

Offline

#336 2015-12-07 00:00:58

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,866

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

TeoBigusGeekus wrote:

I can't efficiently run the conky files as I don't have a lua supporting conky installed, but in the first one, conky is asking for a radar.gif imgae, whereas the script produces a radar.png one.

The second one works OK, provided I comment out the lua lines:
http://i.imgur.com/THIXbq2t.jpg

I'm going to play with it as well Teo ... just so you know.  wink


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Online

#337 2015-12-07 08:24:00

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hello Sector11, Good Morning

repaired wink
aMVsA7o0

# pkill -xf "conky -q -c /home/unklar/1b2_accuweather_conkyweather_font/conkyrc_1b2_int_s11_thin" &
# works perfect - Mon 24 Nov 2014 23:32 - by sector11
# works perfect - Sun 04 Jan 2015 14:31
# works perfect - Fri 01 May 2015 18:37
# works perfect - Wed 06 May 2015 too   - by sector11
# works perfect - Sam 05 Dez 2015 23:00 - adapted with new script

###  Begin Window Settings  ########################################
own_window yes
own_window_type normal
own_window_transparent no ##yes
own_window_hints below,skip_taskbar,skip_pager ##,sticky
own_window_colour 000000
own_window_class Conky
own_window_title conkyrc 1b2 Int s11 thin

### ARGB can be used for real transparency
### NOTE that a composite manager is required for real transparency.
 own_window_argb_visual yes # Options: yes or no

### When ARGB visuals are enabled, this use this to modify the alpha value
### Use: own_window_type normal
### Use: own_window_transparent no
### Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
 own_window_argb_value 75

minimum_size 110 0	##	w|h
maximum_width 75

gap_x 10	# l|r
gap_y 10	# u|d

alignment tl
##########################################  End Window Settings  ###
###  Font Settings  ################################################
# Use Xft (anti-aliased font and stuff)
use_xft yes

#xftfont monofur:bold:size=12
xftfont Fantasque Sans Mono:bold:size=10

# Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 1.0

# Force UTF8? requires XFT ###
override_utf8_locale yes

uppercase no
############################################  End Font Settings  ###
###  Color Settings  ###############################################
draw_shades yes
default_shade_color 000000
draw_outline no
default_outline_color 000000

default_color DCDCDC #220 220 220	Gainsboro
color0 C0C0C0 # Silver
color1 778899 #LightSlateGray
color2 FAEBD7 #AntiqueWhite
color3 87CEFA #LightSkyBlue
color4 48D1CC #MediumTurquoise
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 B0E0E6 #PowderBlue
color8 FFD700 #Gold
color9 CD5C5C #IndianRed
###########################################  End Color Settings  ###
###  Borders Section  ##############################################
draw_borders no
# Stippled borders?
stippled_borders 5
# border margins
border_inner_margin 5
border_outer_margin 0
# border width
border_width 2
# graph borders
draw_graph_borders yes #no
#default_graph_size 15 40
###########################################  End Borders Secton  ###
###  Miscellaneous Section  ########################################
# Boolean value, if true, Conky will be forked to background when started.
background yes

# Adds spaces around certain objects to stop them from moving other things
# around, this only helps if you are using a mono font
# Options: right, left or none
use_spacer none

# Default and Minimum size is 256 - needs more for single commands that
# "call" a lot of text IE: bash scripts
text_buffer_size 256

# Subtract (file slystem) buffers from used memory?
no_buffers yes

# change GiB to G and MiB to M
short_units yes

# Like it says, ot pads the decimals on % values
# doesn't seem to work since v1.7.1
pad_percents 2

# Imlib2 image cache size, in bytes. Default 4MiB Increase this value if you use
# $image lots. Set to 0 to disable th0e image cache.
imlib_cache_size 0

#default_bar_size 0 10

# Use the Xdbe extension? (eliminates flicker)
# It is highly reco${color}mmended to use own window with this one
# so double buffer won't be so big.
double_buffer yes
#####################################  End Miscellaneous Section  ###

update_interval 1

### ${texeci 500 bash $HOME/1b2_accuweather_conkyweather_font/1b2}

TEXT
Jetzt${texeci 500 bash $HOME/1b2_accuweather_conkyweather_font/1b2}

${execpi 600 sed -n '29p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}°
±${execpi 600 sed -n '30p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '27p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}${font}${color}
${execpi 600 sed -n '34p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
UVI  ${execpi 600 sed -n '34p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
Wind ${execpi 600 sed -n '31p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
@  ${execpi 600 sed -n '38p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
Vis ${execpi 600 sed -n '37p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
CC  ${execpi 600 sed -n '36p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
Hum ${execpi 600 sed -n '32p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
DP  ${execpi 600 sed -n '35p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}°
S ${execpi 600 sed -n '39p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
↓ ${execpi 600 sed -n '40p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
M ${execpi 600 sed -n '41p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
↓ ${execpi 600 sed -n '42p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}
${execi 3600 echo `date --date="0 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '26p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${execpi 600 sed -n '27p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '25p' $HOME/1b2_accuweather_conkyweather_font/first_days}${font}${color}
CoP ${execpi 600 sed -n '28p' $HOME/1b2_accuweather_conkyweather_font/first_days}
Nachts
${execpi 600 sed -n '31p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${execpi 600 sed -n '32p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '30p' $HOME/1b2_accuweather_conkyweather_font/first_days}${font}${color}
CoP ${execpi 600 sed -n '33p' $HOME/1b2_accuweather_conkyweather_font/first_days}
${execi 3600 echo `date --date="1 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '8p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${execpi 600 sed -n '9p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '6p' $HOME/1b2_accuweather_conkyweather_font/first_days}${font}${color}
${execi 3600 echo `date --date="2 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '13p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${execpi 600 sed -n '14p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '11p' $HOME/1b2_accuweather_conkyweather_font/first_days}${font}${color}
${execi 3600 echo `date --date="3 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '18p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${execpi 600 sed -n '19p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '16p' $HOME/1b2_accuweather_conkyweather_font/first_days}${font}${color}
${execi 3600 echo `date --date="4 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '23p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${execpi 600 sed -n '24p' $HOME/1b2_accuweather_conkyweather_font/first_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '21p' $HOME/1b2_accuweather_conkyweather_font/first_days}${font}${color}
${execi 3600 echo `date --date="5 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '4p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${execpi 600 sed -n '5p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '2p' $HOME/1b2_accuweather_conkyweather_font/last_days}${font}${color}
${execi 3600 echo `date --date="6 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '9p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${execpi 600 sed -n '10p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '7p' $HOME/1b2_accuweather_conkyweather_font/last_days}${font}${color}
${execi 3600 echo `date --date="7 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '14p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${execpi 600 sed -n '15p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '12p' $HOME/1b2_accuweather_conkyweather_font/last_days}${font}${color}
${execi 3600 echo `date --date="8 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '19p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${execpi 600 sed -n '20p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '17p' $HOME/1b2_accuweather_conkyweather_font/last_days}${font}${color}
${execi 3600 echo `date --date="9 day" | awk '{print $1" "$2" "$3}'`}
${execpi 600 sed -n '24p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${execpi 600 sed -n '25p' $HOME/1b2_accuweather_conkyweather_font/last_days}°
${voffset -28}${goto 50}${color2}${font conkyweather:size=24}${execi 600  sed -n '22p' $HOME/1b2_accuweather_conkyweather_font/last_days}${font}${color}
${membar 0}${voffset -300}
${voffset 300}${alignc}${execpi 600 sed -n '43p' $HOME/1b2_accuweather_conkyweather_font/curr_cond}

Last edited by unklar (2015-12-07 09:00:50)

Offline

#338 2015-12-07 09:36:27

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,483

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Ahhh, so Early AM is Nachts in German, I didn't know this.

There you go

#!/bin/bash

#function: test_image
test_image () {
    case $1 in
         1)
           echo a
         ;;
         2|3)
           echo b 
         ;;
         4|5)
           echo c
         ;;
         6)
           echo d
         ;;
         7)
           echo e
         ;;
         8)
           echo f
         ;;
         11)
           echo 0
         ;;
         12)
           echo h
         ;;
         13|14)
           echo g
         ;;
         15)
           echo m
         ;;
         16|17)
           echo k
         ;;
         18)
           echo i
         ;;
         19)
           echo q
         ;;
         20|21|23)
           echo o
         ;;
         22)
           echo r
         ;;
         24|31)
           echo E
         ;;
         25)
           echo v
         ;;
         26)
           echo x
         ;;
         29)
           echo y
         ;;
         30)
           echo 5
         ;;
         32)
           echo 6
         ;;
         33)
           echo A
         ;;
         34|35)
           echo B
         ;;
         36|37)
           echo C
         ;;
         38)
           echo D
         ;;
         39|40)
           echo G
         ;;
         41|42)
           echo K
         ;;
         43|44)
           echo O
         ;;
         *)
		   echo -
		 ;;   
        esac
} 


kill -STOP $(pidof conky)
killall wget

#put your Accuweather address here
address="http://www.accuweather.com/de/us/anchorage-ak/99501/weather-forecast/346835"
#address="http://www.accuweather.com/en/us/los-angeles-ca/90012/weather-forecast/347625"

loc_id=$(echo $address|sed 's/\/weather-forecast.*$//'|sed 's/^.*\///')
last_number=$(echo $address|sed 's/^.*\///')

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$last_number"
wget -O $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond_raw "$curr_addr"

addr1="$(echo $address|sed 's/weather-forecast.*$//')"daily-weather-forecast/"$last_number"
wget -O $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton_raw "$addr1"

addr2="$addr1"?day=6
wget -O $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days_raw "$addr2"

#current conditions
if [[ -s $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond_raw ]]; then

    sed -i '/detail-now/,/#details/!d' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond_raw
    egrep -i '"cond"|icon i-|detail-tab-panel' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond_raw > $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    sed -i -e 's/&#246\;/ö/g' -e 's/&#228\;/ä/g' -e 's/&#252\;/ü/g' -e 's/&#196\;/Ä/g' -e 's/&#214\;/Ö/g' -e 's/&#220\;/Ü/g' -e 's/&#223\;/ß/g' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    sed -i -e 's/^.*"cond">//g' -e 's/&deg/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    sed -i -e 's/">//g' -e 's/-->//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' -e 's/-[a-z].*$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond
    
    image=$(sed -n 2p $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond)
    sed -i 2s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/curr_cond

fi

#First 5 days
if [[ -s $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton_raw ]]; then

    sed -i '/feed-tabs/,/\.feed-tabs/!d' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton_raw
    egrep -i 'Abend|Heute|H abd|Nacht|icon i-|cond|temp|>Mo<|>Di<|>Mi<|>Do<|>Fr<|>Sa<|>So<' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton_raw > $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    sed -i -e 's/&#246\;/ö/g' -e 's/&#228\;/ä/g' -e 's/&#252\;/ü/g' -e 's/&#196\;/Ä/g' -e 's/&#214\;/Ö/g' -e 's/&#220\;/Ü/g' -e 's/&#223\;/ß/g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    sed -i -e 's/TT<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
	sed -i -e 's/Nachts/NACHTS/' -e 's/Heute/HEUTE/' -e 's/H abd/HEUTE ABEND/' -e 's/Mo$/MONTAG/' -e 's/Di$/DIENSTAG/' -e 's/Mi$/MITTWOCH/' -e 's/Do$/DONNERSTAG/' -e 's/Fr$/FREITAG/' -e 's/Sa$/SAMSTAG/' -e 's/So$/SONNTAG/' -e 's/-[a-z]$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
    time=$(sed -n 1p $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton)
    image=$(sed -n 2p $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton)
	if [[ $time == HEUTE ]]; then
	    sed -i 2s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
	elif [[ $time == ABEND || $time == NACHT || $time == "HEUTE ABEND" || $time == NACHTS ]]; then
	    sed -i 2s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
        sed -i 3a- $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
	fi
    for (( i=7; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton)
	      sed -i ${i}s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/tod_ton
	  done

fi

#Next 5 days
if [[ -s $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days_raw ]]; then

    sed -i '/feed-tabs/,/\.feed-tabs/!d' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days_raw
    egrep -i 'icon i-|cond|temp|>Mo<|>Di<|>Mi<|>Do<|>Fr<|>Sa<|>So<' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days_raw > $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    sed -i -e 's/&#246\;/ö/g' -e 's/&#228\;/ä/g' -e 's/&#252\;/ü/g' -e 's/&#196\;/Ä/g' -e 's/&#214\;/Ö/g' -e 's/&#220\;/Ü/g' -e 's/&#223\;/ß/g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    sed -i -e 's/TT<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
	sed -i -e 's/Mo$/MONTAG/' -e 's/Di$/DIENSTAG/' -e 's/Mi$/MITTWOCH/' -e 's/Do$/DONNERSTAG/' -e 's/Fr$/FREITAG/' -e 's/Sa$/SAMSTAG/' -e 's/So$/SONNTAG/' -e 's/-[a-z]$//g' $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
    for (( i=2; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days)
	      sed -i ${i}s/$image/$(test_image $image)/ $HOME/1a_accuweather_conkyweather_font_Deutsch/last_days
	  done

fi

kill -CONT $(pidof conky)

Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#339 2015-12-07 11:24:43

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,866

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

unklar wrote:

Hello Sector11, Good Morning

repaired wink

Guten morgan unklar

It was broken? sad

@Teo
Nacht = night

Mien Deutche ist 'bad'


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Online

#340 2015-12-07 11:25:05

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

When the time of the exchange
TODAY> TONIGHT> NIGHT is
(in German)
6.00> 12:00> 18:00> 24.00 / 0.00 clock

then Teo, the AC 12:00 worked!  big_smile

Thank you!

Offline

#341 2015-12-07 11:29:19

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

It was broken?

No. No more. wink
See the images.

Offline

#342 2015-12-07 11:34:48

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,483

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

I did German for 7 years.
I have the Mittelstufe diplom ( since 1997).

...aber ich habe fast alles vergessen... cry


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#343 2015-12-07 11:46:26

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Does not matter Teo
for me it was only Russian (forget everything), no English,  and German
falls me already difficult...   devil

Offline

#344 2015-12-07 11:47:56

TeoBigusGeekus
BL DieHard
From: /Deutschland/Frankfurt_am_Main
Registered: 2015-10-04
Posts: 1,483

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Kein Angst mein Freund wink


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#345 2015-12-07 11:50:19

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

lol.gif

Offline

#346 2015-12-07 12:27:22

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,866

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Hey, I'm multilingual I can order a beer in English, French, German, Italian, Dutch and Spanish and hand sign in others.  Oh yea, I speak profanity too.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Online

#347 2015-12-07 13:02:29

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,866

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

unklar wrote:
Sector11 wrote:

It was broken?

No. No more. wink
See the images.

Confused .. images I have match yours ... 12 images.
Now
Today
Tonight
and 9 days forecasted.

I don't see it  sad
Check a for a PM


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Online

#348 2015-12-07 15:27:05

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,866

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

OK, I got to playing again.

This is for the new Deutsch script that Teo and unklar are working on.
WARNING:  German comes from an online translator and a few words I remembered.  I'll bet there will be errors.

First I added some stuff to the ending of $HOME/1a_accuweather_conkyweather_font_Deutsch/1a

fi
date +%x > $HOME/1a_accuweather_conkyweather_font_Deutsch/aktualisiert
date +%T >> $HOME/1a_accuweather_conkyweather_font_Deutsch/aktualisiert
date +"%x %T" >> $HOME/1a_accuweather_conkyweather_font_Deutsch/aktualisiert
kill -CONT $(pidof conky)

Next it was as a last thought.  Since this conky does not actually go on the internet for information, it uses the "existing" data that $HOME/1a_accuweather_conkyweather_font_Deutsch/1a has created I changed the "${execpi 600" call for "$[pre_exec" calls.  Think I'll be doing that with all my companion scripts.

2015-12-07_120515_Scrot11.th.png

Code update here

Last edited by Sector11 (2015-12-07 21:33:13)


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Online

#349 2015-12-07 17:35:12

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

@Teo
12.00 > 18.00 > (HEUTE > HEUTE ABEND)

BINGO! Excellent.  big_smile

Offline

#350 2015-12-07 17:42:33

unklar
Back to the roots 1.9
From: #! BL
Registered: 2015-10-31
Posts: 1,656

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/MoonGiant)

Sector11 wrote:

Confused .. images I have match yours ... 12 images.
Now
Today
Tonight
and 9 days forecasted.

2xUo6xHw

Sector11 wrote:

......
One is wet, one is cold one is cloudless. And not in the order shown ... not hard to guess
.......

Must get busy and finish the others. 
......

repaired  tongue
83pULyFn

Offline

Board footer

Powered by FluxBB