You are not logged in.
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 directoryAlso, 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
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.
"'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
^ That script from the Arch Forums is brilliant. 
EDIT -- left a word out of the sentence
Last edited by dubois (2011-10-15 16:15:33)
Offline
^ That script from the Arch Forums brilliant.
I thought so
, only weather script i could ever get working 
"'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
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.
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Online
Offline
Well, looks like Texas still has the old directory structure. Weird. In NC, this was broken sometime around March last year.
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Online
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.
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 directoryI 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
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
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
...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#p567663Offline
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
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
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
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
^ 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. 
Offline
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
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
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 growth.

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. 
Last edited by dubois (2011-10-18 13:46:52)
Offline
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.
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Online
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 $WEATHERConditions:
#!/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... 
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
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 growth.
![]()
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.
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.
Congratulations, you've figured out the sound of one hand clapping...
Offline
^ 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
^ 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
Coming to you direct from my summer home - the REAL conky weather commands:
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)
#! Etiquette | Conky PitStop | Interactive LUA
Weather v9000 | Teo x4 Sites | Arclance | Finnish
I'm comin' Home
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.