SEARCH

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

You are not logged in.

#451 2012-09-30 10:19:29

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

I think I've found it.
Apart from some tiny details that have changed, the accuweather usa page is different when the Early AM forecast is present.
I'll monitor it today and perhaps tomorrow morning and post the necessary update.
Perhaps there'll be more changes in their layout the following days/weeks and I'm expecting a change in their international page as well.
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

Be excellent to each other!

#452 2012-09-30 15:52:08

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,409
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

TeoBigusGeekus wrote:

Stay tuned...

They aren't being very friendly.  Did they ask you for your advice?  lol

We should get a few of them converted to Linux.  big_smile

Online

#453 2012-09-30 16:49:42

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

Sector11 wrote:
TeoBigusGeekus wrote:

Stay tuned...

They aren't being very friendly.  Did they ask you for your advice?  lol

We should get a few of them converted to Linux.  big_smile

Not very sporting of them I'll have to admit me old chap...
But I was getting rusty and it was a good exercise after all these idle months.
Anyway, the scripts are ready, I'll just have to wait until tomorrow (Greek) morning to test them once more against the (US) Early AM and I'll upload them.


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

#454 2012-09-30 18:53:59

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 824
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

TeoBigusGeekus wrote:

Not very sporting of them I'll have to admit me old chap...
But I was getting rusty and it was a good exercise after all these idle months.
Anyway, the scripts are ready, I'll just have to wait until tomorrow (Greek) morning to test them once more against the (US) Early AM and I'll upload them.


Cool I was just coming to give you a heads up again cuz I started getting errors and things werent updating like they should. Looks like your on it though. Thanks buddy.
Heres my startup errors in case you need them

luke@crunchbang-desktop:~$ ~/Conky/conky_start.sh
WARNING: gnome-keyring:: couldn't connect to: /home/luke/.cache/keyring-F8P01e/pkcs11: No such file or directory
Conky: desktop window (1800003) is subwindow of root window (28f)
Conky: window type - normal
Conky: drawing to created window (0x2e00002)
Conky: drawing to double buffer
luke@crunchbang-desktop:~$ WARNING: gnome-keyring:: couldn't connect to: /home/luke/.cache/keyring-F8P01e/pkcs11: No such file or directory
Conky: desktop window (1800003) is subwindow of root window (28f)
Conky: window type - normal
Conky: drawing to created window (0x3000002)
Conky: drawing to double buffer
wget: no process found
--2012-09-30 11:49:55--  http://www.accuweather.com/en/us/monrovia-ca/91016/current-weather/91016us?day=1
Resolving www.accuweather.com (www.accuweather.com)... 63.80.4.8, 63.80.4.26
Connecting to www.accuweather.com (www.accuweather.com)|63.80.4.8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw'

    [  <=>                                  ] 93,496       338K/s   in 0.3s    

2012-09-30 11:50:00 (338 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw' saved [93496]

--2012-09-30 11:50:00--  http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/38115_pc
Resolving www.accuweather.com (www.accuweather.com)... 63.80.4.8, 63.80.4.26
Connecting to www.accuweather.com (www.accuweather.com)|63.80.4.8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw'

    [  <=>                                  ] 98,209       335K/s   in 0.3s    

2012-09-30 11:50:01 (335 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw' saved [98209]

--2012-09-30 11:50:01--  http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/38115_pc?day=6
Resolving www.accuweather.com (www.accuweather.com)... 63.80.4.8, 63.80.4.26
Connecting to www.accuweather.com (www.accuweather.com)|63.80.4.8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/last_days_raw'

    [  <=>                                  ] 98,090       334K/s   in 0.3s    

2012-09-30 11:50:07 (334 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/last_days_raw' saved [98090]

cp: cannot stat `/home/luke/Accuweather_Conky_USA_Images/Forecast_Images/.png': No such file or directory
cp: cannot stat `/home/luke/Accuweather_Conky_USA_Images/Forecast_Images/.png': No such file or directory
wget: no process found
--2012-09-30 11:50:08--  http://www.accuweather.com/en/us/monrovia-ca/91016/current-weather/91016us?day=1
Resolving www.accuweather.com (www.accuweather.com)... 63.110.246.57, 63.110.246.73
Connecting to www.accuweather.com (www.accuweather.com)|63.110.246.57|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw'

    [  <=>                                  ] 93,589       340K/s   in 0.3s    

2012-09-30 11:50:13 (340 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw' saved [93589]

--2012-09-30 11:50:13--  http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/38115_pc
Resolving www.accuweather.com (www.accuweather.com)... 63.80.4.26, 63.80.4.8
Connecting to www.accuweather.com (www.accuweather.com)|63.80.4.26|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw'

    [  <=>                                  ] 98,153       333K/s   in 0.3s    

2012-09-30 11:50:19 (333 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw' saved [98153]

--2012-09-30 11:50:19--  http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/38115_pc?day=6
Resolving www.accuweather.com (www.accuweather.com)... 63.80.4.8, 63.80.4.26
Connecting to www.accuweather.com (www.accuweather.com)|63.80.4.8|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/last_days_raw'

    [  <=>                                  ] 97,969       335K/s   in 0.3s    

2012-09-30 11:50:25 (335 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/last_days_raw' saved [97969]

cp: cannot stat `/home/luke/Accuweather_Conky_USA_Images/Forecast_Images/.png': No such file or directory
cp: cannot stat `/home/luke/Accuweather_Conky_USA_Images/Forecast_Images/.png': No such file or directory

Offline

#455 2012-09-30 18:57:41

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

If you wanna test it before I upload it tomorrow (just to be sure), here goes:

#!/bin/bash

#function: test_image_day
test_image_day () {
    case $1 in
         su)
           echo 1su
         ;;
         msu)
           echo 2msu
         ;;
         psu)
           echo 3psu
         ;;
         ic)
           echo 4ic
         ;;
         h)
           echo 5h
         ;;
         mc)
           echo 6mc
         ;;
         c)
           echo 7c
         ;;
         d)
           echo 8d
         ;;
         f)
           echo 9f
         ;;
         s)
           echo 10s
         ;;
         mcs)
           echo 11mcs
         ;;
         psus)
           echo 12psus
         ;;
         t)
           echo 13t
         ;;
         mct)
           echo 14mct
         ;;
         psut)
           echo 15psut
         ;;
         r)
           echo 16r
         ;;
         fl)
           echo 17fl
         ;;
         mcfl)
           echo 18mcfl
         ;;
         psfl)
           echo 19psfl
         ;;
         sn)
           echo 20sn
         ;;
         mcsn)
           echo 21mcsn
         ;;
         i)
           echo 22i
         ;;
         sl)
           echo 23sl
         ;;
         fr)
           echo 24fr
         ;;
         rsn)
           echo 25rsn
         ;;
         w)
           echo 26w
         ;;
         ho)
           echo 27ho
         ;;
         co)
           echo 28co
         ;;
         cl)
           echo 29cl 
         ;;
         mcl)
           echo 31mcl
         ;;
         pc)
           echo 32pc 
         ;;
         pcs)
           echo 36pcs
         ;;
         pct)
           echo 38pct 
         ;;
        esac
} 

#function: test_image_night
test_image_night () {
    case $1 in
         su)
           echo 1su
         ;;
         msu)
           echo 2msu
         ;;
         psu)
           echo 3psu
         ;;
         c)
           echo 7c
         ;;
         d)
           echo 8d
         ;;
         f)
           echo 9f
         ;;
         s)
           echo 10s
         ;;
         psus)
           echo 12psus
         ;;
         t)
           echo 13t
         ;;
         psut)
           echo 15psut
         ;;
         r)
           echo 16r
         ;;
         fl)
           echo 17fl
         ;;
         psfl)
           echo 19psfl
         ;;
         sn)
           echo 20sn
         ;;
         i)
           echo 22i
         ;;
         sl)
           echo 23sl
         ;;
         fr)
           echo 24fr
         ;;
         rsn)
           echo 25rsn
         ;;
         ho)
           echo 27ho
         ;;
         co)
           echo 28co
         ;;
         cl)
           echo 29cl 
         ;;
         w)
           echo 30w
         ;;
         mcl)
           echo 31mcl
         ;;
         pc)
           echo 32pc 
         ;;
         ic)
           echo 33ic
         ;;
         h)
           echo 34h
         ;;
         mc)
           echo 35mc 
         ;;
         pcs)
           echo 36pcs
         ;;
         mcs)
           echo 37mcs 
         ;;
         pct)
           echo 38pct 
         ;;
         mct)
           echo 39mct 
         ;;
         mcfl)
           echo 40mcfl 
         ;;
         mcsn)
           echo 41mcsn 
         ;;
        esac
}

#put your Accuweather address here
address="http://www.accuweather.com/en/us/los-angeles-ca/90012/weather-forecast/347625"
#address="http://www.accuweather.com/en/us/new-york-ny/10007/weather-forecast/349727"


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

kill -STOP $(pidof conky)
killall wget

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$loc_id"us?day=1
wget -O $HOME/Accuweather_Conky_USA_Images/curr_cond_raw "$curr_addr"

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

early_am=$(grep "Early AM" $HOME/Accuweather_Conky_USA_Images/tod_ton_raw | wc -l)
if (( $early_am==0 )); then
    addr2="$addr1"?day=6
else
    addr2="$addr1"?day=5    
fi
wget -O $HOME/Accuweather_Conky_USA_Images/last_days_raw "$addr2"


if [[ -s $HOME/Accuweather_Conky_USA_Images/curr_cond_raw ]]; then

    #current conditions
    sed -i '/detail-now/,/Moonrise/!d' $HOME/Accuweather_Conky_USA_Images/curr_cond_raw
    egrep -i '"cond"|Humidity|Pressure|Cloud Cover|UV Index|Dew Point|Precipitation|Visibility|AM|PM|mph|icons-wind|detail-tab-panel|icon i-' $HOME/Accuweather_Conky_USA_Images/curr_cond_raw > $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/\r//g' -e 's/^.*icon i-//g' -e 's/^.*tab-panel //g' -e 's/^.*start">//g' -e 's/^.*finish">//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i 's/^.*<li>//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/<strong>//g' -e 's/<\/strong>//g' -e 's/<\/li>//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/^.*center;">//g' -e 's/^.*icons-wind\///g' -e 's/\.gif.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/^.*"cond">//g' -e 's/temp">/\n/g' -e 's/realfeel">/\n/g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/">.*$//g' -e 's/<\/span>.*$//g' -e 's/<span>.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/&#176;//g' -e 's/&nbsp;//g' -e 's/RealFeel&#174; //g' -e 's/<\/div>.*//g' -e '8,9d' -e "s/^.*var s = '//g" -e "s/';//g" $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' -e '/-->/d' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/Dew Point: //g' -e 's/Precipitation(1 hr): //g' -e 's/Visibility: //g' -e '7d' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    time=$(sed -n 1p $HOME/Accuweather_Conky_USA_Images/curr_cond)
    image=$(sed -n 2p $HOME/Accuweather_Conky_USA_Images/curr_cond)
    if [[ $time == day ]]; then
        sed -i 2s/$image/$(test_image_day $image)/ $HOME/Accuweather_Conky_USA_Images/curr_cond
    elif [[ $time == night ]]; then
        sed -i 2s/$image/$(test_image_night $image)/ $HOME/Accuweather_Conky_USA_Images/curr_cond
    fi
    cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 2p $HOME/Accuweather_Conky_USA_Images/curr_cond).png $HOME/Accuweather_Conky_USA_Images/cc.png

fi


if [[ -s $HOME/Accuweather_Conky_USA_Images/tod_ton_raw ]]; then

    #today - tonight - first 4 days
    sed -i '/first cl {/,/<!-- \/.detail-tab-panel -->/!d' $HOME/Accuweather_Conky_USA_Images/tod_ton_raw 
    egrep -i 'h3|"cond"|temp|icon i-|RealFeel|<p>.*<\/p>' $HOME/Accuweather_Conky_USA_Images/tod_ton_raw > $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/\r//g' -e 's/^.*"#">//' -e 's/<\/a>.*$//' $HOME/Accuweather_Conky_USA_Images/tod_ton
    now=$(sed -n 1p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    if [[ $now == Tonight || $now == Overnight ]]; then
        sed -i '1s/night/night\n/' $HOME/Accuweather_Conky_USA_Images/tod_ton
    fi
    sed -i -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e '1,21s/^.*"temp">//g' -e 's/^.*"">//g' -e 's/Lo<\/span> /\n/' -e '/Precipitation/d' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/^.*"temp">//g' -e 's/^.*RealFeel&#174; //g' -e 's/&#176;.*$//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/<span>&deg;//g' -e 's/^.*<p>//g' -e 's/<\/span>.*$//g' -e 's/ ">.*$//g' -e 's/">.*$//g' -e 's/<\/p>.*$//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/Tomorrow$/TOMORROW/' -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/' $HOME/Accuweather_Conky_USA_Images/tod_ton
    if [[ $now == "Early AM" ]]; then
        sed -i '3s/$/\n-/' $HOME/Accuweather_Conky_USA_Images/tod_ton
    fi
    sed -i -e 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    line29=$(sed -n 29p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    sed -i -e '29d' -e "26s/$/\n$line29/" /$HOME/Accuweather_Conky_USA_Images/tod_ton
    line33=$(sed -n 33p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    sed -i -e '33d' -e "30s/$/\n$line33/" /$HOME/Accuweather_Conky_USA_Images/tod_ton
    for (( i=7; i<=22; i+=5 ))
      do
          image_raw=$(sed -n "${i}"p $HOME/Accuweather_Conky_USA_Images/tod_ton)
          sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
          cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/$i.png
      done
    image_raw=$(sed -n 26p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    sed -i 26s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
    cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 26p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/today.png
    image_raw=$(sed -n 30p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    sed -i 30s/$image_raw/$(test_image_night $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
    cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 30p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/tonight.png

fi


if [[ -s $HOME/Accuweather_Conky_USA_Images/last_days_raw ]]; then

    #last days
    sed -i '/current.*cl {/,/<!-- \/.detail-tab-panel -->/!d' $HOME/Accuweather_Conky_USA_Images/last_days_raw 
    egrep -i 'h3|"cond"|temp|icon i-|RealFeel|<p>' $HOME/Accuweather_Conky_USA_Images/last_days_raw > $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/\r//g' -e 's/^.*"#">//' -e 's/<\/a>.*$//' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e '1,21s/^.*"temp">//g' -e 's/^.*"">//g' -e 's/Lo<\/span> /\n/' -e '/Precipitation/d' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/^.*"temp">//g' -e 's/^.*RealFeel&#174; //g' -e 's/&#176;.*$//g' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/<span>&deg;//g' -e 's/^.*<p>//g' -e 's/<\/span>.*$//g' -e 's/ ">.*$//g' -e 's/">.*$//g' -e 's/<\/p>.*$//g' $HOME/Accuweather_Conky_USA_Images/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/' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/last_days
    for (( i=2; i<=22; i+=5 ))
      do
          image_raw=$(sed -n "${i}"p $HOME/Accuweather_Conky_USA_Images/last_days)
          sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/last_days
          cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/last_days).png $HOME/Accuweather_Conky_USA_Images/N$i.png
      done
      
fi


if [[ -s $HOME/Accuweather_Conky_USA_Images/tod_ton_raw && -s $HOME/Accuweather_Conky_USA_Images/last_days_raw ]]; then

    #messages - messages_curr
    sed -n 27p $HOME/Accuweather_Conky_USA_Images/tod_ton > $HOME/Accuweather_Conky_USA_Images/messages_curr
    sed -n 31p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_curr
    sed -n 8p $HOME/Accuweather_Conky_USA_Images/tod_ton > $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 13p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 18p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 23p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 3p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 8p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 13p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 18p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 23p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    for (( i=1; i<=4; i++))
        do
            no=$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/messages_curr|wc -c)
            if (( no<=31 )); then
                sed -i $i"s/$/\n/" $HOME/Accuweather_Conky_USA_Images/messages_curr
                i=$((i+1))
            elif (( no>31 )); then
                sed -i $i"s/^\(.\{31\}\)/\1\n/" $HOME/Accuweather_Conky_USA_Images/messages_curr
                i=$((i+1))
            fi
        done
    cat $HOME/Accuweather_Conky_USA_Images/messages_raw| cut -c -40 > $HOME/Accuweather_Conky_USA_Images/messages
    for (( i=1; i<=18; i++))
        do
            no=$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/messages|wc -c)
            if (( no<=21 )); then
                sed -i $i"s/$/\n/" $HOME/Accuweather_Conky_USA_Images/messages
                i=$((i+1))
            elif (( no>21 )); then
                sed -i $i"s/^\(.\{21\}\)/\1\n/" $HOME/Accuweather_Conky_USA_Images/messages
                i=$((i+1))
            fi
        done
        
fi


kill -CONT $(pidof conky)

Just make sure you keep an eye on it when the Early AM weather is shown.


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

#456 2012-09-30 19:08:21

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 824
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

TeoBigusGeekus wrote:

If you wanna test it before I upload it tomorrow (just to be sure), here goes:

#!/bin/bash

#function: test_image_day
test_image_day () {
    case $1 in
         su)
           echo 1su
         ;;
         msu)
           echo 2msu
         ;;
         psu)
           echo 3psu
         ;;
         ic)
           echo 4ic
         ;;
         h)
           echo 5h
         ;;
         mc)
           echo 6mc
         ;;
         c)
           echo 7c
         ;;
         d)
           echo 8d
         ;;
         f)
           echo 9f
         ;;
         s)
           echo 10s
         ;;
         mcs)
           echo 11mcs
         ;;
         psus)
           echo 12psus
         ;;
         t)
           echo 13t
         ;;
         mct)
           echo 14mct
         ;;
         psut)
           echo 15psut
         ;;
         r)
           echo 16r
         ;;
         fl)
           echo 17fl
         ;;
         mcfl)
           echo 18mcfl
         ;;
         psfl)
           echo 19psfl
         ;;
         sn)
           echo 20sn
         ;;
         mcsn)
           echo 21mcsn
         ;;
         i)
           echo 22i
         ;;
         sl)
           echo 23sl
         ;;
         fr)
           echo 24fr
         ;;
         rsn)
           echo 25rsn
         ;;
         w)
           echo 26w
         ;;
         ho)
           echo 27ho
         ;;
         co)
           echo 28co
         ;;
         cl)
           echo 29cl 
         ;;
         mcl)
           echo 31mcl
         ;;
         pc)
           echo 32pc 
         ;;
         pcs)
           echo 36pcs
         ;;
         pct)
           echo 38pct 
         ;;
        esac
} 

#function: test_image_night
test_image_night () {
    case $1 in
         su)
           echo 1su
         ;;
         msu)
           echo 2msu
         ;;
         psu)
           echo 3psu
         ;;
         c)
           echo 7c
         ;;
         d)
           echo 8d
         ;;
         f)
           echo 9f
         ;;
         s)
           echo 10s
         ;;
         psus)
           echo 12psus
         ;;
         t)
           echo 13t
         ;;
         psut)
           echo 15psut
         ;;
         r)
           echo 16r
         ;;
         fl)
           echo 17fl
         ;;
         psfl)
           echo 19psfl
         ;;
         sn)
           echo 20sn
         ;;
         i)
           echo 22i
         ;;
         sl)
           echo 23sl
         ;;
         fr)
           echo 24fr
         ;;
         rsn)
           echo 25rsn
         ;;
         ho)
           echo 27ho
         ;;
         co)
           echo 28co
         ;;
         cl)
           echo 29cl 
         ;;
         w)
           echo 30w
         ;;
         mcl)
           echo 31mcl
         ;;
         pc)
           echo 32pc 
         ;;
         ic)
           echo 33ic
         ;;
         h)
           echo 34h
         ;;
         mc)
           echo 35mc 
         ;;
         pcs)
           echo 36pcs
         ;;
         mcs)
           echo 37mcs 
         ;;
         pct)
           echo 38pct 
         ;;
         mct)
           echo 39mct 
         ;;
         mcfl)
           echo 40mcfl 
         ;;
         mcsn)
           echo 41mcsn 
         ;;
        esac
}

#put your Accuweather address here
address="http://www.accuweather.com/en/us/los-angeles-ca/90012/weather-forecast/347625"
#address="http://www.accuweather.com/en/us/new-york-ny/10007/weather-forecast/349727"


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

kill -STOP $(pidof conky)
killall wget

curr_addr="$(echo $address|sed 's/weather-forecast.*$//')"current-weather/"$loc_id"us?day=1
wget -O $HOME/Accuweather_Conky_USA_Images/curr_cond_raw "$curr_addr"

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

early_am=$(grep "Early AM" $HOME/Accuweather_Conky_USA_Images/tod_ton_raw | wc -l)
if (( $early_am==0 )); then
    addr2="$addr1"?day=6
else
    addr2="$addr1"?day=5    
fi
wget -O $HOME/Accuweather_Conky_USA_Images/last_days_raw "$addr2"


if [[ -s $HOME/Accuweather_Conky_USA_Images/curr_cond_raw ]]; then

    #current conditions
    sed -i '/detail-now/,/Moonrise/!d' $HOME/Accuweather_Conky_USA_Images/curr_cond_raw
    egrep -i '"cond"|Humidity|Pressure|Cloud Cover|UV Index|Dew Point|Precipitation|Visibility|AM|PM|mph|icons-wind|detail-tab-panel|icon i-' $HOME/Accuweather_Conky_USA_Images/curr_cond_raw > $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/\r//g' -e 's/^.*icon i-//g' -e 's/^.*tab-panel //g' -e 's/^.*start">//g' -e 's/^.*finish">//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i 's/^.*<li>//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/<strong>//g' -e 's/<\/strong>//g' -e 's/<\/li>//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/^.*center;">//g' -e 's/^.*icons-wind\///g' -e 's/\.gif.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/^.*"cond">//g' -e 's/temp">/\n/g' -e 's/realfeel">/\n/g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/">.*$//g' -e 's/<\/span>.*$//g' -e 's/<span>.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/&#176;//g' -e 's/&nbsp;//g' -e 's/RealFeel&#174; //g' -e 's/<\/div>.*//g' -e '8,9d' -e "s/^.*var s = '//g" -e "s/';//g" $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/Humidity: //g' -e 's/Pressure: //g' -e 's/Cloud Cover: //g' -e 's/UV Index: //g' -e '/-->/d' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i -e 's/Dew Point: //g' -e 's/Precipitation(1 hr): //g' -e 's/Visibility: //g' -e '7d' $HOME/Accuweather_Conky_USA_Images/curr_cond
    sed -i 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/curr_cond
    time=$(sed -n 1p $HOME/Accuweather_Conky_USA_Images/curr_cond)
    image=$(sed -n 2p $HOME/Accuweather_Conky_USA_Images/curr_cond)
    if [[ $time == day ]]; then
        sed -i 2s/$image/$(test_image_day $image)/ $HOME/Accuweather_Conky_USA_Images/curr_cond
    elif [[ $time == night ]]; then
        sed -i 2s/$image/$(test_image_night $image)/ $HOME/Accuweather_Conky_USA_Images/curr_cond
    fi
    cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 2p $HOME/Accuweather_Conky_USA_Images/curr_cond).png $HOME/Accuweather_Conky_USA_Images/cc.png

fi


if [[ -s $HOME/Accuweather_Conky_USA_Images/tod_ton_raw ]]; then

    #today - tonight - first 4 days
    sed -i '/first cl {/,/<!-- \/.detail-tab-panel -->/!d' $HOME/Accuweather_Conky_USA_Images/tod_ton_raw 
    egrep -i 'h3|"cond"|temp|icon i-|RealFeel|<p>.*<\/p>' $HOME/Accuweather_Conky_USA_Images/tod_ton_raw > $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/\r//g' -e 's/^.*"#">//' -e 's/<\/a>.*$//' $HOME/Accuweather_Conky_USA_Images/tod_ton
    now=$(sed -n 1p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    if [[ $now == Tonight || $now == Overnight ]]; then
        sed -i '1s/night/night\n/' $HOME/Accuweather_Conky_USA_Images/tod_ton
    fi
    sed -i -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e '1,21s/^.*"temp">//g' -e 's/^.*"">//g' -e 's/Lo<\/span> /\n/' -e '/Precipitation/d' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/^.*"temp">//g' -e 's/^.*RealFeel&#174; //g' -e 's/&#176;.*$//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/<span>&deg;//g' -e 's/^.*<p>//g' -e 's/<\/span>.*$//g' -e 's/ ">.*$//g' -e 's/">.*$//g' -e 's/<\/p>.*$//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    sed -i -e 's/Tomorrow$/TOMORROW/' -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/' $HOME/Accuweather_Conky_USA_Images/tod_ton
    if [[ $now == "Early AM" ]]; then
        sed -i '3s/$/\n-/' $HOME/Accuweather_Conky_USA_Images/tod_ton
    fi
    sed -i -e 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/tod_ton
    line29=$(sed -n 29p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    sed -i -e '29d' -e "26s/$/\n$line29/" /$HOME/Accuweather_Conky_USA_Images/tod_ton
    line33=$(sed -n 33p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    sed -i -e '33d' -e "30s/$/\n$line33/" /$HOME/Accuweather_Conky_USA_Images/tod_ton
    for (( i=7; i<=22; i+=5 ))
      do
          image_raw=$(sed -n "${i}"p $HOME/Accuweather_Conky_USA_Images/tod_ton)
          sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
          cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/$i.png
      done
    image_raw=$(sed -n 26p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    sed -i 26s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
    cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 26p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/today.png
    image_raw=$(sed -n 30p $HOME/Accuweather_Conky_USA_Images/tod_ton)
    sed -i 30s/$image_raw/$(test_image_night $image_raw)/ $HOME/Accuweather_Conky_USA_Images/tod_ton
    cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n 30p $HOME/Accuweather_Conky_USA_Images/tod_ton).png $HOME/Accuweather_Conky_USA_Images/tonight.png

fi


if [[ -s $HOME/Accuweather_Conky_USA_Images/last_days_raw ]]; then

    #last days
    sed -i '/current.*cl {/,/<!-- \/.detail-tab-panel -->/!d' $HOME/Accuweather_Conky_USA_Images/last_days_raw 
    egrep -i 'h3|"cond"|temp|icon i-|RealFeel|<p>' $HOME/Accuweather_Conky_USA_Images/last_days_raw > $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/\r//g' -e 's/^.*"#">//' -e 's/<\/a>.*$//' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/^.*icon i-//g' -e 's/^.*"cond">//g' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e '1,21s/^.*"temp">//g' -e 's/^.*"">//g' -e 's/Lo<\/span> /\n/' -e '/Precipitation/d' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/^.*"temp">//g' -e 's/^.*RealFeel&#174; //g' -e 's/&#176;.*$//g' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i -e 's/<span>&deg;//g' -e 's/^.*<p>//g' -e 's/<\/span>.*$//g' -e 's/ ">.*$//g' -e 's/">.*$//g' -e 's/<\/p>.*$//g' $HOME/Accuweather_Conky_USA_Images/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/' $HOME/Accuweather_Conky_USA_Images/last_days
    sed -i 's/ i-alarm.*$//g' $HOME/Accuweather_Conky_USA_Images/last_days
    for (( i=2; i<=22; i+=5 ))
      do
          image_raw=$(sed -n "${i}"p $HOME/Accuweather_Conky_USA_Images/last_days)
          sed -i ${i}s/$image_raw/$(test_image_day $image_raw)/ $HOME/Accuweather_Conky_USA_Images/last_days
          cp $HOME/Accuweather_Conky_USA_Images/Forecast_Images/$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/last_days).png $HOME/Accuweather_Conky_USA_Images/N$i.png
      done
      
fi


if [[ -s $HOME/Accuweather_Conky_USA_Images/tod_ton_raw && -s $HOME/Accuweather_Conky_USA_Images/last_days_raw ]]; then

    #messages - messages_curr
    sed -n 27p $HOME/Accuweather_Conky_USA_Images/tod_ton > $HOME/Accuweather_Conky_USA_Images/messages_curr
    sed -n 31p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_curr
    sed -n 8p $HOME/Accuweather_Conky_USA_Images/tod_ton > $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 13p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 18p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 23p $HOME/Accuweather_Conky_USA_Images/tod_ton >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 3p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 8p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 13p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 18p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    sed -n 23p $HOME/Accuweather_Conky_USA_Images/last_days >> $HOME/Accuweather_Conky_USA_Images/messages_raw
    for (( i=1; i<=4; i++))
        do
            no=$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/messages_curr|wc -c)
            if (( no<=31 )); then
                sed -i $i"s/$/\n/" $HOME/Accuweather_Conky_USA_Images/messages_curr
                i=$((i+1))
            elif (( no>31 )); then
                sed -i $i"s/^\(.\{31\}\)/\1\n/" $HOME/Accuweather_Conky_USA_Images/messages_curr
                i=$((i+1))
            fi
        done
    cat $HOME/Accuweather_Conky_USA_Images/messages_raw| cut -c -40 > $HOME/Accuweather_Conky_USA_Images/messages
    for (( i=1; i<=18; i++))
        do
            no=$(sed -n ${i}p $HOME/Accuweather_Conky_USA_Images/messages|wc -c)
            if (( no<=21 )); then
                sed -i $i"s/$/\n/" $HOME/Accuweather_Conky_USA_Images/messages
                i=$((i+1))
            elif (( no>21 )); then
                sed -i $i"s/^\(.\{21\}\)/\1\n/" $HOME/Accuweather_Conky_USA_Images/messages
                i=$((i+1))
            fi
        done
        
fi


kill -CONT $(pidof conky)

Just make sure you keep an eye on it when the Early AM weather is shown.


Right will do! Ill let you know what it does.

Offline

#457 2012-10-01 08:10:05

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 824
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

Im still having issues with the script updating (1am)

luke@crunchbang-desktop:~$ ~/Conky/conky_start.sh
WARNING: gnome-keyring:: couldn't connect to: /home/luke/.cache/keyring-F8P01e/pkcs11: No such file or directory
Conky: desktop window (1800003) is subwindow of root window (28f)
Conky: window type - normal
Conky: drawing to created window (0x2e00002)
Conky: drawing to double buffer
WARNING: gnome-keyring:: couldn't connect to: /home/luke/.cache/keyring-F8P01e/pkcs11: No such file or directory
Conky: desktop window (1800003) is subwindow of root window (28f)
Conky: window type - normal
Conky: drawing to created window (0x3200002)
Conky: drawing to double buffer
luke@crunchbang-desktop:~$ WARNING: gnome-keyring:: couldn't connect to: /home/luke/.cache/keyring-F8P01e/pkcs11: No such file or directory
Conky: desktop window (1800003) is subwindow of root window (28f)
Conky: window type - normal
Conky: drawing to created window (0x3600002)
Conky: drawing to double buffer
wget: no process found
--2012-10-01 01:04:31--  http://www.accuweather.com/en/us/monrovia-ca/91016/current-weather/91016us?day=1
Resolving www.accuweather.com (www.accuweather.com)... 23.61.194.219, 23.61.194.171
Connecting to www.accuweather.com (www.accuweather.com)|23.61.194.219|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw'

    [  <=>                                  ] 93,958       287K/s   in 0.3s    

2012-10-01 01:04:37 (287 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw' saved [93958]

--2012-10-01 01:04:37--  http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/38115_pc
Resolving www.accuweather.com (www.accuweather.com)... 63.80.4.26, 63.80.4.8
Connecting to www.accuweather.com (www.accuweather.com)|63.80.4.26|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw'

    [  <=>                                  ] 98,517       327K/s   in 0.3s    

2012-10-01 01:04:42 (327 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw' saved [98517]

--2012-10-01 01:04:42--  http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/38115_pc?day=5
Resolving www.accuweather.com (www.accuweather.com)... 63.80.4.26, 63.80.4.8
Connecting to www.accuweather.com (www.accuweather.com)|63.80.4.26|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/last_days_raw'

    [  <=>                                  ] 98,024       329K/s   in 0.3s    

2012-10-01 01:04:48 (329 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/last_days_raw' saved [98024]

wget: no process found
--2012-10-01 01:04:49--  http://www.accuweather.com/en/us/monrovia-ca/91016/current-weather/91016us?day=1
Resolving www.accuweather.com (www.accuweather.com)... 23.61.194.171, 23.61.194.219
Connecting to www.accuweather.com (www.accuweather.com)|23.61.194.171|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw'

    [  <=>                                  ] 93,957       325K/s   in 0.3s    

2012-10-01 01:04:55 (325 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/curr_cond_raw' saved [93957]

--2012-10-01 01:04:55--  http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/38115_pc
Resolving www.accuweather.com (www.accuweather.com)... 63.80.4.26, 63.80.4.8
Connecting to www.accuweather.com (www.accuweather.com)|63.80.4.26|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw'

    [  <=>                                  ] 98,512       334K/s   in 0.3s    

2012-10-01 01:05:01 (334 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/tod_ton_raw' saved [98512]

--2012-10-01 01:05:01--  http://www.accuweather.com/en/us/monrovia-ca/91016/daily-weather-forecast/38115_pc?day=5
Resolving www.accuweather.com (www.accuweather.com)... 23.61.194.219, 23.61.194.171
Connecting to www.accuweather.com (www.accuweather.com)|23.61.194.219|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `/home/luke/Accuweather_Conky_USA_Images/last_days_raw'

    [  <=>                                  ] 98,090       325K/s   in 0.3s    

2012-10-01 01:05:06 (325 KB/s) - `/home/luke/Accuweather_Conky_USA_Images/last_days_raw' saved [98090]

No errors that I can see in the terminal output so Im going to double check my conky settings but the other conkys that are using the same settings are all updating ok (none using the weather scripts).

tZnBpZQ

Edit:

I went through my wether conky and dont see anything there that would cause it not to update

##############################################
#  Settings
##############################################
max_specials 10000
max_user_text 15000
background no
use_xft yes
xftfont sans:size=9
xftalpha 1
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
own_window_type normal
own_window_title conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 250
maximum_width 250
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_right
gap_x 10
gap_y 10
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale yes
text_buffer_size 100000
top_name_width 5
update_interval 1
default_color FFFFFF
temperature_unit fahrenheit


## Set the path to your script here.
lua_load ~/Conky/allcombined.lua
## lua funcions
## background ##################################################################
#${lua draw_bg {corner_radius,x_position,y_position,width,height,color,alpha}}
#note for background: set width=0 - width will be conky window width, set height=0 - height will be conky window height
## gradient bars ###############################################################
#${lua gradbar {x_position,y_position,"conky_object",object_max_value,number_of_divisions,division_width,division_height,division_gap,bg_color,bg_alpha,start_color,start_alpha,mid_color,mid_alpha,end_color,end_alpha}}
## calendar ###############################################################
#${lua luacal {x_position,y_position,"title_font",title_fontsize,title_color,title_alpha,"dates_font",dates_fontsize,dates_color,dates_alpha,"highlight_font",highlight_fontsize,highlight_color,highlight_alpha,"spacer",colum_gap,title_gap,row_gap,start_day}
#note for calendar: start day... 0=sunday, 1=monday ... "spacer" can help align calendar with non fix width fonts
## textured background ###############################################################
#${lua tex_bg {corner_radius,x_position,y_position,width,height,"/path/to/texture.png"}}
## lua draw images ###############################################################
#${lua luaimage {x_position,y_position,width,height,"/path/to/image"}}
#note for images: set width=0 - width will be image width, set height=0 - height will be image height
## lua draw text ###############################################################
#${lua luatext {x_position,y_position,color,alpha,"font",fontsize,"justify"}}
# not for text: justify can be "r" = right, "c" = center, "l" = left

#${lua draw_bg {10,0,0,0,0,0x000000,0.1}}
TEXT
${lua draw_bg {15,0,0,0,0,0x000000,0.5}}
${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}${image $HOME/Accuweather_Conky_USA_Images/cc.png -p -30,30 -s 180x108}
${goto 125}${font Ubuntu:size=10}TEMP:${alignr 3}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 125}WIND:${alignr 3}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}HUM:${alignr 3}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 125}PRESS:${alignr 3}${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}CLOUDY:${alignr 3}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 125}UV INDEX:${alignr 10}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
#${goto 125}DEW POINT:${alignr 3}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}PERCIP:${alignr 3}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}VISIB.:${alignr 3}${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}SUNRISE:${alignr 3}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 125}SUNSET:${alignr 3}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${voffset 5}
${voffset 10}${goto 27}${font Sans:bold:size=30}${time %I:%M %p}
${lua luacal {100,240,"Sans",10,0xFFFF00,1,"Sans",10,0xFFFFF0,1,"Mono",14,0xFFFF00,1," ",20,18,16,0}}
${goto 15}${font Sans:bold:size=12}${time %d}${font}
${goto 15}${time %B}
${goto 15}${time %Y}

Last edited by lwfitz (2012-10-01 08:13:55)

Offline

#458 2012-10-01 08:17:25

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

Add this

imlib_cache_size 0

in your conky settings.


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

#459 2012-10-01 11:21:16

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

ANNOUNCEMENT:

1b and 1e rebundled. The latest changes in the Accuweather USA page were a bit more serious than initially thought. Hopefully, the layout will stay the same for a while now.


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

#460 2012-10-02 01:07:37

lwfitz
#! Die Hard
From: Monrovia, CA
Registered: 2012-01-19
Posts: 824
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

TeoBigusGeekus wrote:

Add this

imlib_cache_size 0

in your conky settings.


Yep..... your right :-D Thanks buddy I think that did it.

Offline

#461 2012-10-02 08:08:57

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

lwfitz wrote:

Yep..... your right :-D Thanks buddy I think that did it.

Good to know.


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

#462 2012-10-02 13:33:04

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,409
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

TeoBigusGeekus wrote:

ANNOUNCEMENT:

1b and 1e rebundled. The latest changes in the Accuweather USA page were a bit more serious than initially thought. Hopefully, the layout will stay the same for a while now.


Good got it.  Now what I need is time to play with it again.

Life is getting in the way a lot lately.

Online

#463 2012-10-03 00:44:37

snape15
New Member
Registered: 2012-10-03
Posts: 3

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

Hi Teo, first of all, big thanks for the great work (and to others that may of helped).

I have installed your 1d1_Accuweather_INT_Images and it works great. I have found 1 little issue that i can not seem to fix.

WIth any part that shows a temp, it shows as symbol between the temp and the degrees, the symbol looks like a A with a circle on top.

pic

Offline

#464 2012-10-03 01:46:58

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,409
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

snape15 wrote:

With any part that shows a temp, it shows as symbol between the temp and the degrees, the symbol looks like a A with a circle on top.

Above TEXT, do you have

override_utf8_locale yes

That's a start.

Online

#465 2012-10-03 03:33:27

snape15
New Member
Registered: 2012-10-03
Posts: 3

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

i don't have anything like that in the file. will try adding it.

Offline

#466 2012-10-03 03:45:11

snape15
New Member
Registered: 2012-10-03
Posts: 3

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

i saw on another site that there had been some known bugs with conky showing symbols. i inserted ${iconv_start UTF-8 ISO_8859-1}° ${iconv_stop} in place of the degrees symbol in the file and it displays correct now.


edit: i also went back to start from scratch and it worked fine. i may of changed something somewhere by mistake and messed it up the 1st time.

thanks again

Last edited by snape15 (2012-10-03 04:26:15)

Offline

#467 2012-10-27 19:17:31

stolid
#! CrunchBanger
Registered: 2012-09-06
Posts: 186

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

On my conky, it looks like the conkyweather font isn't loading.  I have it in ~/.fonts. Instead conky just shows big normal letters  (default font I guess) in the place of the weather symbols. I'm using the 1b script if that's relevant. This is on a Waldorf install. I've been using the script (with working font) on my laptop (Statler) for a long time now. What is causing the font not to work?

Edit:

~$ ls ~/.fonts | grep Conky
ConkyWeather.ttf

Last edited by stolid (2012-10-27 19:25:29)


Registered Linux User #555399
crunchbox:     Phenom II X6 1055T | 8GB RAM | OCZ Vertex 4 128GB | Radeon 7870XT | Win7 / #! 11 (awesome wm)
dodeca:     2x Opteron 2419 | 8GB RAM | GeForce 8800GT | Linux Mint 14
crunchtop:     Acer Aspire 1410 11.6" | 2GB RAM | Crucial M4 128GB | #! Waldorf

Offline

#468 2012-10-27 21:33:17

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

A reboot could fix it...
Can you also post your .conkyrc?


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

#469 2012-10-27 23:36:43

stolid
#! CrunchBanger
Registered: 2012-09-06
Posts: 186

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

TeoBigusGeekus wrote:

A reboot could fix it...

It did. roll Not something I tend to do much of these days. I could have sworn I successfully installed fonts before without a reboot. Thanks.


Registered Linux User #555399
crunchbox:     Phenom II X6 1055T | 8GB RAM | OCZ Vertex 4 128GB | Radeon 7870XT | Win7 / #! 11 (awesome wm)
dodeca:     2x Opteron 2419 | 8GB RAM | GeForce 8800GT | Linux Mint 14
crunchtop:     Acer Aspire 1410 11.6" | 2GB RAM | Crucial M4 128GB | #! Waldorf

Offline

#470 2012-10-28 09:33:53

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

Sorry for the reboot advice. You could just

fc-cache -f

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

#471 2012-11-07 19:43:37

Mercyshipdude
Member
From: The Internet (404 Google St.)
Registered: 2012-11-06
Posts: 31
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

TeoBigusGeekus wrote:

ABSTRACT
Some scripts for displaying a weather forecast on your conky.
They use Accuweather, Weather Underground, National Weather Service (USA) and Weather.com.
They all rely on the same principle: download a bunch of pages, parse them and isolate the necessary info for conky to find.
There is something for everyone: from the minimalistic (1c), to the humongous, larger than life, "I'm a meteorologist" aspect (4).

Wow, TeoBigusGeekus! This was exactly what I needed. Here's what I did with it:

recent.jpg

I really enjoyed your scripts, and all of the hard work you put into it. Thanks again!


"Computers are useless, they can only give you answers" - Pablo Picasso

Offline

#472 2012-11-07 20:38:26

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 7,409
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

Mercyshipdude wrote:

Wow, TeoBigusGeekus! This was exactly what I needed. Here's what I did with it:

http://s12.postimage.org/zcm51ftjd/recent.jpg

I really enjoyed your scripts, and all of the hard work you put into it. Thanks again!

You just made that amazing conky even better!  It's an  glasses

Can you package it up and send it to me?  I want that for Conky PitStop.

Last edited by Sector11 (2012-11-07 20:39:36)

Online

#473 2012-11-07 20:46:01

Mercyshipdude
Member
From: The Internet (404 Google St.)
Registered: 2012-11-06
Posts: 31
Website

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

Sector11 wrote:

You just made that amazing conky even better!  It's an  glasses

Can you package it up and send it to me?  I want that for Conky PitStop.

Thanks Sector11, sure thing. The weather scripts are a bit convoluted, I had to chop up a bunch of stuff to make it working. but here's everything thats in my home folder.

http://www.mediafire.com/?l5qlxq8m90ip2p4

Let me know if you've got any ideas for improving it! I really enjoyed fiddling with this one.


"Computers are useless, they can only give you answers" - Pablo Picasso

Offline

#474 2012-11-07 22:24:53

TeoBigusGeekus
#! Junkie
From: /Greece/Kastoria
Registered: 2012-04-28
Posts: 448

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

Thanks for your kind words mate!


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!

#475 2012-11-22 19:43:28

ohnonot
#! CrunchBanger
Registered: 2012-05-22
Posts: 162

Re: Conky weather scripts using Accuweather/WUnderground/NWS/Weather.com

after using tbg's weather conkies for years i finally started developing my own from a finnish site.

i'm using the same principle as tbg: download webpage, isolate info mostly with sed and egrep and end up with a file containing 1 info per line which can be accessed easily by conky and sed again. you just have to always know exactly in which line your info is.
and i'd like to ask some advice on that..

this is a bit tricky to explain so take a look at the web page first.
it's the long line of icons+text i'm interested in, under "Sääennuste".
It's all very straight forward, there's always 18 columns in the web page and my display will be pretty much the same, horizontal across the screen, text only for starters.

the only tricky bit are the weekdays (ma ti ke to pe la su) - the 18 columns sometimes stretch over 7 days, sometimes only 5 or 6.
cleaning the file halfway i get this:

Paikallissää Turku</h1>
 </span>
 <td colspan="1" class="first-day odd-day">
to</span>
<td colspan="6" class="even-day">
pe</span>
<td colspan="4" class="odd-day">
la</span>
<td colspan="2" class="even-day">
su</span>
<td colspan="2" class="odd-day">
ma</span>
<td colspan="2" class="even-day">
ti</span>
<td colspan="1" class="last-day odd-day">
ke</span>
23</span> <-- from here onwards it's times! (second line n the web page) 
02</span>
05</span>
08</span>
11</span>
14</span>
20</span>
02</span>
08</span>
......
...

- so you see there's a weekday and before that it says colspan="n" - that is how many empty lines-1 i should have before the next weekday to be able to use the file in a tbg-style conky.
right now i'm just confused, can i even do this with sed? shell script? pearl, awk, or from within conky???

any helpappreciated.

now, heaps of respect to tbg and the posse for creating these conky scripts. thanks!

and, ps: i know this has probably been covered on this or another forum. i have been searching for hours.... no, google is not always your friend...

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