You are not logged in.
That's why the tears. It's
but I can't have it 8.(
Don't feel bad when I use the [1] variable and alerts are 0 then I get "set txt" for an output.
I haven't tried to use an "if", "elseif", "then" statement in the code.
That's when I'd probably really screw things up.
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
well, i can still work on it for US and Europe, V9000 was only US locations for alerts, so there is that.
@jst_joe - yes, you will need an if to check on number of alerts
ill see if i can put together an alerts display function, that will be able to take into account all the possible outcomes
Offline
@jst_joe - yes, you will need an if to check on number of alerts
ill see if i can put together an alerts display function, that will be able to take into account all the possible outcomes
You are da-man!
I think I'll give it a shot a little later just to see if I can.
What's the worst that could happen? 8o
I'll just have to start over again. ]:D
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
well, i can still work on it for US and Europe, V9000 was only US locations for alerts, so there is that.
@jst_joe - yes, you will need an if to check on number of alerts
ill see if i can put together an alerts display function, that will be able to take into account all the possible outcomes
It just hit me: US and Europe!
Not even Canada ... now I'm really 8.(
8o (who can take a monkey seriously)
I'll get a US address to test that's what I'll do.
Find some obscure, out of the way, little "Mayberry" (Hey Andy, hey Barney) type place and test away ...
. . . like NYC!
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
. . . like NYC!
![]()
![]()
New York City...
Get a rope!
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
Well I added this if statement
--ALERTS SECTION #########################################################################
gap=13
ypos=420
ypos=ypos+gap
if alerts.number==0 then
out({fs=12,x=10,y=ypos,txt="Weather alerts: "..alerts.number,shadow=1})
elseif alerts.number>=0 then
out({fs=12,x=10,y=ypos,txt="Weather alerts: "..alerts.number,shadow=1})
ypos=ypos+gap+gap
out({fs=14,c=0xFF0000,x=10,y=ypos,txt=alerts[1].description,shadow=1})
ypos=ypos+gap
wrapy=out({wrap_len=60,wrap_gap=15,fs=12,x=10,y=ypos,txt=alerts[1].message_heading,shadow=1})
ypos=ypos+gap+wrapy
wrapy=out({wrap_len=60,wrap_gap=15,fs=12,x=10,y=ypos,txt=alerts[1].message_body,shadow=1})--]]
end
and it got rid of the "set txt" messages.
Then I set my zip to Boston who's having a Winter Storm Watch and things seem to have worked.
And nothing broke.
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
Sector11 wrote:. . . like NYC!
![]()
![]()
New York City...
Get a rope!![]()
![]()
A rope? I was thinking more along the line of a dog sled and half a dozen Huskies! O:)
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
A rope? I was thinking more along the line of a dog sled and half a dozen Huskies! O:)
I didn't think that you might not have seen the Pace Picante Sauce commercial in your neck of the woods.
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
Sector11 wrote:A rope? I was thinking more along the line of a dog sled and half a dozen Huskies! O:)
I didn't think that you might not have seen the Pace Picante Sauce commercial in your neck of the woods.
Ahhh yes, the old "Pace Picante Sauce commercial" trick! What's that?
BTW: I don't drive a Sunbeam!
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
BTW: I don't drive a Sunbeam!
![]()
![]()
The Alpine sucked...
however the Tiger that was driven in the beginning of the show was HOT!
How's that for dating myself? ]:D
Last edited by jst_joe (2014-02-04 01:06:41)
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
i think this should do it for US alerts
wun.lua https://dl.dropboxusercontent.com/u/190 … ing.tar.gz
for the message, it looks like there is always 2 parts to it, with the top part sometimes being broken up into sub sections
alert data options
alerts.number
alerts[1].type
alerts[1].description
alerts[1].date
alerts[1].expires
alerts[1].message_heading
alerts[1].message_body[n] (this is a table so needs to be treated differently)
alerts[1].message_statement
im suing this code in my template
--ALERTS SECTION
local altx=10--top left x
local alty=350--top left y
local allw=15--line gap
out({x=altx,y=alty,txt="Alerts: "..alerts.number})
if alerts.number>0 then
for i=1,alerts.number do
ypos=alty+allw
out({x=altx,y=ypos,txt=alerts[i].description})--description
ypos=ypos+allw
nexty=out({c=0xFF8C00,x=altx,y=ypos,txt=alerts[i].message_heading,wrap_len=85})--heading text
for n=1,#alerts[i].message_body do--this loop prints the body text
ypos=ypos+nexty+allw
nexty=out({x=altx,y=ypos,txt=alerts[i].message_body[n],wrap_len=85})
end
ypos=ypos+nexty+allw
out({c=0x00BFFF,x=altx,y=ypos,txt=alerts[i].message_statement,wrap_len=85})--statement text
end
end
Last edited by mrpeachy (2014-02-04 03:11:21)
Offline
@mrpeachy,
The alerts section works GREAT (sorry Sector11 you can use my zip if you like
).
Just to show readability with extremes in backgrounds.
I know the white text on a white background looks fuzzy but it's still readable.
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
@mrpeachy,
The alerts section works GREAT(sorry Sector11 you can use my zip if you like
).
Just to show readability with extremes in backgrounds.
http://ccs-wtn.com/webimg/alerts_bk-wt_tmb.jpg
I know the white text on a white background looks fuzzy but it's still readable.
That's not bad at all ... I'm still looking for a smallish out of the way place that might prove interesting ... got run out of NYC by a mob with a rope ... best guess; they didn't like my homemade chimichurri.
That white text isn't so bad with the 'shadow' it looks chiseled in place.
Test with one of these:
F5F5DC # Beige
DCDCDC # Gainsboro
or a little more radical:
FFDEAD # NavajoWhite
B0E0E6 # PowderBlue
Last edited by Sector11 (2014-02-04 17:47:47)
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
best guess; they didn't like my homemade chimichurri.
Ooh! That looks really good.
Test with one of these:
F5F5DC # Beige
DCDCDC # Gainsboro
or a little more radical:
FFDEAD # NavajoWhite
As my bg or text color?
EDIT: to change wall to text :8
Last edited by jst_joe (2014-02-04 17:51:34)
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
Sector11 wrote:best guess; they didn't like my homemade chimichurri.
Ooh!
That looks really good.
It is ... it is ... I have two batches, mild for my wife and "hell in a bottle" for me.
Test with one of these: F5F5DC # Beige DCDCDC # Gainsboro or a little more radical: FFDEAD # NavajoWhite
As my bg or text color?
EDIT: to change wall to text :8
I was thinking 'text colour' when I posted that, black shadow.
I've been using beige as my text colour for about 2|3 weeks now with new wun conkys. I like it.
Off white that isn't intrusive in it's white intensity.
I also like
CD5C5C # IndianRed
rather than just 'red' that's too intense. (opinion)
Beige = 27° PowderBlue = ±28° IndianRed = ↑27
Oops: B0E0E6 # PowderBlue
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
@mrpeachy,
The alerts section works GREAT(sorry Sector11 you can use my zip if you like
).
Just to show readability with extremes in backgrounds.
http://ccs-wtn.com/webimg/alerts_bk-wt_tmb.jpg
I know the white text on a white background looks fuzzy but it's still readable.
very nice
hopefully it will hold for other kinds of alerts too!
@sector11 - if you are looking for a test location, somewhere in Europe that has bad weather would be good!
I have no idea what a European weather alert looks like apart from the demonstration one on the wunderground site
"alerts": [ { "type": "HEA",
"wtype_meteoalarm": "5",
"wtype_meteoalarm_name": "Extreme high temperature",
"level_meteoalarm": "4",
"level_meteoalarm_name": "Red",
"level_meteoalarm_description": "The weather is very dangerous. Exceptionally intense meteorological phenomena have been forecast. Major damage and accidents are likely, in many cases with threat to life and limb, over a wide area. Keep frequently informed about detailed expected meteorological conditions and risks. Follow orders and any advice given by your authorities under all circumstances, be prepared for extraordinary measures.",
"description": "Extreme high temperature",
"date": "2012-08-21 04:00:00 GMT",
"date_epoch": "NA",
"expires": "2012-08-22 16:00:00 GMT",
"expires_epoch": "NA",
"message": "Extreme high temperature)",
"phenomena": "NA",
"significance": "NA",
"attribution": "Information provided by , EUMETNET - MeteoAlarm Note: Time delays between this website and Meteoalarm.eu are possible. For the most up-to-date information about alert levels as published by the participating National Meteorological Services, please visit Meteoalarm. For terms of use of this information, and copyright information, see Meteoalarm Terms of Use." }
Last edited by mrpeachy (2014-02-04 19:00:15)
Offline
I also like
CD5C5C # IndianRed
rather than just 'red' that's too intense. (opinion)
Beige Powder_Blue Indian_Red
Beige = 27° PowderBlue = ±28° IndianRed = ↑27
Oops: B0E0E6 # PowderBlue
Very nice and easy on the eyes, I think the Gainsboro looks good also.
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
@sector11 - if you are looking for a test location, somewhere in Europe that has bad weather would be good!
I have no idea what a European weather alert looks like apart from the demonstration one on the wunderground site
GOOD IDEA!!!! I gotta run right now but, will do that when I get back .... Europe here I come!!!!
· ↓ ↓ ↓ ↓ ↓ ↓ ·
BunsenLabs Forums now Open for Registration
· ↑ ↑ ↑ ↑ ↑ ↑ · BL ModSquad
Offline
wun can be small and light!
total cpu at 2%
--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION--DISPLAY FUNCTION-
_G.weather_script = function(update,time,now,text_forecast,day,hour)--#### DO NOT EDIT THIS LINE ##############
--#######################################################################
--these tables hold the coordinates for each repeat do not edit #########
top_left_xcoordinate={}--################################################
top_left_ycoordinate={}--################################################
--#######################################################################
--SET DEFAULTS ##########################################################
--set defaults do not localise these defaults if you use a seperate display script
default_font="Droid Sans Mono"--font must be in quotes
default_font_size=12
default_face="normal"
default_color=0xDCDCDC--white
default_alpha=1--fully opaque
default_image_width=60
default_image_height=60
--END OF DEFAULTS #########################################################
--draw_background
cairo_rectangle(cr,0,0,300,260)
cairo_set_source_rgba (cr,0,0,0,0.4)
cairo_fill (cr)
image({x=0,y=0,h=150,w=150,file=now.weather_icon})
out({x=160,y=50,fs=44,txt=now.temp_imperial..now.temp_imperial_unit})
out({x=10,y=130,fs=18,txt=string.lower(now.location_full..", "..now.location_country)})
out({x=10,y=150,fs=14,txt=string.lower(now.conditions)})
out({x=10,y=165,fs=14,txt=string.lower(now.wind_imperial..now.wind_imperial_unit.." "..now.wind_dir)})
--set colum width
local column_width=100
local startx=0
local ypos=180
--rcolumn 1
top_left_xcoordinate[1]=startx+(0*column_width)
top_left_ycoordinate[1]=ypos
--column 2
top_left_xcoordinate[2]=startx+(1*column_width)
top_left_ycoordinate[2]=ypos
--column 3
top_left_xcoordinate[3]=startx+(2*column_width)
top_left_ycoordinate[3]=ypos
local start_number=2
local end_number=4
--########################################################################################
for i=start_number,end_number do --start of day repeat, do not edit ######################
tlx=top_left_xcoordinate[i-(start_number-1)] --sets top left x position for each repeat ##
tly=top_left_ycoordinate[i-(start_number-1)] --sets top left y position for each repeat ##
--########################################################################################
--WRITE REPEAT CODE HERE ### use i in the square brackets within the loop [i] ############
image({x=tlx+5,y=tly,h=90,w=90,file=day[i].weather_icon})
out({x=tlx+10,y=tly+60,fs=14,txt=string.lower(day[i].weekday_short)})
out({c=0xFF8C00,fs=14,x=tlx+10,y=tly+20,txt=day[i].high_imperial..day[i].high_imperial_unit})
out({c=0x00BFFF,fs=14,x=tlx+10,y=tly+40,txt=day[i].low_imperial..day[i].low_imperial_unit})
--END OF REPEAT CODE######################################################################
end--of loop##############################################################################
--########################################################################################
--END OF WEATHER CODE ----END OF WEATHER CODE ----END OF WEATHER CODE ---
--########################################################################################
end--of weather_display function do not edit this line ##################
--#######################################################################
astronomy turned off in config also
Last edited by mrpeachy (2014-02-05 05:07:39)
Offline
^ Nice and I got the same results 2% cpu.
I've got a good one for you, I started getting this last night
I get this in a terminal
joe@crunchbang:~$ conky -c ~/wun/conky_configs/wunrci
Conky: desktop window (155) is root window
Conky: window type - normal
Conky: drawing to created window (0x1600001)
Conky: drawing to double buffer
pinging www.wunderground.com
wunderground ping test passed
data url= http://api.wunderground.com/api/my_key/conditions/forecast10day/astronomy/hourly/satellite/alerts/lang:EN/q/38343.json
processed text data for 20 time periods, padded 0
processed data for 10 days, padded 0
processed data for 36 hours, padded 0
Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/wun.lua:839: attempt to perform arithmetic on local 'f' (a nil value)
own_window_title=interactiveconkyrc
5 5 8545789 23068673 /tmp/xdo
here's the kicker if I put in a different zip everything works fine.
Could it be a problem with the local weather servers?
Last edited by jst_joe (2014-02-05 17:28:43)
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
^ Nice and I got the same results 2% cpu.
I've got a good one for you, I started getting this last night
http://ccs-wtn.com/webimg/set_txt.jpg
I get this in a terminaljoe@crunchbang:~$ conky -c ~/wun/conky_configs/wunrci Conky: desktop window (155) is root window Conky: window type - normal Conky: drawing to created window (0x1600001) Conky: drawing to double buffer pinging www.wunderground.com wunderground ping test passed data url= http://api.wunderground.com/api/yourkey/conditions/forecast10day/astronomy/hourly/satellite/alerts/lang:EN/q/38343.json processed text data for 20 time periods, padded 0 processed data for 10 days, padded 0 processed data for 36 hours, padded 0 Conky: llua_do_call: function conky_weather execution failed: /home/joe/wun/wun.lua:839: attempt to perform arithmetic on local 'f' (a nil value) own_window_title=interactiveconkyrc 5 5 8545789 23068673 /tmp/xdo
here's the kicker if I put in a different zip everything works fine.
Could it be a problem with the local weather servers?
i will check it out
make sure you edit your post and remove your api key
Offline
make sure you edit your post and remove your api key
Thanks :8
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
@joe try this wun.lua
https://dl.dropboxusercontent.com/u/190 … est.tar.gz
problem was a different message format for floods
Last edited by mrpeachy (2014-02-05 17:38:22)
Offline
@joe try this wun.lua
![]()
https://dl.dropboxusercontent.com/u/190 … est.tar.gzproblem was a different message format for floods
Yeah! That's the ticket.
As usual worked like a charm.
Thanks
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
I add this after the forcast repeat section of falldowns template
--ALERTS SECTION #########################################################################
local altx=15--top left x
if bc==0 then
alty=270--top left y
elseif bc==1 then
alty=575--top left y
end
--local alty=575--top left y
local allw=15--line gap
out({x=altx,y=alty,fs=14,txt="Alerts: "..alerts.number,shadow=1})
if alerts.number>0 then
for i=1,alerts.number do
ypos=alty+allw
out({x=altx,y=ypos,fs=14,face="bold",c=0xD7004C,txt=alerts[i].description,shadow=1})--description
ypos=ypos+allw
nexty=out({c=0xFFFF00,x=altx,y=ypos,fs=13,txt=alerts[i].message_heading,wrap_len=50,shadow=1})--heading text
for n=1,#alerts[i].message_body do--this loop prints the body text
ypos=ypos+nexty+allw
nexty=out({x=altx,y=ypos,fs=12,txt=alerts[i].message_body[n],wrap_len=50,shadow=1})
end
ypos=ypos+nexty+allw
out({c=0x0099FF,x=altx,y=ypos,fs=12,txt=alerts[i].message_statement,wrap_len=50,shadow=1})--statement text
end
end--of alerts section ###################################################################
A person who has a cat by the tail knows a whole lot more about cats than someone who has just read about them.
Mark Twain
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat