You are not logged in.

#426 2015-12-24 06:33:42

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

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

Great works Secotr11.........

These days I thought of a script ..... let me explain better ..... you think I am referring to TEO would be possible to extract information from site
http://www.moongiant.com/calendar/current/month/
Monthly ? ......
@TEO What do you think ? the script should take infomarzioni moon phase for the entire month and give her a conky ...

big_smile  big_smile

Last edited by fvirgola80 (2015-12-24 06:35:42)


Nothing happens by chance

Offline

#427 2015-12-26 13:40:07

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

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

Ok... gots problem... neutral

I don't know why, but today, since I started the computer, my moon phase image is not showing.
So I looked around, and found $HOME/2b_Wunderground_API/Moon_phase.png is nowhere to be found.

Anybody has any idea why this may have happened?


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

#428 2015-12-26 13:53:57

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

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

Well, it's working here ... can you show your conky that called it please.
2015_12_26_10_52_01_Scrot11.jpg


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

Offline

#429 2015-12-26 13:59:21

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

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

fvirgola80 wrote:

@TEO What do you think ? the script should take infomarzioni moon phase for the entire month and give her a conky ...

big_smile  big_smile

OOPS!  Missed this ...  As for the "Monthly" moon script, I'm not 100% convinced that enough people would be interested, I could be wrong though.  I suppose if Teo thought it was worth while it could be done, I don't have the scripting skills necessary and it would be another thing Teo would have to maintain.


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

Offline

#430 2015-12-26 14:11:43

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

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

Sector11 wrote:

Well, it's working here ... can you show your conky that called it please.

Of course...

## killall conky && conky -c ~/.conky/baires_wunmoon.conky &
			##  Begin Window Settings  ##
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_colour black
own_window_class Conky
own_window_title baires_w

own_window_argb_visual yes
own_window_argb_value 255

double_buffer yes

minimum_size 420 155 ## width, height
maximum_width 420  ## width

gap_x 700 # left-right  
gap_y 35 # up-down  

alignment top_left

			##  End Window Settings  ##
			##  Font Settings  ##
# Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Monofur:bold:size=12

# Alpha of Xft font. Must be a value at or between 1 and 0 ##
xftalpha 0
# Force UTF8? requires XFT ##
override_utf8_locale yes

uppercase no

			##  End Font Settings  ##
			##  Color Settings  ##
draw_shades no	#amplifies text if yes
default_shade_color black

draw_outline yes # amplifies text if yes
default_outline_color black

default_color ffffff #255 255 255	white
color0 8FBC8F #143 188 143	DarkSeaGreen
color1 778899 #119 136 153	LightSlateGray
color2 FF8C00 #255 140   0	DarkOrange
color3 7FFF00 #127 255   0	Chartreuse
color4 FFA07A #255 160 122	LightSalmon
color5 FFDEAD #255 222 173	NavajoWhite
color6 0000CD #  0 191 255	Medium blue
color7 00FFFF #  0 255 255	Cyan
color8 FFFF00 #255 255   0	Yellow
color9 FF0000 #255   0   0	RED

			##  End Color Settings  ##
			##  Borders Section  ##
draw_borders no
# Stippled borders?
stippled_borders 0
# border margins
border_inner_margin 0
border_outer_margin 0
# border width
border_width 0
# graph borders
draw_graph_borders no #yes
default_graph_size 15 40
			##  End Borders Secton  ##
			##  Miscellaneous Section  ##

background yes

use_spacer none

text_buffer_size 1024

imlib_cache_size 0

no_buffers yes

short_units no

pad_percents 2

			##  End Miscellaneous Section  ##
	
# The all important - How often conky refreshes.
update_interval 120

## lua_load ~/lua/clicky.lua
## lua_draw_hook_pre main

TEXT
${image $HOME/2b_Wunderground_API/Moon_phase.png -p 260,15 -s 130x130}
${goto 10}Phase:${alignr 170}${execi 600  sed -n '6p' $HOME/2b_Wunderground_API/Moon_Sun}
${goto 10}Illuminated:${alignr 190}${execi 600  sed -n '2p' $HOME/2b_Wunderground_API/Moon_Sun} %${font :pixelsize=8}

${font}${goto 10}Moonrise:${alignr 195}${execi 600  sed -n '26p' $HOME/2b_Wunderground_API/Moon_Sun} Hs; ${execi 600  sed -n '28p' $HOME/2b_Wunderground_API/Moon_Sun} min.
${goto 10}Moonset:${alignr 195}${execi 600  sed -n '31p' $HOME/2b_Wunderground_API/Moon_Sun} Hs; ${execi 600  sed -n '33p' $HOME/2b_Wunderground_API/Moon_Sun} min.${font :pixelsize=8}

${font}${goto 10}Sunrise:${alignr 190}${execi 600  sed -n '16p' $HOME/2b_Wunderground_API/Moon_Sun} Hs; ${execi 600  sed -n '18p' $HOME/2b_Wunderground_API/Moon_Sun} min.
${goto 10}Sunset:${alignr 170}${execi 600  sed -n '21p' $HOME/2b_Wunderground_API/Moon_Sun} Hs; ${execi 600  sed -n '23p' $HOME/2b_Wunderground_API/Moon_Sun} min.

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

#431 2015-12-26 14:15:38

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

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

Inodoro Pereyra wrote:

found $HOME/2b_Wunderground_API/Moon_phase.png is nowhere to be found.

Anybody has any idea why this may have happened?

Perhaps you have deleted the images by mistake.

Does the conky work if you replace the images?


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#432 2015-12-26 14:23:09

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

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

Head_on_a_Stick wrote:

Perhaps you have deleted the images by mistake.

Does the conky work if you replace the images?

The image is called by the script, from the images in a separate folder. The folder is there, and so are all the images inside it. I don't know why the script is not calling it... hmm


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

#433 2015-12-26 14:35:54

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

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

Ok, fixed it!

Just in case somebody else has the same problem, here's the solution:

In the script 2b, line 228, where it says

elif [[ $moon_phase == "Full Moon" ]]; then

it should read:

elif [[ $moon_phase == "Full" ]]; then

I'm fairly certain there's gonna be the same problem with the new moon, on line 226, but we're gonna have to wait 14 days for it...


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

#434 2015-12-26 14:39:22

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

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

OH ... OOPS! 
I jumped the gun ... I saw moon_phase and though 4_Moon script ...  sorry.

Yes, I'm getting the same from the wunderground script.  sad  Should be showing a full moon.

EDIT:   ninja'd by IP!
Nice find!

Don't you hate it when people make changes "just because"?  GRRRR!


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

Offline

#435 2015-12-26 15:02:43

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

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

Sector11 wrote:

EDIT:   ninja'd by IP!
Nice find!

lol lol lol  Who'd have thought? ME fixing code... tongue


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

#436 2015-12-26 15:43:22

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

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

It grows on you ... I can tweak code - just can't write it.  I never thought to look there though.
Like I said; Nice find ... and I'll add: Nice Tweak!


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

Offline

#437 2015-12-26 15:52:16

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

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

Thank you!  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

#438 2015-12-26 15:55:39

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

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

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...

Sector11 wrote:

OK, revamped my weather - - ummm Desktop #1 conkys.  We're getting older, the need to see means larger fonts. {sigh}

Nice one S11, short and to the point!

fvirgola80 wrote:

@TEO What do you think ? the script should take infomarzioni moon phase for the entire month and give her a conky ...

I'll take a look at it in a few days and see if a script is feasible.


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

#439 2015-12-26 17:55:57

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

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...

Sector11 wrote:

OK, revamped my weather - - ummm Desktop #1 conkys.  We're getting older, the need to see means larger fonts. {sigh}

Nice one S11, short and to the point!

fvirgola80 wrote:

@TEO What do you think ? the script should take infomarzioni moon phase for the entire month and give her a conky ...

I'll take a look at it in a few days and see if a script is feasible.

I have a project in mind ..... between the phases of the moon monthly and conky weather .... all this with the team - ObiWan Yoda and Luke

thanks Teo ... big_smile big_smile

Last edited by fvirgola80 (2015-12-26 17:57:44)


Nothing happens by chance

Offline

#440 2015-12-27 17:14:45

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

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

OK, I had some 'margin' problems with my last new look, not to mention another family member (family of 2 here) liked the 'current' weather on the bottom ... soooooooo more playing.

Some scrots:
Medit 'max screen - the safe zone on the bottom - and the "weather bar" still has the 'ñ' hard spacing elements:
2015_12_27_12_40_06_Scrot11.jpg 2015_12_27_12_42_48_Scrot11.jpg

Hard coding spacing elements cleaned up and a close up of how that works:
2015_12_27_12_43_40_Scrot11.jpg hard_clean_code.jpg

I got to thinking - I like the Forecast bar on the top - so back to some other elements of my last new look:
2015_12_27_13_30_18_Scrot11.jpg
Now I wait and see how this sits with the other family member.  smile  And just so you know that "centre piece" in the conky: fbpanel - systray

1b2_accuweather_conkyweather_font/S11_Weather_BAR.conky

# pkill -xf "conky -q -c $HOME//1b2_accuweather_conkyweather_font/S11_Weather_BAR.conky" &
# conky -q -c $HOME//1b2_accuweather_conkyweather_font/1b2_companion.conky &
# works 2015-12-27

own_window yes
own_window_type normal
own_window_hints undecorated,below,skip_taskbar,skip_pager,sticky
own_window_colour 000000
own_window_class Conky
own_window_title S11 Weather Bar Current Weather
own_window_transparent no
own_window_argb_visual yes
own_window_argb_value 100

double_buffer yes

minimum_size 1300 0 # w|h
maximum_width 1300

#alignment bm
#gap_x 0 # l|r
#gap_y 0 # u|d

alignment bl
gap_x 320 # l|r
gap_y 0 # u|d

use_xft yes
xftalpha 1
xftfont fantasque sans mono:size=18

override_utf8_locale yes

draw_shades yes
default_shade_color 000000
draw_outline no
default_outline_color 000000

default_color DCDCDC #Gainsboro
color0 A9A9A9 #DarkGrey
color1 778899 #LightSlateGray
color2 FAEBD7 #AntiqueWhite
color3 87CEFA #LightSkyBlue
color4 48D1CC #MediumTurquoise
color5 FFDEAD #NavajoWhite
color6 00BFFF #DeepSkyBlue
color7 F8F8FF #GhostWhite
color8 FFD700 #Gold
color9 FFA07A #LightSalmon

draw_borders no
stippled_borders 5
border_inner_margin 5
border_outer_margin 0
border_width 2

background no
use_spacer none
no_buffers yes

# bash script run by: conkyrc_1b2_int_s11_thin
# ${texeci 900 bash $HOME//1b2_accuweather_conkyweather_font/1b2}\
# Not needed here

update_interval 1
TEXT
${goto 5}${color8}±${execi 90 sed -n '30p' $HOME//1b1_accuweather_images/curr_cond}°${color}\
${goto 090}${execi 90 sed -n '29p' $HOME//1b1_accuweather_images/curr_cond}°\
${goto 142}${color}${execi 90 sed -n '33p' $HOME//1b1_accuweather_images/curr_cond}\
${goto 267}${color0}UVI${color} ${execpi 600 sed -n '34p' $HOME//1b2_accuweather_conkyweather_font/curr_cond}\
${goto 344}${color0}Hum${color} ${execpi 600 sed -n '32p' $HOME//1b2_accuweather_conkyweather_font/curr_cond}\
${goto 445}${color0}W${color} ${execpi 600 sed -n '31p' $HOME//1b2_accuweather_conkyweather_font/curr_cond}\
${goto 520}${execpi 600 sed -n '38p' $HOME//1b2_accuweather_conkyweather_font/curr_cond}${color}\
${goto 700}${color0}CC${color} ${execpi 600 sed -n '36p' $HOME//1b2_accuweather_conkyweather_font/curr_cond}\
${goto 790}${color0}CoP${color} ${execpi 600 sed -n '28p' $HOME//1b2_accuweather_conkyweather_font/first_days}\
${goto 890}${color8}|${color0}Today\
${goto 965}${color9}${execpi 600 sed -n '27p' $HOME//1b2_accuweather_conkyweather_font/first_days}°${color}\
${goto 1040}${color3}${execpi 600 sed -n '26p' $HOME//1b2_accuweather_conkyweather_font/first_days}°${color}\
${goto 1085}${color8}|${color0}Tonight\
${goto 1185}${color9}${execpi 600 sed -n '31p' $HOME//1b2_accuweather_conkyweather_font/first_days}°${color}\
${goto 1265}${color3}${execpi 600 sed -n '32p' $HOME//1b2_accuweather_conkyweather_font/first_days}°${color}\
${goto 60}${color5}${font conkyweather:bold:size=20}${execi 600  sed -n '27p' $HOME//1b2_accuweather_conkyweather_font/curr_cond}\
${goto 1010}${color5}${execi 600  sed -n '27p' $HOME//1b2_accuweather_conkyweather_font/curr_cond}\
${goto 1235}${color5}${execi 600  sed -n '30p' $HOME//1b2_accuweather_conkyweather_font/first_days}${font}

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

Offline

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

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

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
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,866

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

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


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

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... kiss 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,483

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

Inodoro Pereyra wrote:

Thank you Teo. Feels nice to be useful, once in a while... kiss 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,483

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,483

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
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,866

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

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

Offline

Board footer

Powered by FluxBB