You are not logged in.

#441 2015-12-27 17:35:11

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

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

Waning gibbous today and 2b works fine.

Happy holidays everybody, I'm in a 'hibernate' mode at the moment...


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

#442 2015-12-27 17:44:41

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

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

^ Yup here too, but 10 Jan 2016 will be the big test.  wink


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#443 2015-12-28 17:17:50

Inodoro Pereyra
Member
Registered: 2015-11-04
Posts: 123

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

TeoBigusGeekus wrote:

Hey, nice eye Inodoro.

Does this mean that 'New Moon' should also be 'New'? Have they changed the Moon messages?
It needs some monitoring for a while...

Thank you Teo. Feels nice to be useful, once in a while... {) tongue

I think so. I'm waiting for the moon to change, to be sure. In any case, it's just a small change on line 226 of the script, nothing serious... smile


Imagination is intelligence having fun. (Albert Einstein)
The thing about the Internet is you can create a phrase, and make up its author, and everybody will fall for it. (Aristotle)

Offline

#444 2015-12-28 21:39:13

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

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

Inodoro Pereyra wrote:

Thank you Teo. Feels nice to be useful, once in a while... {) tongue

I think so. I'm waiting for the moon to change, to be sure. In any case, it's just a small change on line 226 of the script, nothing serious... smile

I've replaced the check for 'Full Moon' and 'New Moon' with regular expressions that should work for both 'Full', 'New' and 'Full Moon', 'New Moon'.

#!/bin/bash

#put your hemisphere here: n for north, s for south
hemisphere=n

#put your Weather Underground address API here
address="http://api.wunderground.com/api/a7f118ad23b2d3b9/conditions/forecast10day/astronomy/hourly/satellite/q/Greece/kastoria.json"

wun_icon_to_png () {
    if [[ $1 == day ]]; then
        case $2 in
            chanceflurries)
                echo 21
            ;;
            chancerain)
                echo 14
            ;;
            chancesleet)
                echo 26
            ;;
            chancesnow)
                echo 20
            ;;
            chancetstorms)
                echo 17
            ;;
            clear)
                echo 1
            ;;
            cloudy)
                echo 7
            ;;
            flurries)
                echo 21
            ;;
            fog)
                echo 11
            ;;
            hazy)
                echo 5
            ;;
            mostlycloudy)
                echo 6
            ;;
            mostlysunny)
                echo 4
            ;;
            partlycloudy)
                echo 4
            ;;
            partlysunny)
                echo 6
            ;;
            sleet)
                echo 26
            ;;
            rain)
                echo 18
            ;;
            snow)
                echo 22
            ;;
            sunny)
                echo 1
            ;;
            tstorms)
                echo 15
            ;;
            unknown)
                echo 0
            ;;
        esac
    elif [[ $1 == night ]]; then
        case $2 in
            chanceflurries)
                echo 43
            ;;
            chancerain)
                echo 39
            ;;
            chancesleet)
                echo 40
            ;;
            chancesnow)
                echo 43
            ;;
            chancetstorms)
                echo 41
            ;;
            clear)
                echo 33
            ;;
            cloudy)
                echo 38
            ;;
            flurries)
                echo 43
            ;;
            fog)
                echo 11
            ;;
            hazy)
                echo 37
            ;;
            mostlycloudy)
                echo 36
            ;;
            mostlysunny)
                echo 35
            ;;
            partlycloudy)
                echo 35
            ;;
            partlysunny)
                echo 36
            ;;
            sleet)
                echo 40
            ;;
            rain)
                echo 40
            ;;
            snow)
                echo 44
            ;;
            sunny)
                echo 33
            ;;
            tstorms)
                echo 41
            ;;
            unknown)
                echo 0
            ;;
        esac
    fi
    }

rm $HOME/2b_Wunderground_API/*.png

killall -STOP conky
killall wget

wget -O $HOME/2b_Wunderground_API/raw_data $address

#Conditions feature
sed -n '/,	"current_observation": {/,/,	"satellite": {/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Conditions
sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Conditions
sed -i '/current_observation\|image":\|logo_\|title":\|link":\|^[ \t]*},$\|^[ \t]*}$\|temperature_string\|forecast_url\|history_url\|ob_url\|satellite":/d' $HOME/2b_Wunderground_API/Conditions
sed -i -e 's/":"/\n/g' -e 's/",\|": {$//g' -e 's/"precip_1hr_string/\nprecip_1hr_string/g' -e 's/":/\n/g' -e 's/,$//g' $HOME/2b_Wunderground_API/Conditions
sed -i -e 's/^http.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/2b_Wunderground_API/Conditions
day_or_night=$(sed -n 137p $HOME/2b_Wunderground_API/Conditions)
if [[ $day_or_night == nt ]]; then
	cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n 135p $HOME/2b_Wunderground_API/Conditions)).png $HOME/2b_Wunderground_API/Now.png
else 
	cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n 135p $HOME/2b_Wunderground_API/Conditions)).png $HOME/2b_Wunderground_API/Now.png
fi

#Satellite feature, commented out by default, uncomment if you wish so
#sed -n '/,	"satellite": {/,/"forecast":{/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Satellite
#sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Satellite
#sed -i -e '/image/!d' -e 's/^.*": "//g' -e 's/".*$//g' $HOME/2b_Wunderground_API/Satellite
#for (( i=1; i<=3; i++ ))
#	  do
#          wget -O $HOME/2b_Wunderground_API/sat_pic$i.png $(sed -n ${i}p $HOME/2b_Wunderground_API/Satellite)
#	  done

#Forecast feature: Forecast
sed -n '/"forecast":{/,/"simpleforecast": {/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Forecast
sed -i -e '/"period":\|icon_url/d' $HOME/2b_Wunderground_API/Forecast
sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Forecast
sed -i -e '/period\|icon\|title\|fcttext/!d' -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",//g' -e 's/,$//g' -e 's/nt_//g' $HOME/2b_Wunderground_API/Forecast

#Forecast feature: Simple Forecast
sed -n '/"simpleforecast": {/,/"hourly_forecast": \[/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Simple_Forecast
sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Simple_Forecast
sed -i '/hourly_forecast\|simpleforecast\|forecastday\|{"date"\|period\|icon_url\|^[ \t]*},$\|^[ \t]*}$\|^[ \t]*,$\|^[ \t]*\]$/d' $HOME/2b_Wunderground_API/Simple_Forecast
sed -i -e 's/":"/\n/g' -e 's/":/\n/g' -e 's/",$//g' -e 's/,$//g' -e 's/"$//g' $HOME/2b_Wunderground_API/Simple_Forecast
sed -i '/^[ \t]*{/d' $HOME/2b_Wunderground_API/Simple_Forecast
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/2b_Wunderground_API/Simple_Forecast
for (( i=2; i<=146; i+=16 ))
    do
        cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/2b_Wunderground_API/Forecast)).png $HOME/2b_Wunderground_API/d$(( 1+(i-2)/16 )).png
        j=$(( i+8 ))
        cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n ${j}p $HOME/2b_Wunderground_API/Forecast)).png $HOME/2b_Wunderground_API/n$(( 1+(i-2)/16 )).png
    done

#Forecast feature: Hourly
sed -n '/"hourly_forecast": \[/,/"moon_phase": {/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/^[ \t]*"//g' -e 's/^[ \t]*//g' $HOME/2b_Wunderground_API/Hourly
sed -i '/hourly_forecast\|FCTTIME\|^{$\|^},$\|^}$\|^,$\|^]$\|moon_phase/d' $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/": /\n/g' -e 's/","/\n/g' -e 's/", "/\n/g' $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/^""//g' -e 's/^"//g' -e 's/^{"//g' -e 's/"},$//g' -e 's/",$//g' $HOME/2b_Wunderground_API/Hourly 
sed -i -e 's/^},//g' -e 's/"}$//g' -e 's/^,//g' $HOME/2b_Wunderground_API/Hourly
sed -i -e 's/^icon_url.*\/c\/k\///g' -e '/gif/s/_.*$//g' $HOME/2b_Wunderground_API/Hourly
sed -i -e '/min_unpadded\|UTCDATE/,+1d' $HOME/2b_Wunderground_API/Hourly
for (( i=64; i<=4212; i+=117 ))
    do
		j=$(( i+1 ))
		day_or_night=$(sed -n ${j}p $HOME/2b_Wunderground_API/Hourly)
		if [[ $day_or_night == nt ]]; then
			cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png night $(sed -n ${i}p $HOME/2b_Wunderground_API/Hourly)).png $HOME/2b_Wunderground_API/h$(( 1+(i-64)/117 )).png
		else 
			cp $HOME/2b_Wunderground_API/Forecast_Images/$(wun_icon_to_png day $(sed -n ${i}p $HOME/2b_Wunderground_API/Hourly)).png $HOME/2b_Wunderground_API/h$(( 1+(i-64)/117 )).png
		fi
    done
    
#Forecast feature: Moon_Sun
sed -n '/"moon_phase": {/,/"sun_phase": {/p' $HOME/2b_Wunderground_API/raw_data > $HOME/2b_Wunderground_API/Moon_Sun
sed -i 's/^[ \t]*"//g' $HOME/2b_Wunderground_API/Moon_Sun
sed -i '/moon_phase\|^[ \t]*},$\|sun_phase\|^[ \t]*}$/d' $HOME/2b_Wunderground_API/Moon_Sun
sed -i -e 's/":"/\n/g' -e 's/".*$//g' $HOME/2b_Wunderground_API/Moon_Sun
moon_phase=$(sed -n 6p $HOME/2b_Wunderground_API/Moon_Sun)
if [[ $moon_phase == "Waning Crescent" ]]; then
	cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"21.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waxing Crescent" ]]; then
	cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"04.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waning Gibbous" ]]; then
	cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"17.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Waxing Gibbous" ]]; then
	cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"09.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "First Quarter" ]]; then
	cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"07.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase == "Last Quarter" ]]; then
	cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"19.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase =~ New.* ]]; then
	cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"24.png" $HOME/2b_Wunderground_API/Moon_phase.png
elif [[ $moon_phase =~ Full.* ]]; then
	cp $HOME/2b_Wunderground_API/moonicons/$hemisphere"13.png" $HOME/2b_Wunderground_API/Moon_phase.png
fi

killall -CONT conky

Notice the last 2 elifs.

What's left, is to test it to see if the other phases hide any more surprises...


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

#445 2015-12-28 21:43:51

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

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

@fvirgola80

Stand by.


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

#446 2015-12-28 21:50:35

Inodoro Pereyra
Member
Registered: 2015-11-04
Posts: 123

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

TeoBigusGeekus wrote:

Notice the last 2 elifs.

What's left, is to test it to see if the other phases hide any more surprises...

Nice. I'll change mine. cool

I don't think the other phases will give any trouble. The problem with the full moon is that, while the script was looking for "Full Moon" in the Moon_Sun file, the file only showed "Full". That's why I suspect we'd have the same problem with the new moon. But on the other phases there's no discrepancy between what's on the text file, and what the script will look for.


Imagination is intelligence having fun. (Albert Einstein)
The thing about the Internet is you can create a phrase, and make up its author, and everybody will fall for it. (Aristotle)

Offline

#447 2015-12-28 21:59:42

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

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

Inodoro Pereyra wrote:
TeoBigusGeekus wrote:

Notice the last 2 elifs.

What's left, is to test it to see if the other phases hide any more surprises...

Nice. I'll change mine. cool

I don't think the other phases will give any trouble. The problem with the full moon is that, while the script was looking for "Full Moon" in the Moon_Sun file, the file only showed "Full". That's why I suspect we'd have the same problem with the new moon. But on the other phases there's no discrepancy between what's on the text file, and what the script will look for.

That's what I think too, but to be 100% sure I won't rebundle the script till all the phases have been tested.
Thanks again for the feedback Inodoro!

Last edited by TeoBigusGeekus (2015-12-28 21:59:57)


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

#448 2015-12-28 22:03:53

Inodoro Pereyra
Member
Registered: 2015-11-04
Posts: 123

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

TeoBigusGeekus wrote:

Thanks again for the feedback Inodoro!

Glad I could help. big_smile


Imagination is intelligence having fun. (Albert Einstein)
The thing about the Internet is you can create a phrase, and make up its author, and everybody will fall for it. (Aristotle)

Offline

#449 2015-12-29 00:34:30

Inodoro Pereyra
Member
Registered: 2015-11-04
Posts: 123

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

Ok, new question: I have the wunderground API. Now, as it is, the API sends me the data from a station that's giving some extreme numbers, which are not realistic where I live.

Can I change the weather station in my API, or do I have to sign up for a new key?

Thanks in advance. smile


Imagination is intelligence having fun. (Albert Einstein)
The thing about the Internet is you can create a phrase, and make up its author, and everybody will fall for it. (Aristotle)

Offline

#450 2015-12-29 01:10:46

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

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

You can change the station to anything that Wunderground has ... no new key needed.

samples:

#address="http://api.wunderground.com/api/APICODE/conditions/forecast10day/astronomy/hourly/satellite/q/pws:ICIUDADA11.json"
address="http://api.wunderground.com/api/APICODE/conditions/forecast10day/astronomy/hourly/satellite/q/pws:ICIUDADA6.json"

#http://www.wunderground.com/cgi-bin/findweather/getForecast?query=-34.603298,-58.381599&sp=ICIUDADA6
#http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Buenos+Aires%2C+Argentina

Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#451 2015-12-29 16:57:22

Inodoro Pereyra
Member
Registered: 2015-11-04
Posts: 123

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

Thank you S11, worked perfectly!  big_smile


Imagination is intelligence having fun. (Albert Einstein)
The thing about the Internet is you can create a phrase, and make up its author, and everybody will fall for it. (Aristotle)

Offline

#452 2015-12-30 10:42:39

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

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

TeoBigusGeekus wrote:

@fvirgola80

Stand by.

Good morning to all that interesting news for the phases of the moon monthly about the script we are TEO? Sector11 how are you?

By Luke


Nothing happens by chance

Offline

#453 2015-12-30 11:57:24

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

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

Good stuff IP.  Glad to help.

Good morning fvirgola80 ... off to a normal start but HOT!.  Had a bunch of micro-cuts from my ISP yesterday. Really annoying until it was fixed by losing power entirely.  mad

08:30 and already the heat index is at 31° - pressure at 1009 and humidity at 73% - going to be another hell-on-earth day.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#454 2015-12-30 15:19:02

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

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

Patience Luke, patience.


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

#455 2015-12-30 16:15:34

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

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

^ Please, Teo, send me some 'cold',  I want to hibernate too.  cool


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#456 2015-12-30 17:16:42

Inodoro Pereyra
Member
Registered: 2015-11-04
Posts: 123

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

Sector11 wrote:

08:30 and already the heat index is at 31° - pressure at 1009 and humidity at 73% - going to be another hell-on-earth day.

Heat? In Buenos Aires?
Whatcha talkin' 'bout, Willis? lol lol lol


Imagination is intelligence having fun. (Albert Einstein)
The thing about the Internet is you can create a phrase, and make up its author, and everybody will fall for it. (Aristotle)

Offline

#457 2015-12-30 18:46:32

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

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

AHHHHHHHHHHHHHHHHH SHUDDUP!
Not all of us live to bathe in lava.   ]:D  ]:D


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#458 2015-12-30 22:53:11

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

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

fvirgola80 wrote:
TeoBigusGeekus wrote:

@fvirgola80

Stand by.

Good morning to all that interesting news for the phases of the moon monthly about the script we are TEO? Sector11 how are you?

By Luke

Sorry fvirgola80, but I looked briefly on the webpage's source code and I have bad news: Java Script.
I'm not touching this...

If you have a different site with monthly moon info please post it.


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 2015-12-30 23:29:56

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

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

I have a couple ... looks like tables with images.  Found a few that were obvious java as well.

http://www.calendar-365.com/moon/moon-calendar.html

http://www.webexhibits.org/calendars/moon-month.html


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#460 2015-12-31 10:20:05

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

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

Hello guys , I saw the post ... what a disappointment ..... TEO and the sites that you have dimensioned Sector11 not good right? .... See this
http://www.moonconnection.com/moon_phas … ndar.phtml
https://stardate.org/nightsky/moon
http://www.moon-phases.net/


Nothing happens by chance

Offline

Board footer

Powered by FluxBB