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: 963

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

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: 3,264

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

Offline

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

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

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

${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}

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: 3,264

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

${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}

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: 3,264

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

Offline

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

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

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

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: 3,264

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

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: 963

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

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: 963

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


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,165
Website

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

^ 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

Offline

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

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

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


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: 3,264

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

@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/MoonGiant)

	# 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}

- apt-mark hold account

Offline

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

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

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

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/MoonGiant)


- apt-mark hold account

Offline

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

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

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

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

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/MoonGiant)

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

- apt-mark hold account

Offline

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

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

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

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/MoonGiant)


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/MoonGiant)

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/MoonGiant)

[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/MoonGiant)


- 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/MoonGiant)

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: 963

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

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: 963

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

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.
Server: bleh

Debian Logo