SEARCH

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

You are not logged in.

#1 2011-10-15 15:25:02

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 137

{SOLVED} Conky Weather Disaster

Greetings all,
Have been trying to get weather working in conky for a while now.  I have tried the weather.xoap scripts in conkyForecast but it seems as if weather.com is going to an API and is only on a free offer until you have to pay a monthly fee.
So I followed the directions to the letter in this thread about setting up weather with wunderground.

Once I got everything switched over to the correct folder and edited the .conkyrc to point to the correct folder I held my breath and launched.
Something definitely came up on the screen but it's a mess. 
Received this from launching via terminal:

Conky: /home/ichase/.conkyrc: 39: no such configuration: 'border_margin'
Conky: desktop window (223) is root window
Conky: window type - override
Conky: drawing to created window (0x1800001)
Conky: failed to set up double buffer
Conky: drawing to single buffer
--2011-10-15 11:09:04--  http://ical.wunderground.com/auto/ical/VA/Virginia_Beach.ics?units=english
Resolving ical.wunderground.com... 38.102.136.104
Connecting to ical.wunderground.com|38.102.136.104|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/calendar]
Saving to: `/home/ichase/conky_wunderground/ics1'

    [ <=>                                                                                                                    ] 4,489       --.-K/s   in 0.01s   

2011-10-15 11:09:04 (309 KB/s) - `/home/ichase/conky_wunderground/ics1' saved [4489]

rm: cannot remove `/home/ichase/conky_wunderground/14': No such file or directory
rm: cannot remove `/home/ichase/conky_wunderground/13': No such file or directory
rm: cannot remove `/home/ichase/conky_wunderground/12': No such file or directory

Also, my .conkyrc

# UBUNTU-CONKY

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer none
use_xft yes

# Update interval in seconds
update_interval 3.0

# Minimum size of text area
minimum_size 400 5


override_utf8_locale no

# Draw shades?
draw_shades yes

# Text stuff
draw_outline yes # amplifies text if yes
draw_borders yes
#font FreeSans -10
xftfont freesans:pixelsize=11
uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 3

# border margins
border_margin 9

# border width
border_width 10

# Default colors and also border colors, grey90 == #e5e5e5
default_color EBCA92

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
alignment top_left
#alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 220

# stuff after 'TEXT' will be formatted on screen

TEXT
${execi 600 sh /home/ichase/conky_wunderground/wunderground-script.sh}${if_existing /home/ichase/conky_wunderground/14}${color 7D9996}Today ${hr 2}$color        
${font conkyweather:size=35}${execi 600  sed -n '15p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n'2p' /home/ichase/conky_wunderground/messages.wun}   
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '3p' /home/ichase/conky_wunderground/messages.wun}
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '1p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '4p' /home/ichase/conky_wunderground/messages.wun}  

${font conkyweather:size=35}${execi 600  sed -n '16p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '6p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '7p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '2p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '8p' /home/ichase/conky_wunderground/messages.wun}${endif}${if_existing /home/ichase/conky_wunderground/12}${color 7D9996}Today ${hr 2}$color        
${font conkyweather:size=35}${execi 600  sed -n '15p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '2p' /home/ichase/conky_wunderground/messages.wun}   
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '3p' /home/ichase/conky_wunderground/messages.wun}
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '1p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '4p' /home/ichase/conky_wunderground/messages.wun}  

${font conkyweather:size=35}${execi 600  sed -n '16p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '6p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '7p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '2p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '8p' /home/ichase/conky_wunderground/messages.wun}${endif}${if_existing /home/ichase/conky_wunderground/13}${color 7D9996}Tonight ${hr 2}$color
${font conkyweather:size=35}${execi 600  sed -n '16p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '6p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '7p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '2p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '8p' /home/ichase/conky_wunderground/messages.wun}${endif}   

${color 7D9996}${execi 600  sed -n '9p' /home/ichase/conky_wunderground/messages.wun} ${hr 2}$color            
${font conkyweather:size=35}${execi 600  sed -n '17p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '10p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '11p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '3p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '12p' /home/ichase/conky_wunderground/messages.wun}  

${font conkyweather:size=35}${execi 600  sed -n '18p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '14p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '15p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '4p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '16p' /home/ichase/conky_wunderground/messages.wun}   

${color 7D9996}${execi 600  sed -n '17p' /home/ichase/conky_wunderground/messages.wun} ${hr 2}$color            
${font conkyweather:size=35}${execi 600  sed -n '19p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '18p' /home/ichase/conky_wunderground/messages.wun}   
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '19p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '5p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '20p' /home/ichase/conky_wunderground/messages.wun}

${font conkyweather:size=35}${execi 600  sed -n '20p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '22p' /home/ichase/conky_wunderground/messages.wun}  
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '23p' /home/ichase/conky_wunderground/messages.wun}    
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '6p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '24p' /home/ichase/conky_wunderground/messages.wun}   

${color 7D9996}${execi 600  sed -n '25p' /home/ichase/conky_wunderground/messages.wun} ${hr 2} $color           
${font conkyweather:size=35}${execi 600  sed -n '21p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '26p' /home/ichase/conky_wunderground/messages.wun}   
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '27p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '7p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '28p' /home/ichase/conky_wunderground/messages.wun}   

${font conkyweather:size=35}${execi 600  sed -n '22p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '30p' /home/ichase/conky_wunderground/messages.wun}  
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '31p' /home/ichase/conky_wunderground/messages.wun}    
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '8p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '32p' /home/ichase/conky_wunderground/messages.wun} 

${color 7D9996}${execi 600  sed -n '33p' /home/ichase/conky_wunderground/messages.wun} ${hr 2}   $color         
${font conkyweather:size=35}${execi 600  sed -n '23p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '34p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '35p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '9p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '36p' /home/ichase/conky_wunderground/messages.wun}

${font conkyweather:size=35}${execi 600  sed -n '24p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '38p' /home/ichase/conky_wunderground/messages.wun}  
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '39p' /home/ichase/conky_wunderground/messages.wun}   
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '10p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '40p' /home/ichase/conky_wunderground/messages.wun}

${color 7D9996}${execi 600  sed -n '41p' /home/ichase/conky_wunderground/messages.wun} ${hr 2}  $color          
${font conkyweather:size=35}${execi 600  sed -n '25p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '42p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '43p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '11p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '44p' /home/ichase/conky_wunderground/messages.wun}

${font conkyweather:size=35}${execi 600  sed -n '26p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '46p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '47p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '12p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '48p' /home/ichase/conky_wunderground/messages.wun}

${if_existing /home/ichase/conky_wunderground/14}${color 7D9996}${execi 600  sed -n '49p' /home/ichase/conky_wunderground/messages.wun} ${hr 2}  $color           
${font conkyweather:size=35}${execi 600  sed -n '27p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '50p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '51p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '13p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '52p' /home/ichase/conky_wunderground/messages.wun}

${font conkyweather:size=35}${execi 600  sed -n '28p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '54p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '55p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '14p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '56p' /home/ichase/conky_wunderground/messages.wun}${endif}${if_existing /home/ichase/conky_wunderground/13}${color 7D9996}${execi 600  sed -n '49p' /home/ichase/conky_wunderground/messages.wun} ${hr 2}  $color           
${font conkyweather:size=35}${execi 600  sed -n '27p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '50p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '51p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '13p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '52p' /home/ichase/conky_wunderground/messages.wun}

${font conkyweather:size=35}${execi 600  sed -n '28p' /home/ichase/conky_wunderground/icons.wun}${font} ${voffset -22}${execi 600 sed -n '54p' /home/ichase/conky_wunderground/messages.wun}
${alignc -10}${voffset -27}${font conkyweather:size=35}E${font}${voffset -20}${offset -10}${execi 600 sed -n '55p' /home/ichase/conky_wunderground/messages.wun}     
${alignr 40}${voffset -27}${font ConkyWindNESW:size=35}${execi 600 sed -n '14p' /home/ichase/conky_wunderground/icons.wun}${font}${voffset -15}${execi 600 sed -n '56p' /home/ichase/conky_wunderground/messages.wun}${endif}

I see many people using weather scripts on their 1st conkys with no issues.  I put the blame on myself that there must be some variable that I am not getting.
So your help and guidance is greatly appreciated.

All the best,

Ian

Last edited by ichase (2011-11-12 00:59:54)

Offline

Help fund CrunchBang, donate to the project!

#2 2011-10-15 16:04:25

psyco430404
#! Die Hard
From: Las Vegas, Nevada
Registered: 2011-07-04
Posts: 804

Re: {SOLVED} Conky Weather Disaster

If all your wanting is weather for the current day, and not some complex script that uses the weather font, or gives full forecasts, heres a great one line script thats really easy to use.

https://bbs.archlinux.org/viewtopic.php?id=37381


"'If fighting is to result in victory, then you must fight'...Sun Tzu said that and id say he knows a little more about fighting then you do pal."

- TF2 Soldier

Offline

#3 2011-10-15 16:09:00

dubois
The Old Codger
Registered: 2010-09-03
Posts: 2,238

Re: {SOLVED} Conky Weather Disaster

^ That script from the Arch Forums is brilliant.  big_smile

EDIT -- left a word out of the sentence

Last edited by dubois (2011-10-15 16:15:33)

Offline

#4 2011-10-15 16:10:16

psyco430404
#! Die Hard
From: Las Vegas, Nevada
Registered: 2011-07-04
Posts: 804

Re: {SOLVED} Conky Weather Disaster

dubois wrote:

^ That script from the Arch Forums brilliant.  big_smile

I thought so big_smile, only weather script i could ever get working lol


"'If fighting is to result in victory, then you must fight'...Sun Tzu said that and id say he knows a little more about fighting then you do pal."

- TF2 Soldier

Offline

#5 2011-10-15 17:32:55

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 11,496

Re: {SOLVED} Conky Weather Disaster

weather-util is also good for a slightly more comprehensive weather report; simplest syntax is `weather [alias]`, where [alias] is your local METAR station.  Since ichase is clearly a Caniac, I'm guessing RDU would be your METAR alias?

Forecasts are still broken for weather-util, by the way...been broken about a year and a half now...not the developer's fault though; NOAA changed how forecast data is organized on their server.


Yes; as a matter of fact, I am a cop.  Why do you ask? cool
I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#6 2011-10-15 17:50:09

dubois
The Old Codger
Registered: 2010-09-03
Posts: 2,238

Re: {SOLVED} Conky Weather Disaster

^ Ah.  I thought you were the one who'd mentioned weather-util previously.  Handy tool.

tYXRueA

Offline

#7 2011-10-15 17:57:37

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 11,496

Re: {SOLVED} Conky Weather Disaster

Well, looks like Texas still has the old directory structure.  Weird.  In NC, this was broken sometime around March last year.


Yes; as a matter of fact, I am a cop.  Why do you ask? cool
I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#8 2011-10-15 20:21:55

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 137

Re: {SOLVED} Conky Weather Disaster

Thanks for the replies everyone.  Yes I am most definitely a caniac pvsage but live in Virginia Beach because that is where the job is.  wink Been happy with their play against Boston and Buffalo.
I tried out the script from Arch linux forums.  Arch is what I use anyway so I tried it out but obviously did something wrong.  I substituted "METRIC" for my zip code but I get the following error when running conky from the terminal:

curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
/home/ichase/weather.sh: line 18: http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=23454: No such file or directory

I changed the necessary things in the weather.sh script as far as I can tell.

#!/bin/sh
#AccuWeather (r) RSS weather tool for conky
#
#USAGE: weather.sh <locationcode>
#
#(c) Michael Seiler 2007

METRIC=1 #Should be 0 or 1; 0 for F, 1 for C

if [ -z $1 ]; then
    echo
    echo "USAGE: weather.sh <23454>"
    echo
    exit 0;
fi

curl -s
http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${23454}\&locCode\=$1 | perl -ne 'if (/Currently/)
{chomp;/\<title\>Currently:(.*)?\<\/title\>/; print "$1"; }'

So not sure what I am doing wrong.

Last edited by ichase (2011-10-15 20:23:02)

Offline

#9 2011-10-15 20:37:26

dubois
The Old Codger
Registered: 2010-09-03
Posts: 2,238

Re: {SOLVED} Conky Weather Disaster

Did you set permissions on your weather.sh?

The reason I ask such an elementary question is because for the longest time it was an error I continued to make.  It's just a question.

Last edited by dubois (2011-10-15 20:51:02)

Offline

#10 2011-10-15 21:50:16

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 137

Re: {SOLVED} Conky Weather Disaster

dubois wrote:

Did you set permissions on your weather.sh?

The reason I ask such an elementary question is because for the longest time it was an error I continued to make.  It's just a question.

Thanks for the reply dubois,
I made it executable and the permissions are set to read/write for user.

Offline

#11 2011-10-15 21:57:58

dubois
The Old Codger
Registered: 2010-09-03
Posts: 2,238

Re: {SOLVED} Conky Weather Disaster

...and the path is correct?  Here's the short version of that script from my files if you choose to try it.  Just to double check things, you know?

#!/bin/sh
#AccuWeather (r) RSS weather tool for conky
#
#USAGE: weather.sh <locationcode>
#
#(c) Michael Seiler 2007

METRIC=0 #Should be 0 or 1; 0 for F, 1 for C

if [ -z $1 ]; then
    echo
    echo "USAGE: weather.sh 78758"
    echo
    exit 0;
fi

curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 \
| sed -n '/Currently:/ s/.*: \(.*\): \([-0-9]*\)\([CF]\).*/\1\ \2°\3/p'

#Source = https://bbs.archlinux.org/viewtopic.php?pid=567663#p567663

Offline

#12 2011-10-16 01:13:37

ichase
#! CrunchBanger
Registered: 2011-03-16
Posts: 137

Re: {SOLVED} Conky Weather Disaster

dubois, that seemed to do the trick.  Now I see on my conky "Clear 63 degrees"  I take it I can work on the script and get more info?

Thanks again.

Ian

Offline

#13 2011-10-16 04:36:40

psyco430404
#! Die Hard
From: Las Vegas, Nevada
Registered: 2011-07-04
Posts: 804

Re: {SOLVED} Conky Weather Disaster

No if you leave it in its current state, thats what it gives you, todays forecast and nothing else (hence its a one liner) if you red page 3 it has another script that gives you a bit more info


"'If fighting is to result in victory, then you must fight'...Sun Tzu said that and id say he knows a little more about fighting then you do pal."

- TF2 Soldier

Offline

#14 2011-10-17 05:40:15

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

Re: {SOLVED} Conky Weather Disaster

ichase wrote:
curl: no URL specified!
curl: try 'curl --help' or 'curl --manual' for more information
/home/ichase/weather.sh: line 18: http://rss.accuweather.com/rss/liveweather_rss.asp?metric=1&locCode=23454: No such file or directory

Change line 3 in weather.sh

METRIC=0

Change Line18 to generic and then change conky to ask for

curl -s http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 | perl -ne 'if (/Currently/) {chomp;/\<title\>Currently: (.*)?\<\/title\>/; print "$1"; }'
${execi 300 /home/ichase/Conky/weather.sh 23454}

Last edited by BoredOOMM (2011-10-17 05:44:37)


Congratulations, you've figured out the sound of one hand clapping...

Offline

#15 2011-10-17 05:49:04

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

Re: {SOLVED} Conky Weather Disaster

I searched all morning for this script yesterday.
I want about 6 lines of text for forecast- same as in the Arch script using awk script in this post.

I cannot seem to get the longer text as shown in the RSS feed.  All I get is what is shown below-

WEATHER
Now: Clear, 64F
Today: 55-85C
Tomorrow: 55-81C

weather.sh script http://pastebin.com/VNm8uLfw

.weatherconky   http://pastebin.com/ty3VFUdV


Congratulations, you've figured out the sound of one hand clapping...

Offline

#16 2011-10-17 13:14:53

dubois
The Old Codger
Registered: 2010-09-03
Posts: 2,238

Re: {SOLVED} Conky Weather Disaster

^ I was never able to get that to work as it's written which is why I settled on the shortened version.  Too many weather codes are either too verbose or too brief...  and I'm merely a user.  hmm

Offline

#17 2011-10-17 13:32:40

psyco430404
#! Die Hard
From: Las Vegas, Nevada
Registered: 2011-07-04
Posts: 804

Re: {SOLVED} Conky Weather Disaster

There should be a C in parenthesis, change that to a F.


"'If fighting is to result in victory, then you must fight'...Sun Tzu said that and id say he knows a little more about fighting then you do pal."

- TF2 Soldier

Offline

#18 2011-10-18 06:16:36

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

Re: {SOLVED} Conky Weather Disaster

psyco430404 wrote:

There should be a C in parenthesis, change that to a F.

I did more than that by playing with the code and by trial and error found the happy medium for now. 

# !/usr/bin/bash
METRIC=0 #Should be 0 or 1; 0 for F, 1 for C
if [ -z $1 ]; then
    echo "USAGE: weather.sh <locationcode>"
    exit 0;
fi

wget -q http://rss.accuweather.com/rss/liveweather_rss.asp\?metric\=${METRIC}\&locCode\=$1 -O - | awk \
'/Currently:/ {CurWeather=$0}
/[0-9] Forecast<\/title>/ {nr=NR+5}
NR==nr    {postIndx[++x]=$0}
# x>2    {exit}
END{
    split(CurWeather,tmp,"Currently: ")
    split(tmp[2],tmp1,"<")
    CurWeather=sprintf("%s",tmp1[1])
    sub(":",",",CurWeather)
    for(x in postIndx){
    split(postIndx[x],tmp,";|&")
    split(tmp[1],tmp,">")
    split(tmp[2],statement," F ") # substitute C for F if metric differs
    split(tmp[2],temp)
    forecast[++y]=sprintf("%d-%dF %-15s",temp[5],temp[2],statement[3])
    }
    printf("Now: %s\nToday: %s\nTomorrow: %s",CurWeather,forecast[1],forecast[2])
}'

Congratulations, you've figured out the sound of one hand clapping...

Offline

#19 2011-10-18 13:06:12

dubois
The Old Codger
Registered: 2010-09-03
Posts: 2,238

Re: {SOLVED} Conky Weather Disaster

I love weather and weather apps!  Once I get some coffees in me I'll give it a try -- not like I can't look outside and see we're still in the worst or second worst drought since 1500 based on tree ring growthhmm  wink



EDIT -- No, that didn't work.  It just left a blank space in my conky like the other long version from the original source.  Xin loi.  sad

Last edited by dubois (2011-10-18 13:46:52)

Offline

#20 2011-10-18 15:40:24

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 11,496

Re: {SOLVED} Conky Weather Disaster

I *must* learn AWK.  It doesn't take a rocket scientist to realize that http://www.weather.com/weather/hourbyhour/[ZIP] gives a very detailed local forecast (for US ZIP codes anyway...no offense intended to people in other countries, it's just the US is where I live).  The text-based browsers like links2 & lynx display this in a fairly readable format, but everything's in a single looong column, and there's a lot of cruft...shouldn't take too much work to parse it into something that can be beautifully displayed in Conky, or possibly in a terminal window.  As far as I know, these pages aren't part of the "Oh by the way, this is going to be a subscription-only service soon" API crap.


Yes; as a matter of fact, I am a cop.  Why do you ask? cool
I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#21 2011-10-18 16:47:07

chaanakya
#! Die Hard
Registered: 2010-12-30
Posts: 940

Re: {SOLVED} Conky Weather Disaster

Here are my two scripts:
Temperature:

#!/bin/bash
WEATHER=`wget -q -T 1 -O - http://www.accuweather.com/us/ca/pasadena/91101/city-weather-forecast.asp?unit=c | grep '<div class="info"> <span class="cond">' | grep -o [0-9] | sed '/.*[^\.]$/N;s/\n *//'`
WEATHER=$WEATHER°
echo $WEATHER

Conditions:

#!/bin/bash
wget -q -O - http://www.accuweather.com/us/ca/pasadena/91101/city-weather-forecast.asp?unit=c | grep -o '<div class="info"> <span class="cond">[A-Z].*</span> <strong' | sed -e 's/.*<span class="cond".//' | sed -e 's/<\/span>.*//'

You'll have to change the URL to your city/zip-code.  If you want it in Fahrenheit, take off the ?unit=c part at the end of the URL.  I don't have forecasts working yet, but I could try... wink

Last edited by chaanakya (2011-10-18 16:48:02)


Check out Musik - an easy-to-use text-to-music converter!
Join SpiderOak using this link and get an extra 1 GB free: https://spideroak.com/download/referral … 660e787ff1

Offline

#22 2011-10-18 21:11:57

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

Re: {SOLVED} Conky Weather Disaster

dubois wrote:

I love weather and weather apps!  Once I get some coffees in me I'll give it a try -- not like I can't look outside and see we're still in the worst or second worst drought since 1500 based on tree ring growthhmm  wink



EDIT -- No, that didn't work.  It just left a blank space in my conky like the other long version from the original source.  Xin loi.  sad

The code I posted did not work?

It works for me here, but I am going to attempt the weatherunderground.api (json) as a feed and see if I can get setup before the $68/month charges hit.

screenshote0172ccf5c3cfe76b03c0ce5e9e7d7fa.png


Congratulations, you've figured out the sound of one hand clapping...

Offline

#23 2011-10-18 21:32:27

dubois
The Old Codger
Registered: 2010-09-03
Posts: 2,238

Re: {SOLVED} Conky Weather Disaster

^ It may not be your fault so don't go off and do this for me.  It seems I don't get along too well with code.  If I find something that works I hang on to it, but if I cried foul! every time a bit of code didn't work for me... nm.

Offline

#24 2011-10-19 01:20:53

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

Re: {SOLVED} Conky Weather Disaster

dubois wrote:

^ It may not be your fault so don't go off and do this for me.  It seems I don't get along too well with code.  If I find something that works I hang on to it, but if I cried foul! every time a bit of code didn't work for me... nm.

LOL I take heart that Sector11 admits he is a user not a coder.

I need to rebuild my entire conky from May - but it works so I don't.   The only reason I am seeking alternative weather is the pending end of the keys for weather.com


Congratulations, you've figured out the sound of one hand clapping...

Offline

Be excellent to each other!

#25 2011-10-20 13:01:17

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 9,950
Website

Re: {SOLVED} Conky Weather Disaster

Coming to you direct from my summer home - the REAL conky weather commands:

d0fac4154885731.jpg

By real I mean the commands found in the conky variables.

On the left weather from NOAA - good for what's going on right now!

  • no future forecast.

  • no exec, execi or execpi commands

  • light on resources


The NOAA conky

# To use #! in a conky use: ${exec echo '#!'}
# killall conky && conky -c ~/conky/weather-NOAA &
# by Sector11

background no
border_inner_margin 10
border_width 0
default_color FFFFFF
default_outline_color black
default_shade_color black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
no_buffers yes

own_window yes
own_window_type override
own_window_transparent yes
#own_window_colour black
own_window_hints below,skip_taskbar,skip_pager
own_window_title conky-noaa
own_window_class conky-noaa

pad_percents 2
short_units yes
stippled_borders 0
top_name_width 5
uppercase no
use_spacer right
use_xft yes
xftalpha 1.0 #0.2
xftfont monospace:size=9
override_utf8_locale yes

gap_x 20 # left-right
gap_y 20 # up-down
text_buffer_size 6144 # 256 is minimum
update_interval 1
minimum_size 300 340
maximum_width 300
alignment tl


### IOAC codes for NOAA
### http://www.airlinecodes.co.uk/aptcodesearch.asp

### IATA-Code:    EZE
### ICAO-Code:    SAEZ
### FAA-Code:    
### Location:    Buenos Aires
### Airport:    Buenos Aires-Ezeiza International Airport
### Country:    Argentina

### IATA-Code:    AEP
### ICAO-Code:    SABE
### FAA-Code:    
### Location:    Buenos Aires
### Airport:    Buenos Aires-Jorge Newbery
### Country:    Argentina

### IATA-Code:    YXU
### ICAO-Code:    CYXU
### FAA-Code:    
### Location:    London
### Airport:    London
### Country:    Canada

lua_load ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg

TEXT
${alignc}NOAA
${alignc}Jorge Newbery
${alignc}${cpubar cpu2 1,100}

Temperature: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE temperature}°
  Currently: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE cloud_cover}
   Pressure: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE pressure}    Humidity: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE humidity}%
Wind: speed: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE wind_speed} - ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE wind_dir} or ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SABE wind_dir_DEG}°

${alignc}NOAA - Ezeiza
${alignc}${cpubar cpu2 1,100}
Temperature: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SAEZ temperature}°
  Currently: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SAEZ cloud_cover}
   Pressure: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SAEZ pressure}    Humidity: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SAEZ humidity}%
 Wind: speed: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SAEZ wind_speed} - ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SAEZ wind_dir} or ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ SAEZ wind_dir_DEG}°

${alignc}NOAA - London
${alignc}${cpubar cpu2 1,100}
Temperature: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ CYXU temperature}°
  Currently: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ CYXU cloud_cover}
   Pressure: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ CYXU pressure}    Humidity: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ CYXU humidity}%
 Wind: speed: ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ CYXU wind_speed} - ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ CYXU wind_dir} or ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ CYXU wind_dir_DEG}°
${alignc}${cpubar cpu2 1,300}
${alignc}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ CYXU last_update}

On the right WEATHER.COM - I'd wait a while to see if it's still good in November

  • today and a four day forecast.

  • no exec, execi or execpi commands

  • light on resources

  • I can't get the "icons" (images) to work, your mileage may vary

Starting: November 2011

  • the format IS changing, these commands "may" not work

  • looks like it will be a $63/month subscription

The WEATHER.COM  conky

# To use #! in a conky use: ${exec echo '#!'}
# killall conky && conky -c ~/conky/weather-WEATHER_COM &
# by Sector11

background no
border_inner_margin 10
border_width 0
default_color FFFFFF
default_outline_color black
default_shade_color black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
no_buffers yes

own_window yes
own_window_type override
own_window_transparent yes
#own_window_colour black
own_window_hints below,skip_taskbar,skip_pager
own_window_title conky-weather.com
own_window_class conky-weather.com

pad_percents 2
short_units yes
stippled_borders 0
top_name_width 5
uppercase no
use_spacer right
use_xft yes
xftalpha 1.0 #0.2
xftfont monospace:size=9
override_utf8_locale yes

gap_x 20 # left-right
gap_y 20 # up-down
text_buffer_size 6144 # 256 is minimum
update_interval 1
minimum_size 300 340
maximum_width 300
alignment tr


### Weather dot com
### ARBA0009  Buenos Aires, Argentina
### ARDF0127  Aeroparque Buenos Aires, Argentina
### http://xoap.weather.com/search/search?where=CITYNAME

lua_load ~/Conky/LUA/draw-bg.lua
lua_draw_hook_pre draw_bg

TEXT
   Forecast -  Jorge Newbery  WEATHER COM

${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 day}${goto 90}L: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 low}° H: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 hi}°
   Forecast: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 forecast}
Wind: Speed: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 wind_speed} - ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 wind_dir} or ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 wind_dir_DEG}°
   Humidity: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 humidity}%  Rain?: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 0 precipitation}%

${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 day}${goto 90}L: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 low}° H: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 hi}°
   Forecast: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 forecast}
Wind: Speed: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 wind_speed} - ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 wind_dir} or ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 wind_dir_DEG}°
   Humidity: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 humidity}%  Rain?: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 1 precipitation}%

${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 day}${goto 90}L: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 low}° H: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 hi}°
   Forecast: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 forecast}
Wind: Speed: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 wind_speed} - ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 wind_dir} or ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 wind_dir_DEG}°
   Humidity: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 humidity}%  Rain?: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 2 precipitation}%

${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 day}${goto 90}L: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 low}° H: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 hi}°
   Forecast: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 forecast}
Wind: Speed: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 wind_speed} - ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 wind_dir} or ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 wind_dir_DEG}°
   Humidity: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 humidity}%  Rain?: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 3 precipitation}%

${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 day}${goto 90}L: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 low}° H: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 hi}°
   Forecast: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 forecast}
Wind: Speed: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 wind_speed} - ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 wind_dir} or ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 wind_dir_DEG}°
   Humidity: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 humidity}%  Rain?: ${weather_forecast http://xoap.weather.com/weather/local/ ARBA0009 4 precipitation}%

 Update: ${weather http://xoap.weather.com/weather/local/ ARBA0009 last_update}

I GOTTA try out some of the scripts found here!

Last edited by Sector11 (2011-10-20 13:04:19)

Online

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