SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#726 2013-03-05 11:39:01

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

Try with this:

#!/bin/bash

#put your 10 day weather.com address here
address10="http://www.weather.com/weather/tenday/New+York+NY+USNY0996:1:US"

addr_now=$(echo $address10|sed 's/tenday/right-now/')
addr_today=$(echo $address10|sed 's/tenday/today/')

kill -STOP $(pidof conky)
killall wget

wget --user-agent="Firefox" -O $HOME/Conky_WeatherCom/RightNow/raw_rn $addr_now
wget --user-agent="Firefox" -O $HOME/Conky_WeatherCom/Today/raw_td $addr_today
wget --user-agent="Firefox" -O $HOME/Conky_WeatherCom/10days/raw_10 $address10

rm $HOME/Conky_WeatherCom/10days/10days_OK

if [[ -s $HOME/Conky_WeatherCom/RightNow/raw_rn ]]; then
	#############
	# Right now #
	#############
	grep Updated $HOME/Conky_WeatherCom/RightNow/raw_rn > $HOME/Conky_WeatherCom/updated
	sed -i '/wx-weather-icon wx-hide/,/<div class="wx-next6hr-details ">/!d' $HOME/Conky_WeatherCom/RightNow/raw_rn
	sed -i -e '/^[ \t]*$/d' -e 's/\r//g' $HOME/Conky_WeatherCom/RightNow/raw_rn
	sed -i '/\.png\|&deg;\|weather-phrase\|feels-like\|"wx-temp"\|"wx-value"\|arrow wind-dir-/!d' $HOME/Conky_WeatherCom/RightNow/raw_rn
	sed -i -e 's/^.*wxicon\/120\///g' -e s'/png.*$/png/g' -e 's/^.*"wx-temp">//g' $HOME/Conky_WeatherCom/RightNow/raw_rn
	sed -i -e 's/^.*wx-dir-arrow wind-dir-//g' -e 's/"><\/div>.*$//g' -e 's/<\/span>.*$//g' -e 's/^.*incheshg">//g' -e 's/in<span.*$/in/g' -e 's/^.*">//g' -e 's/&deg;//g' $HOME/Conky_WeatherCom/RightNow/raw_rn
 
	image=$(sed -n 1p $HOME/Conky_WeatherCom/RightNow/raw_rn)
	if [[ $(sed -n 6p $HOME/Conky_WeatherCom/RightNow/raw_rn) == "Calm" ]]; then
		sed -i '6s/$/\n/' $HOME/Conky_WeatherCom/RightNow/raw_rn
	fi
    cp $HOME/Conky_WeatherCom/weather_com_images/$image $HOME/Conky_WeatherCom/now.png
fi

if [[ -s $HOME/Conky_WeatherCom/Today/raw_td ]]; then
	#############
	#   Today   #   
	#############
	grep Updated $HOME/Conky_WeatherCom/Today/raw_td >> $HOME/Conky_WeatherCom/updated
    sed -i '/<div class="wx-daypart/,/<div class="wx-tempgraph wx-module wx-grid3of6/!d' $HOME/Conky_WeatherCom/Today/raw_td
    sed -i -e '/^[ \t]*$/d' -e 's/^[ \t]*//g' -e 's/\r//g' $HOME/Conky_WeatherCom/Today/raw_td
    sed -i -e 's/^.*wx-observed">//g' -e '/!high was/s/&deg;.*$//g' $HOME/Conky_WeatherCom/Today/raw_td
    sed -i -e 's/^.*wxicon\/120\///g' -e 's/^.*"wx-temp"> //g' $HOME/Conky_WeatherCom/Today/raw_td
    sed -i -e 's/^.*<h3>//g' -e 's/^.*"wx-phrase ">//g' -e 's/^.*<dt>//g' -e 's/^.*<dd>//g' $HOME/Conky_WeatherCom/Today/raw_td
    sed -i -e 's/^.*snowfall-value">//g' -e "s/<span class='wx-firstletter'>//g" -e 's/^.*<strong>//g' $HOME/Conky_WeatherCom/Today/raw_td
    sed -i -e 's/^.*<p class="wx-narrative">//g' -e 's/<sup>//g' -e 's/<\/sup>//g' -e 's/<span class=.*<\/span>//g' -e 's/^.*Snowfall/Snowfall/g' $HOME/Conky_WeatherCom/Today/raw_td
    sed -i -e 's/<.*$//g' -e '/^[ \t]*$/d' -e 's/Chance of rain/Chance of rain:/g' -e 's/&deg;//g' -e 's/\.png.*$/\.png/g' $HOME/Conky_WeatherCom/Today/raw_td
    sed -i -e :a -e '/:$/N; s/:\n/: /; ta' $HOME/Conky_WeatherCom/Today/raw_td
    sed -n '1,/Night/p' $HOME/Conky_WeatherCom/Today/raw_td > $HOME/Conky_WeatherCom/Today/day
    sed -n '/Night/,$p' $HOME/Conky_WeatherCom/Today/raw_td > $HOME/Conky_WeatherCom/Today/night
    sed -i '/Day\|Night/d' $HOME/Conky_WeatherCom/Today/{day,night}

	day=$(sed -n 1p $HOME/Conky_WeatherCom/Today/day)
    cp $HOME/Conky_WeatherCom/weather_com_images/$day $HOME/Conky_WeatherCom/TD.png
    night=$(sed -n 1p $HOME/Conky_WeatherCom/Today/night)
    cp $HOME/Conky_WeatherCom/weather_com_images/$night $HOME/Conky_WeatherCom/TN.png

    fold -s30 $HOME/Conky_WeatherCom/Today/day > $HOME/Conky_WeatherCom/Today/day1
    sed -i 's/\(^.*: \)\(.*$\)/\$\{color ffe595\}\1\$\{color\}\2/g' $HOME/Conky_WeatherCom/Today/day1
    fold -s30 $HOME/Conky_WeatherCom/Today/night > $HOME/Conky_WeatherCom/Today/night1 
    sed -i 's/\(^.*: \)\(.*$\)/\$\{color ffe595\}\1\$\{color\}\2/g' $HOME/Conky_WeatherCom/Today/night1

    for (( i=1; i<=$(cat $HOME/Conky_WeatherCom/Today/night1|wc -l); i++ ))
        do
             sed -i "${i}s/^/\$\{goto 195\}/" $HOME/Conky_WeatherCom/Today/night1
        done
    paste -d'*' $HOME/Conky_WeatherCom/Today/{day1,night1} > $HOME/Conky_WeatherCom/Today/final_today
    sed -i -e 's/\*//g' -e '2s/^/\$\{color ffe595\}TEMP: \$\{color\}/' -e '2s/goto 195\}/goto 195\}\$\{color ffe595\}TEMP: \$\{color\}/' -e '2s/$/F/' /$HOME/Conky_WeatherCom/Today/final_today
    
    j=$(cat $HOME/Conky_WeatherCom/Today/final_today|wc -l)
    if (( $j<16 )); then
		for (( i=1; i<=$(( 16-$j )); i++ ))
			do
				echo '' >> $HOME/Conky_WeatherCom/Today/final_today
			done
	fi
fi

if [[ -s $HOME/Conky_WeatherCom/10days/raw_10 ]]; then
	#############
	#  10 days  #
	#############
	grep Updated $HOME/Conky_WeatherCom/10days/raw_10 >> $HOME/Conky_WeatherCom/updated
	observed_high=$(grep "Observed High" $HOME/Conky_WeatherCom/10days/raw_10|wc -l)
	sed -i '/"wx-daypart"/,/wx-planmyday10 wx-plan-day/!d' $HOME/Conky_WeatherCom/10days/raw_10
	sed -i -e '/^[ \t]*$/d' -e 's/\r//g' -e '/^$/d' -e 's/^[ \t]*//g' $HOME/Conky_WeatherCom/10days/raw_10
	sed -i -e 's/^.*wxicon\/70\///g' -e 's/\.png.*$/\.png/g' $HOME/Conky_WeatherCom/10days/raw_10
	sed -i -e 's/^.*"wx-temp"> \|"wx-temp-alt"> \|"wx-phrase">\|wx-severe">\|<dt>\|<dd>\|<h3>\|<p class=//g' $HOME/Conky_WeatherCom/10days/raw_10
	sed -i -e 's/<sup>&deg;.*$//g' -e 's/<\/p>\|<\/dd>.*$//g' -e 's/<span class=.*$//g' -e '/<\|>\|^$/d' -e 's/ at / /g' $HOME/Conky_WeatherCom/10days/raw_10
	sed -i 's/ mph/mph/g' $HOME/Conky_WeatherCom/10days/raw_10
	
	line1=$(sed -n 1p $HOME/Conky_WeatherCom/10days/raw_10|sed 's/ *$//')
	if [[ $line1 == Tonight && $observed_high == 0 ]]; then
		sed -i '3s/$/\n-/' $HOME/Conky_WeatherCom/10days/raw_10
	fi
	
	for (( i=2; i<=65; i+=7 ))
	    do
	        image=$(sed -n ${i}p $HOME/Conky_WeatherCom/10days/raw_10)
	        cp $HOME/Conky_WeatherCom/weather_com_images/$image $HOME/Conky_WeatherCom/10_${i}.png
	    done
fi

line_count=$(cat $HOME/Conky_WeatherCom/10days/raw_10|wc -l)
if [[ $line_count == 70 ]]; then
	touch $HOME/Conky_WeatherCom/10days/10days_OK
fi

if [[ -s $HOME/Conky_WeatherCom/updated ]]; then
	##################
	#  Update times  #
	##################
	sed -i -e 's/^.*last-updated">//g' -e 's/^.*Updated: //g' -e 's/<.*$//g' $HOME/Conky_WeatherCom/updated
fi

kill -CONT $(pidof conky)

An extra phrase (wx-severe) caused all the damage. I've corrected it in the 10days section; please keep an eye on it as it reaches the Today and Now sections (it concerns Wednesday's weather) and report back if there are any further hiccups.
After that I can correct the script in the tarball.

Last edited by TeoBigusGeekus (2013-03-05 11:39:58)


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

Help fund CrunchBang, donate to the project!

#727 2013-03-05 19:38:29

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 2,144

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

When I booted up my laptop earlier with your earlier script, the data displayed correctly.  I'm running your updated script now.  There are two issues I currently see with your latest script; ref the screenshot.

First, look at the wind info for Tuesday next week.  It looks like more spacing is needed.  Second, look at the forecast for Thursday next week.  The icon indicates rain, but the text says "Mostly Sunny".

2013_03_05_1362510054_377x898_scrot.jpg

Offline

#728 2013-03-05 19:53:22

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

KrunchTime wrote:

First, look at the wind info for Tuesday next week.  It looks like more spacing is needed.

Nothing I can do about that. I could use a smaller font for the wind I suppose, but it was a risk I chose to take in order to compromise looks and readability.

KrunchTime wrote:

Second, look at the forecast for Thursday next week.  The icon indicates rain, but the text says "Mostly Sunny".

That's because I'm a total wanker!
In my bundled conkyrc, around line 100, there's this bit:

${image $HOME/Conky_WeatherCom/10_58.png -p 170,780 -s 55x55}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${image $HOME/Conky_WeatherCom/10_58.png -p 255,780 -s 55x55}${endif}${font}

See? Image 10_58.png is repeated twice. After all these months, you're the first to notice.
Use this conkyrc

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar,skip_pager
own_window_colour brown

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer right
use_xft yes

# Update interval in seconds
update_interval 3

# Minimum size of text area
minimum_size 355 500
maximum_width 355

override_utf8_locale yes

# Draw shades?
draw_shades yes

# Text stuff
draw_outline yes # amplifies text if yes
draw_borders no
#font freesans -12
xftfont Arial:size=9
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_inner_margin 9
border_outer_margin 0

# border width
border_width 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color cbcbcb


# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 30

imlib_cache_size 0
text_buffer_size 2048
# stuff after 'TEXT' will be formatted on screen

TEXT
${font Arial:size=12}${color ffe595}RIGHT NOW${font}(Upd: ${execpi 600 sed -n '1p' $HOME/Conky_WeatherCom/updated}) ${hr 2}${texeci 600 bash $HOME/Conky_WeatherCom/weath_com}
${font Arial:size=10}${execpi 600 sed -n '4p' $HOME/Conky_WeatherCom/RightNow/raw_rn}${font}

${goto 200}${color ffe595}TEMP: $color${alignr}${execpi 600 sed -n '3p' $HOME/Conky_WeatherCom/RightNow/raw_rn}°F (${execpi 600 sed -n '5p' $HOME/Conky_WeatherCom/RightNow/raw_rn}°F)${image $HOME/Conky_WeatherCom/now.png -p 0,30 -s 120x120}
${goto 200}${color ffe595}WIND: $color${alignr}${execpi 600 sed -n '6p' $HOME/Conky_WeatherCom/RightNow/raw_rn} ${execpi 600 sed -n '7p' $HOME/Conky_WeatherCom/RightNow/raw_rn}mph
${goto 200}${color ffe595}HUMIDITY: $color${alignr}${execpi 600 sed -n '8p' $HOME/Conky_WeatherCom/RightNow/raw_rn}
${goto 200}${color ffe595}DEW POINT: $color${alignr}${execpi 600 sed -n '9p' $HOME/Conky_WeatherCom/RightNow/raw_rn}°F
${goto 200}${color ffe595}VISIBILITY: $color${alignr}${execpi 600 sed -n '10p' $HOME/Conky_WeatherCom/RightNow/raw_rn}
${goto 200}${color ffe595}PRESSURE: $color${alignr}${execpi 600 sed -n '11p' $HOME/Conky_WeatherCom/RightNow/raw_rn}
${goto 200}${color ffe595}UV INDEX: $color${alignr}${execpi 600 sed -n '12p' $HOME/Conky_WeatherCom/RightNow/raw_rn}
${font Arial:size=12}${color ffe595}TODAY - TONIGHT ${font}(Upd: ${execpi 600 sed -n '3p' $HOME/Conky_WeatherCom/updated}) ${hr 2}
${font Arial:size=11}${color ffe595}${goto 75}Today${goto 240}Tonight${image $HOME/Conky_WeatherCom/TD.png -p 35,170 -s 100x100}${image $HOME/Conky_WeatherCom/TN.png -p 200,170 -s 100x100}${font}${color}






${execpi 600 sed -n '2,16p' $HOME/Conky_WeatherCom/Today/final_today}
${font Arial:size=12}${color ffe595}10 DAYS FORECAST ${font}(Upd: ${execpi 600 sed -n '4p' $HOME/Conky_WeatherCom/updated})${hr 2}
${font Arial:size=11}${color ffe595}${goto 65}${execpi 600 sed -n '1p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 175}${execpi 600 sed -n '8p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 285}${execpi 600 sed -n '15p' $HOME/Conky_WeatherCom/10days/raw_10}${color}${image $HOME/Conky_WeatherCom/10_2.png -p 20,500 -s 70x70}${image $HOME/Conky_WeatherCom/10_9.png -p 130,500 -s 70x70}${image $HOME/Conky_WeatherCom/10_16.png -p 240,500 -s 70x70}

${goto 115}${execpi 600 sed -n '3p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 225}${execpi 600 sed -n '10p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 335}${execpi 600 sed -n '17p' $HOME/Conky_WeatherCom/10days/raw_10}${font}
${goto 116}${execpi 600 sed -n '4p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 226}${execpi 600 sed -n '11p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 336}${execpi 600 sed -n '18p' $HOME/Conky_WeatherCom/10days/raw_10}

${execpi 600 sed -n '5p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-18}${goto 135}${execpi 600 sed -n '12p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-18}${goto 260}${execpi 600 sed -n '19p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-18}
${color ffe595}PRECIP:${color}${execpi 600 sed -n '6p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 135}${color ffe595}PRECIP:${color}${execpi 600 sed -n '13p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 260}${color ffe595}PRECIP:${color}${execpi 600 sed -n '20p' $HOME/Conky_WeatherCom/10days/raw_10}
${color ffe595}WIND:${color}${execpi 600 sed -n '7p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 135}${color ffe595}WIND:${color}${execpi 600 sed -n '14p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 260}${color ffe595}WIND:${color}${execpi 600 sed -n '21p' $HOME/Conky_WeatherCom/10days/raw_10}
${color ffe595}${hr 1}
${font Arial:size=11}${goto 65}${execpi 600 sed -n '22p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 175}${execpi 600 sed -n '29p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 285}${execpi 600 sed -n '36p' $HOME/Conky_WeatherCom/10days/raw_10}${color}${image $HOME/Conky_WeatherCom/10_23.png -p 20,640 -s 70x70}${image $HOME/Conky_WeatherCom/10_30.png -p 130,640 -s 70x70}${image $HOME/Conky_WeatherCom/10_37.png -p 240,640 -s 70x70}

${goto 115}${execpi 600 sed -n '24p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 225}${execpi 600 sed -n '31p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 335}${execpi 600 sed -n '38p' $HOME/Conky_WeatherCom/10days/raw_10}${font}
${goto 116}${execpi 600 sed -n '25p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 226}${execpi 600 sed -n '32p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 336}${execpi 600 sed -n '39p' $HOME/Conky_WeatherCom/10days/raw_10}

${execpi 600 sed -n '26p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-18}${goto 135}${execpi 600 sed -n '33p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-18}${goto 260}${execpi 600 sed -n '40p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-18}
${color ffe595}PRECIP:${color}${execpi 600 sed -n '27p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 135}${color ffe595}PRECIP:${color}${execpi 600 sed -n '34p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 260}${color ffe595}PRECIP:${color}${execpi 600 sed -n '41p' $HOME/Conky_WeatherCom/10days/raw_10}
${color ffe595}WIND:${color}${execpi 600 sed -n '28p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 135}${color ffe595}WIND:${color}${execpi 600 sed -n '35p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 260}${color ffe595}WIND:${color}${execpi 600 sed -n '42p' $HOME/Conky_WeatherCom/10days/raw_10}
${color ffe595}${hr 1}
${font Arial:size=11}${goto 50}${execpi 600 sed -n '43p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 135}${execpi 600 sed -n '50p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 220}${execpi 600 sed -n '57p' $HOME/Conky_WeatherCom/10days/raw_10}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${goto 305}${execpi 600 sed -n '64p' $HOME/Conky_WeatherCom/10days/raw_10}${endif}${color}${image $HOME/Conky_WeatherCom/10_44.png -p 0,780 -s 55x55}${image $HOME/Conky_WeatherCom/10_51.png -p 85,780 -s 55x55}${image $HOME/Conky_WeatherCom/10_58.png -p 170,780 -s 55x55}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${image $HOME/Conky_WeatherCom/10_65.png -p 255,780 -s 55x55}${endif}${font}

${goto 75}${execpi 600 sed -n '45p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 160}${execpi 600 sed -n '52p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 245}${execpi 600 sed -n '59p' $HOME/Conky_WeatherCom/10days/raw_10}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${goto 330}${execpi 600 sed -n '66p' $HOME/Conky_WeatherCom/10days/raw_10}${endif}
${goto 76}${execpi 600 sed -n '45p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 160}${execpi 600 sed -n '53p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 245}${execpi 600 sed -n '60p' $HOME/Conky_WeatherCom/10days/raw_10}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${goto 330}${execpi 600 sed -n '67p' $HOME/Conky_WeatherCom/10days/raw_10}${endif}

${execpi 600 sed -n '47p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-12}${goto 95}${execpi 600 sed -n '54p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-12}${goto 180}${execpi 600 sed -n '61p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-12}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${goto 265}${execpi 600 sed -n '68p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c1-12}${endif}
${execpi 600 sed -n '47p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c13-24}${goto 95}${execpi 600 sed -n '54p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c13-24}${goto 180}${execpi 600 sed -n '61p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c13-24}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${goto 265}${execpi 600 sed -n '68p' $HOME/Conky_WeatherCom/10days/raw_10|cut -c13-24}${endif}
${color ffe595}PR:${color}${execpi 600 sed -n '48p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 95}${color ffe595}PR:${color}${execpi 600 sed -n '55p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 180}${color ffe595}PR:${color}${execpi 600 sed -n '62p' $HOME/Conky_WeatherCom/10days/raw_10}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${goto 265}${color ffe595}PR:${color}${execpi 600 sed -n '69p' $HOME/Conky_WeatherCom/10days/raw_10}${endif}
${color ffe595}W:${color}${execpi 600 sed -n '49p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 95}${color ffe595}W:${color}${execpi 600 sed -n '56p' $HOME/Conky_WeatherCom/10days/raw_10}${goto 180}${color ffe595}W:${color}${execpi 600 sed -n '63p' $HOME/Conky_WeatherCom/10days/raw_10}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${goto 265}${color ffe595}W:${color}${execpi 600 sed -n '70p' $HOME/Conky_WeatherCom/10days/raw_10}${endif}

and thanks a lot for your sharp eye.

EDIT: Jesus, it's also in the metric one...

Last edited by TeoBigusGeekus (2013-03-05 19:59:28)


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

#729 2013-03-06 04:11:10

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 2,144

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

TeoBigusGeekus wrote:
KrunchTime wrote:

First, look at the wind info for Tuesday next week.  It looks like more spacing is needed.

Nothing I can do about that. I could use a smaller font for the wind I suppose, but it was a risk I chose to take in order to compromise looks and readability.

Okay, I see what you mean.

TeoBigusGeekus wrote:
KrunchTime wrote:

Second, look at the forecast for Thursday next week.  The icon indicates rain, but the text says "Mostly Sunny".

That's because I'm a total wanker!
In my bundled conkyrc, around line 100, there's this bit:

${image $HOME/Conky_WeatherCom/10_58.png -p 170,780 -s 55x55}${if_existing /home/teo/Conky_WeatherCom/10days/10days_OK}${image $HOME/Conky_WeatherCom/10_58.png -p 255,780 -s 55x55}${endif}${font}

See? Image 10_58.png is repeated twice. After all these months, you're the first to notice.

Perhaps the weather conditions enabled the bug to appear?

TeoBigusGeekus wrote:

Use this conkyrc
and thanks a lot for your sharp eye.

You're welcome and thank you for taking the time to come up with, and continue to maintain, these wonderful scripts.   wink

However, I'm not going to use your updated script because I think there's another bug in the script; ref the screenshot. 

2013_03_05_1362538893_377x907_scrot.jpg

See anything unusual for the Wednesday (tomorrow) forecast?   Following is some of the text in the raw_10 file:

Tonight
5.png
51
32
Rain / Snow / Wind
100%
ENE 20mph
Wed
42.png
36
32
"wx-phrase Heavy Snow / Wind
100%
N 26mph
Thu
30.png
42
31
Partly Cloudy
20%
NW 19mph
Fri
24.png
43
30
Partly Cloudy / Wind
10%
NNW 24mph

Last edited by KrunchTime (2013-03-06 04:12:19)

Offline

#730 2013-03-06 06:26:20

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 2,144

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

Another issue has appeared; see bottom of 10 day forecast.

2013_03_06_1362550394_379x908_scrot.jpg

Here's the raw_10 file (link expires on 03/13/2013):
https://www.asuswebstorage.com/navigate … 09904E0314

Offline

#731 2013-03-06 19:05:23

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

I think they are temporary weather.com hiccups.
If you look at the source code of the 10days page, the forecast phrase is always preceded by "wx-phrase"> or "wx-phrase wx-severe">.
How on earth did your location manage to get a "wx phrase Forecast phrase I don't know.

As for the other bug, I presume it was when weather.com was about to change their page; the script assumes that there are 9 or 10 days' forecast: it will fail if there are 8 or less.

Please monitor it and post back. Thanks again for your persistence.


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

#732 2013-03-07 07:22:59

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 2,144

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

I've decided that I only need a 6-day forecast, so I've commented out the lines providing the last 4 days of the 10-day forecast, so I will not be monitoring the last four days of the 10-day forecast.  Thanks for your help, though.

Last edited by KrunchTime (2013-03-07 07:23:25)

Offline

#733 2013-03-07 15:50:40

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

You're welcome mate - thank YOU for your contribution.
I'll monitor it for one more day and then update the scripts...
Thanks again.

EDIT: Looks OK for the moment:
RqjeHN5s.jpg

Last edited by TeoBigusGeekus (2013-03-07 15:54:54)


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

#734 2013-03-08 18:32:17

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

ANNOUNCEMENT
Minor update of the weather.com script (#4). Tiny bug corrected in both conkyrcs (US and metric) and a certain condition occurring during severe weather can now be recognised from the US script. Once again, thanks to Krunchtime for his patience and his sharp eye.


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

#735 2013-03-08 18:40:21

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

^ Nice Teo! Thanks for the update

@KrunchTime, well done... It is always thought the devs know all and see all... I know I appreciate it when users find and point out issues and better ways to get it done


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#736 2013-03-08 18:50:25

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

VastOne wrote:

^ Nice Teo! Thanks for the update

@KrunchTime, well done... It is always thought the devs know all and see all... I know I appreciate it when users find and point out issues and better ways to get it done

Thanks VastOne!


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

#737 2013-03-09 10:44:56

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 2,144

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

@Teo
Creating is hard work.  Critiquing is easy work.   wink

@VastOne
Thanks!   big_smile

Offline

#738 2013-03-13 21:52:27

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

This is a long thread, and perhaps the answer is in here somewhere, but I cant find it. Anyway, here is my question. I`m using "Conky-HTC-AccuW-AG-EN" , and it seems to work just fine. I only have one issue, and that is todays "High" temp. It doesn`t display anything else than "H:  -`C. The number is missing...

I`ve tracked it to this code:

	# HIGHS AND LOWS FOR TODAY #
${goto 210}${font Bitstream Vera Sans Mono:style=Bold:size=14}${color3}H: ${color4}${execpi 600 sed -n '3p' $HOME/.Conky/02-Conky-HTC-AccuW-AG-EN/Accuweather/first_days}°C${voffset 22}${goto 210}${color3}L: ${color5}${execpi 600 sed -n '4p' $HOME/.Conky/02-Conky-HTC-AccuW-AG-EN/Accuweather/first_days}°C${font}${color}

It`s the first bit for the high-temp that fails to display a temperature. The low-temp works fine. Is `3p` wrong for high-temp? Or can anyone spot something that`s off? The app was downloaded from here: http://gtk-apps.org/content/show.php/Co … ent=156485 , and the above code is unchanged by me.


- apt-mark hold account

Offline

#739 2013-03-13 22:05:06

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

As explained in the file "1d1_Output_of_the_script.pdf", the 3rd line of the first_days file (sed -n '3p' $HOME/.Conky/02-Conky-HTC-AccuW-AG-EN/Accuweather/first_days) contains the Today's high for the night and is always a dash (-), I think, therefore it isn't used in my .conkyrc.
I'm waiting for Doruletz for an explanation, though you could post in gtk-apps.org to help others using Doruletz's magnificent app.


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

#740 2013-03-13 22:21:48

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

TeoBigusGeekus wrote:

As explained in the file "1d1_Output_of_the_script.pdf", the 3rd line of the first_days file (sed -n '3p' $HOME/.Conky/02-Conky-HTC-AccuW-AG-EN/Accuweather/first_days) contains the Today's high for the night and is always a dash (-), I think, therefore it isn't used in my .conkyrc.
I'm waiting for Doruletz for an explanation, though you could post in gtk-apps.org to help others using Doruletz's magnificent app.

Ok, thanks, and yes, it`s an awesome app. Just what I`ve been looking for. In addition to the useful weatherfeature, it`s a visual masterpiece. I can`t imagine anything looking better than this, so I guess my search is over. The only thing is that it covers to much of the wallpaper I`m using now, so I probably will modify the app in two pieces. Autostart the top part with openbox, and then start and kill the bottom part manually. Don`t know how I will do it though. I could also keep the app as it is, but create a new version with only the top part, and then switch them as I want. Kill the short-version, launch the full version, and vice versa. Well,  at least I have a project:)


- apt-mark hold account

Offline

#741 2013-03-13 22:31:47

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

ew wrote:

Ok, thanks, and yes, it`s an awesome app. Just what I`ve been looking for. In addition to the useful weatherfeature, it`s a visual masterpiece. I can`t imagine anything looking better than this, so I guess my search is over. The only thing is that it covers to much of the wallpaper I`m using now, so I probably will modify the app in two pieces. Autostart the top part with openbox, and then start and kill the bottom part manually. Don`t know how I will do it though. I could also keep the app as it is, but create a new version with only the top part, and then switch them as I want. Kill the short-version, launch the full version, and vice versa. Well,  at least I have a project:)

Since you're using openbox, you could add a custom button directive to your rc.xml, say something like

<keybind key="Alt_L">
      <action name="execute">
        <execute>conky -c /path/to/bottompart/conkyrc</execute>
      </action>
    </keybind>

to launch the bottom part with your left alt key.
Just a suggestion  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

#742 2013-03-14 00:53:29

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

TeoBigusGeekus wrote:
ew wrote:

Ok, thanks, and yes, it`s an awesome app. Just what I`ve been looking for. In addition to the useful weatherfeature, it`s a visual masterpiece. I can`t imagine anything looking better than this, so I guess my search is over. The only thing is that it covers to much of the wallpaper I`m using now, so I probably will modify the app in two pieces. Autostart the top part with openbox, and then start and kill the bottom part manually. Don`t know how I will do it though. I could also keep the app as it is, but create a new version with only the top part, and then switch them as I want. Kill the short-version, launch the full version, and vice versa. Well,  at least I have a project:)

Since you're using openbox, you could add a custom button directive to your rc.xml, say something like

<keybind key="Alt_L">
      <action name="execute">
        <execute>conky -c /path/to/bottompart/conkyrc</execute>
      </action>
    </keybind>

to launch the bottom part with your left alt key.
Just a suggestion  wink

Thanks. That is a very nice way to do it. I will start configure the split-parts, but first I`m registering an account at GTK-apps to ask politely for an explaniation of the "sed -n '3p' " issue:)


- apt-mark hold account

Offline

#743 2013-03-20 22:27:00

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

Accuweather's changed all their icons naming.
All the 1* scripts are lacking image output.
Will deal with it as soon as possible - it will be quite a huge update, but I've seen worse.
Stay tuned!!!


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

#744 2013-03-21 01:48:55

Doruletz
Member
Registered: 2012-12-05
Posts: 35

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

TeoBigusGeekus wrote:

As explained in the file "1d1_Output_of_the_script.pdf", the 3rd line of the first_days file (sed -n '3p' $HOME/.Conky/02-Conky-HTC-AccuW-AG-EN/Accuweather/first_days) contains the Today's high for the night and is always a dash (-), I think, therefore it isn't used in my .conkyrc.
I'm waiting for Doruletz for an explanation, though you could post in gtk-apps.org to help others using Doruletz's magnificent app.

Here I am Teo, what's the problem??
Of course the max temp for the day is going to be a "-" (dash) after the daily maximum is reached...
Makes sense, right?


Linux ROCKS, Winodw$ SUCKS.
And Mac is just an overpriced dumbed down version of "Linux for Dummies"

Offline

#745 2013-03-21 01:52:10

Doruletz
Member
Registered: 2012-12-05
Posts: 35

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

ew wrote:
TeoBigusGeekus wrote:

As explained in the file "1d1_Output_of_the_script.pdf", the 3rd line of the first_days file (sed -n '3p' $HOME/.Conky/02-Conky-HTC-AccuW-AG-EN/Accuweather/first_days) contains the Today's high for the night and is always a dash (-), I think, therefore it isn't used in my .conkyrc.
I'm waiting for Doruletz for an explanation, though you could post in gtk-apps.org to help others using Doruletz's magnificent app.

Ok, thanks, and yes, it`s an awesome app. Just what I`ve been looking for. In addition to the useful weatherfeature, it`s a visual masterpiece. I can`t imagine anything looking better than this, so I guess my search is over. The only thing is that it covers to much of the wallpaper I`m using now, so I probably will modify the app in two pieces. Autostart the top part with openbox, and then start and kill the bottom part manually. Don`t know how I will do it though. I could also keep the app as it is, but create a new version with only the top part, and then switch them as I want. Kill the short-version, launch the full version, and vice versa. Well,  at least I have a project:)


Junkie, ew, Teo, and anybody else:
You all have my express permission to modify it as you see fit, my only condition is that you post it both here and in GTK for others to have a choice, my version or yours.
Who knows, I might even like your version better....
After all, that's what Linux is all about, right?
By the people, for the people...

As far as the issue of the app taking too much space on the desktop, I don't mind, but others might.
SOLUTION: You can shrink everything, from text (font size), to icon size, to background image size, and make the whole app as small as you like.
It will be just the opposite of what I did when I took the simple HTC phone app (small size) and modify it into what you see now.

Last edited by Doruletz (2013-03-21 02:04:52)


Linux ROCKS, Winodw$ SUCKS.
And Mac is just an overpriced dumbed down version of "Linux for Dummies"

Offline

#746 2013-03-21 01:56:13

Doruletz
Member
Registered: 2012-12-05
Posts: 35

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

TeoBigusGeekus wrote:

Accuweather's changed all their icons naming.
All the 1* scripts are lacking image output.
Will deal with it as soon as possible - it will be quite a huge update, but I've seen worse.
Stay tuned!!!

Teo, please fix it, like you always do...
Like others said here, you are the Captain of our ship, we just follow you.
I promise I will re-post my app, both here and in GTK, once you fix the Accuweather script and icon naming.
Thanks.

EDIT:
Mine looks weird again now, here's a snapshot:


Accuweather_Snapshot3_zps340d8e12.jpg


----------------------------------------------------------------------------------------------------------------------------
Please use thumbnails (please try to avoid the large thumbnail imgur.com code) linking to the larger image to help those of us with slow connections. An example of the code needed is below. Most image hosting sites will automatically generate this for you as well. Users have been using postimage.org lately which does a nice job.

[url=http://link.to.your.fullsized.image][img]http://link.to.your.thumbnail.image[/img][/url]

Last edited by Doruletz (2013-03-21 02:10:57)


Linux ROCKS, Winodw$ SUCKS.
And Mac is just an overpriced dumbed down version of "Linux for Dummies"

Offline

#747 2013-03-21 02:22:49

ew
#! Die Hard
Registered: 2012-09-27
Posts: 1,975

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

Doruletz wrote:
TeoBigusGeekus wrote:

As explained in the file "1d1_Output_of_the_script.pdf", the 3rd line of the first_days file (sed -n '3p' $HOME/.Conky/02-Conky-HTC-AccuW-AG-EN/Accuweather/first_days) contains the Today's high for the night and is always a dash (-), I think, therefore it isn't used in my .conkyrc.
I'm waiting for Doruletz for an explanation, though you could post in gtk-apps.org to help others using Doruletz's magnificent app.

Here I am Teo, what's the problem??
Of course the max temp for the day is going to be a "-" (dash) after the daily maximum is reached...
Makes sense, right?

Ok, so it means that the high temp is reached before, but I guess it also could display what the highest figure was. It looks better in the conky if there is a number, and not just a dash. Well, I guess I could fix it visually by displaying my CPU-temp instead. That way it would be warm and nice always:)


- apt-mark hold account

Offline

#748 2013-03-21 06:29:23

Doruletz
Member
Registered: 2012-12-05
Posts: 35

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

ew wrote:
Doruletz wrote:
TeoBigusGeekus wrote:

As explained in the file "1d1_Output_of_the_script.pdf", the 3rd line of the first_days file (sed -n '3p' $HOME/.Conky/02-Conky-HTC-AccuW-AG-EN/Accuweather/first_days) contains the Today's high for the night and is always a dash (-), I think, therefore it isn't used in my .conkyrc.
I'm waiting for Doruletz for an explanation, though you could post in gtk-apps.org to help others using Doruletz's magnificent app.

Here I am Teo, what's the problem??
Of course the max temp for the day is going to be a "-" (dash) after the daily maximum is reached...
Makes sense, right?

Ok, so it means that the high temp is reached before, but I guess it also could display what the highest figure was. It looks better in the conky if there is a number, and not just a dash. Well, I guess I could fix it visually by displaying my CPU-temp instead. That way it would be warm and nice always:)


ew, that is most likely possible, I just don't know how, and it doesn't bother me too much anyways.
Why would I want to know how hot it was early on today? I need to know how hot will it get when I leave home in the morning, not how hot it was, I can figure that out by looking at my phone around 2-3PM...

Last edited by Doruletz (2013-03-21 06:29:47)


Linux ROCKS, Winodw$ SUCKS.
And Mac is just an overpriced dumbed down version of "Linux for Dummies"

Offline

#749 2013-03-21 12:58:15

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

1a submitted for testing:

#!/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/en/si/ljubljana/299198/weather-forecast/299198"
#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/accuweather_conky/curr_cond_raw "$curr_addr"

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

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

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

    sed -i '/detail-now/,/#details/!d' $HOME/accuweather_conky/curr_cond_raw
    egrep -i '"cond"|icon i-|detail-tab-panel' $HOME/accuweather_conky/curr_cond_raw > $HOME/accuweather_conky/curr_cond
    sed -i -e 's/^.*detail-tab-panel //g' -e 's/^.*icon i-//g' -e 's/"><\/div>.*$//g' $HOME/accuweather_conky/curr_cond
    sed -i -e 's/^.*"cond">//g' -e 's/&deg/\n/g' -e 's/<\/span>.*"temp">/\n/g' -e 's/<.*>//g' $HOME/accuweather_conky/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/accuweather_conky/curr_cond
    image=$(sed -n 2p $HOME/accuweather_conky/curr_cond)
    sed -i 2s/$image/$(test_image $image)/ $HOME/accuweather_conky/curr_cond

fi

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

    sed -i '/feed-tabs/,/\.feed-tabs/!d' $HOME/accuweather_conky/tod_ton_raw
    egrep -i 'Early AM|Today|Tonight|Overnight|icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' $HOME/accuweather_conky/tod_ton_raw > $HOME/accuweather_conky/tod_ton
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' $HOME/accuweather_conky/tod_ton
    sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' $HOME/accuweather_conky/tod_ton
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' $HOME/accuweather_conky/tod_ton
	sed -i -e 's/Early AM/EARLY AM/' -e 's/Today/TODAY/' -e 's/Tonight/TONIGHT/' -e 's/Overnight/OVERNIGHT/' -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' -e 's/-[a-z].*$//g' $HOME/accuweather_conky/tod_ton
    time=$(sed -n 1p $HOME/accuweather_conky/tod_ton)
    image=$(sed -n 2p $HOME/accuweather_conky/tod_ton)
	if [[ $time == TODAY ]]; then
	    sed -i 2s/$image/$(test_image $image)/ $HOME/accuweather_conky/tod_ton
	elif [[ $time == TONIGHT || $time == OVERNIGHT || $time == "EARLY AM" ]]; then
	    sed -i 2s/$image/$(test_image $image)/ $HOME/accuweather_conky/tod_ton
        sed -i 3a- $HOME/accuweather_conky/tod_ton
	fi
    for (( i=7; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p $HOME/accuweather_conky/tod_ton)
	      sed -i ${i}s/$image/$(test_image $image)/ $HOME/accuweather_conky/tod_ton
	  done

fi

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

    sed -i '/feed-tabs/,/\.feed-tabs/!d' $HOME/accuweather_conky/last_days_raw
    egrep -i 'icon i-|cond|temp|Mon|Tue|Wed|Thu|Fri|Sat|Sun' $HOME/accuweather_conky/last_days_raw > $HOME/accuweather_conky/last_days
    sed -i -e 's/^.*#">//g' -e 's/^.*icon i-//g' -e 's/^.*cond">//g' -e 's/^.*temp">//g' $HOME/accuweather_conky/last_days
    sed -i -e 's/Lo<\/span> /\n/g' -e 's/<\/a>.*$//g' -e 's/ "><.*$//g' -e 's/&#.*$//g' -e 's/teo//g' $HOME/accuweather_conky/last_days
    sed -i -e 's/<span>.*$//g' -e 's/<\/span>//g' -e 's/\r$//g' -e 's/ i-alarm.*$//g' $HOME/accuweather_conky/last_days
	sed -i -e 's/Mon$/MONDAY/' -e 's/Tue$/TUESDAY/' -e 's/Wed$/WEDNESDAY/' -e 's/Thu$/THURSDAY/' -e 's/Fri$/FRIDAY/' -e 's/Sat$/SATURDAY/' -e 's/Sun$/SUNDAY/' -e 's/-[a-z].*$//g' $HOME/accuweather_conky/last_days
    for (( i=2; i<=22; i+=5 ))
	  do
          image=$(sed -n "${i}"p $HOME/accuweather_conky/last_days)
	      sed -i ${i}s/$image/$(test_image $image)/ $HOME/accuweather_conky/last_days
	  done

fi

kill -CONT $(pidof conky)

Last edited by TeoBigusGeekus (2013-03-21 13:10:35)


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

Help fund CrunchBang, donate to the project!

#750 2013-03-21 12:59:31

TeoBigusGeekus
#! Die Hard
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 687

Re: Conky weather+moon scripts (Accuw/WUndergr/NWS/Weather.com/Lunaf.com)

1c unaffected.


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

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo