SEARCH

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

You are not logged in.

#1 2012-08-01 18:12:32

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

arclances conky weather script - v6.2.1

arclances weather script v6.2.1

Here is my conky weather script which uses a lua script for display in conky.

It features buttons that change what data is displayed.

There is a daily forecast view which by default shows data for Today and the next four days.
conkyWeather_arclance_v6.1_2012-09-03_Screenshot_Default_resized_0.67_bicubic.png
There is a button on the right that switches between showing the forecast for the next 4 days and the forecast for the four days after that.
conkyWeather_arclance_v6.1_2012-09-03_Screenshot_Default_Page2_resized_0.67_bicubic.png
If your location does not have forecast data for some of those days nothing will be displayed for them.
There is an option to show the current floodstage of a river in this view using data from NOAA.

There is also a hourly forecast view which by default shows data for the 8 hours.
conkyWeather_arclance_v6.1_2012-09-03_Screenshot_Hourly_Page1_resized_0.67_bicubic.png
There is a button on the right the advances through the data for the next 36 hours 8 hours at at time.
conkyWeather_arclance_v6.1_2012-09-03_Screenshot_Hourly_Page5_resized_0.67_bicubic.png
Statistics about todays weather is displayed along the bottom of the hourly view.

The full text of weather alerts scrolls across the top of the text area in both of these display modes.
Watch the movie to see what the scrolling alert looks like.

Animated radar and satellite maps are part of the weather display in all modes.
There is a button on the right that changes to a view with larger radar and satellite images.
conkyWeather_arclance_v6.1_2012-09-03_Screenshot_LGIMG_Normal_resized_0.67_bicubic.png
If you use the NOAA floodstage option a graph of past and predicted floodstage levels is displayed in this mode.

By clicking on the radar or satellite image you can toggle between a local and wide area view.
conkyWeather_arclance_v6.1_2012-09-03_Screenshot_Default_Wide_RadSat_resized_0.67_bicubic.png
conkyWeather_arclance_v6.1_2012-09-03_Screenshot_LGIMG_Wide_resized_0.67_bicubic.png

---> Here is a movie that shows what the animated features look like and what the buttons do here. <---

Most of the weather data is from the Wundergound API but some data is available from Intellicast and NOAA as well.
The interactive elements are based on mrpeachys interactive conky code.

------> You can download the current version of the code here, images are included. <------

I have written setup instructions for the script, they are in the readme file in the archive.

Please report any problems you have or bugs you find in this thread.

Last edited by arclance (2012-09-27 02:45:32)

Offline

Help fund CrunchBang, donate to the project!

#2 2012-08-01 18:13:34

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

Changelog
v6.2.1 - 2012-09-26
    Readme
        Fix accidentally removed installDirectory setup instructions for Lua Script. (Thanks AndyOpie150)
        Add names of required packages in Ubuntu.
        Update Wunderground API location string instructions.
            The old API documentation page for this is gone.
            I improved what I had about selecting the location string in this guide already.
            A full guide needs to be written later.
        Improve directions for setting latitude and longitude for the radar and satellite images.
            Added instructions that this value should be only a number.
            More complete directions for how to find these values should be written in the future.
       
    Lua Script
        Fix installDirectory variable altered by a pervious update.
        Add more terminal debugging output.
            Added version information to startup debug output.
            Added installDirectory information to startup debug output.
       
    Python Script
        Add more terminal debugging output.
            Added version information to startup debug output.
            Added installLocation information to startup debug output.
            Added check for radarWU_API_LAT and radarWU_API_LON not being numbers (catch non-number characters).

v6.2 - 2012-09-16
    Lua Script
        Now have the 10 day forecast data but it does not always have 10 days of data.
            The script will show all that there are, up to 9 days.
        Update button script to work with more window managers.
            "xdotool search --sync --classname conky behave %@ mouse-click getmouselocation" returns different Window ID's with some window managers, the button code now checks for both of the know possibilities.
            This should have been in v6.0 but I forgot to add it.
        Fix some mistakenly global variables.
        Fix undeclared global variables.
        Remove unnecessary variable firstBackup from the line2_UpdateMonitor() function.
   
    Python Script
        Get data collection start time at the right place in the code.
            Fixes following user specified update interval (was running long).
        Get 10 day forecast instead of 7 day forecast.
        Use https for WU API.

v6.1 - 2012-09-03
    Add button to switch to radar and satellite images of a larger geographic area.
    In the daily forecast section show as many days as there is forecast data for up to nine days.
        This was needed because the 10 day forecast data does not always cover 10 days of data.
    Improve stability of url opener (added catcher for socket.error)
    Fix detection of satellite image connection failure.

v6.0 - 2012-08-13
    Initial Release
    Include Weather Images and Moon Images in download.

This only shows the changes since the first release of the lua version of this script.
The full changelog is available in the readme file.

Last edited by arclance (2012-09-27 03:10:03)

Offline

#3 2012-08-01 18:15:12

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

Reserved For Updates/Instructions

Offline

#4 2012-08-13 21:38:47

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

I have finished the readme for the script and uploaded the first full release.
You can find the download in the first post.
Please read the readme for setup instructions.

I will update the images and movie the next time I get a weather alert so you can see what the scrolling alerts look like.

Last edited by arclance (2012-08-13 21:39:21)

Offline

#5 2012-08-13 22:30:32

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: arclances conky weather script - v6.2.1

This is incredible work arclance, well done! cool

Added to Quick References


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#7 2012-09-05 01:12:18

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

New Version Released
v6.1 - 2012-09-03
    Add button to switch to radar and satellite images of a larger geographic area.
    In the daily forecast section show as many days as there is forecast data for up to nine days.
        This was needed because the 10 day forecast data does not always cover 10 days of data.
    Improve stability of url opener (added catcher for socket.error)
    Fix detection of satellite image connection failure.

The first post has been updated to show the better represent the scripts features.
The movie has been updated to show a scrolling weather alert along with the changes in this update.

Offline

#8 2012-09-13 15:12:37

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: arclances conky weather script - v6.2.1

Been working on it all morning.  Have only been able to get a transparent window along the bottom of my screen that has nothing in it.  I can barely see the borders of it.  I give up, any idea what I'm doing wrong?  Probably something simple.  Haven't been in bed since I got up yesterday morning...

Jed

jed@XPS-15z:~$ python /home/jed/conkyWeather_arclance_v6.0_release_2012-08-13/conkyWeather_arclance_v6.0.py
using cPickle
no pull yet

timeDifference = 1347548701.66
pulling data
geolookup/conditions/forecast7day/hourly/astronomy/alerts/history_20120913
Pulling -- WU Data -- Location = http://www.wunderground.com/cgi-bin/findweather/getForecast?query=04769
Pulling -- Intellicast Data
Traceback (most recent call last):
  File "/home/jed/conkyWeather_arclance_v6.0_release_2012-08-13/conkyWeather_arclance_v6.0.py", line 906, in <module>
    conkyWeather()
  File "/home/jed/conkyWeather_arclance_v6.0_release_2012-08-13/conkyWeather_arclance_v6.0.py", line 285, in conkyWeather
    intellicastData = intellicastForecast(webData)
  File "/home/jed/conkyWeather_arclance_v6.0_release_2012-08-13/conkyWeather_arclance_v6.0.py", line 749, in intellicastForecast
    return [day0,day1,day2,day3,day4,day5,day6,day7,day8,day9]
NameError: name 'day0' is not defined
jed@XPS-15z:~$ conky -c /home/jed/conkyWeather_arclance_v6.0_release_2012-08-13/conkyrc_conkyWeather_arclance
Conky: llua_load: ...6.0_release_2012-08-13/lua/conkyWeather_arclance.lua:161: attempt to index local 'f' (a nil value)
Conky: desktop window (1000095) is subwindow of root window (b8)
Conky: window type - normal
Conky: drawing to created window (0x3c00001)
Conky: drawing to double buffer
Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_start_xdotool execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
Conky: llua_do_call: function conky_main execution failed: attempt to call a nil value

Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#9 2012-09-13 15:36:38

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

The python script is failing to parse the Intellicast page and it crashes.
Since it crashes it can't prepare the data that is read by the lua script so conky will show nothing.

You appear to have setup the Python script incorrectly.
This line, which is for debugging, should not have a url in it.

Pulling -- WU Data -- Location = http://www.wunderground.com/cgi-bin/findweather/getForecast?query=04769

This is because you have set the location string incorrectly here.

location = "Your Location Setting Here" # string specifying location to pull weather data for

It should be something short like your zip code or local airport callsign.

This is not the cause of the Intellicast parse crash however it is possible you also set this up wrong.
Could you PM me the script as you have it setup now so I can look at it?

Last edited by arclance (2012-09-13 16:55:48)

Offline

#10 2012-09-14 05:30:30

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: arclances conky weather script - v6.2.1

@arclance, your truly a genius!!!  The mistakes were all mine, from a bad api key, to having the wrong version number typed in the python script.  Many thanks for all you help.
Below is my screeenshot with my multiple conky's going.  Everything starts at startup with the use of a couple of scripts running in the Startup Applications.  One is a delay script, the other starts the three conky's you see running!  I'll do some more work on the one on the right to get the colors just right, but I'm happy for now.  Been scratchin' conky for 2 days straight, no sleep!  Time for a break!

Again, many thanks to "arclance" who has been helping me most of the day.  A real scripting god!!!

Jed

PunBB bbcode test


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#11 2012-09-14 05:36:15

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: arclances conky weather script - v6.2.1

^ That is awesome!  Nice work jed and arclance!  cool


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#12 2012-09-14 06:13:53

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: arclances conky weather script - v6.2.1

Thank-you vastone!  It's amazing what one can achieve with a lot of 'cut-and-paste'!  All the credit is definitely arclances.  His work entirely.  The other two on the left and right are truly cut and past jobs while experimenting with conky.  Accidental learning!  You gotta love it...

Jed


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#13 2012-09-14 06:17:22

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: arclances conky weather script - v6.2.1

As a matter of fact, I'll just go ahead and ask now.  The conky on the right, what would be the simplest code to cut and paste into the existing file in order to easily change the font colors?
Just kidding.  Here it is with the colors "maybe" finished.
Jed
arclanceawesomeweather.jpg

Last edited by jed (2012-09-14 07:10:06)


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#14 2012-09-14 07:15:15

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: arclances conky weather script - v6.2.1

Now all I really need is an interactive scrolling news reader/rss conky for the top. Something that looks like the ticker at the bottom of the newscasts on FoxNews or CNN...

Jed


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#15 2012-09-16 03:42:59

jed
#! CrunchBanger
From: Detachment 7
Registered: 2012-08-28
Posts: 200
Website

Re: arclances conky weather script - v6.2.1

Ok, so I decided I liked Vin's (vinDSL) conky for sysinfo stuff better than the one I was using  in the previous screenshot.  This is the new one.  One question, I can see the outline of the conky on the right side of the screen, while on the left the Tao conky is completely transparent;  How can I make the one on the right the same way if possible?

Thanks,
Jed

multiconky.jpg


Proud user of VSDIO: Jedi!  You can download it from here...  I'm on  the web at NixNut.com!

Offline

#16 2012-09-16 19:21:57

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

I think that the problem with the VinDSL conky is its background shading method.
I am not very familiar with that conky you would probably get faster help by asking in the general conky thread.

Offline

#17 2012-09-16 20:56:15

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

New Version Released
v6.2 - 2012-09-16
    Lua Script
        Now have the 10 day forecast data but it does not always have 10 days of data.
            The script will show all that there are, up to 9 days.
        Update button script to work with more window managers.
            "xdotool search --sync --classname conky behave %@ mouse-click getmouselocation" returns different Window ID's with some window managers, the button code now checks for both of the know possibilities.
            This should have been in v6.0 but I forgot to add it.
        Fix some mistakenly global variables.
        Fix undeclared global variables.
        Remove unnecessary variable firstBackup from the line2_UpdateMonitor() function.
   
    Python Script
        Get data collection start time at the right place in the code.
            Fixes following user specified update interval (was running long).
        Get 10 day forecast instead of 7 day forecast.
        Use https for WU API.

Please update to this version both the Lua and Python script have important updates.
I will not provide support for Lua script button related issues if you are using a earlier version the Lua script.

Last edited by arclance (2012-09-16 20:57:04)

Offline

#18 2012-09-20 19:17:23

Lateralus138
Member
From: Decatur, Il.
Registered: 2012-09-19
Posts: 41
Website

Re: arclances conky weather script - v6.2.1

Hi thanx for this by the way... anyway I am having trouble understanding what to put in for steps 4a and 4b. I have went to the link that says Documented here and I am not sure what I am looking for.


...to swing on the spiral of ...our divinity and ...still be a human.

Offline

#19 2012-09-20 21:11:46

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

^ Okay that link is not good anymore they changed the documentation page a lot.
It used to be one big page.
I have not found where the location stuff is in the new documentation page yet.

If you live in the US you can run the script once with your zip code like this

location = "ZIP CODE"

and the json file you get will contain a list of airports and personal weather stations nearby that you can use.
You can see the json data by opening the file "wuAPI_json_current_log.txt" found in the log folder with a text editor.
The location of other weather sources is found in the "location" section of that file.

If you don't live in the US I will need some time to write a guide on finding the location string.
You can get it from the weather underground website but it is hard to find if you don't know where to look.
It is my moms birthday so I don't have time to do that tonight.

Offline

#20 2012-09-24 02:15:01

Lateralus138
Member
From: Decatur, Il.
Registered: 2012-09-19
Posts: 41
Website

Re: arclances conky weather script - v6.2.1

Ok I tried what you said anf followed the rest of the directions and when I run the pythin for the first time I get this

ian@Hell:~/Downloads/conkyWeather_arclance_v6.2_2012-09-16$ python conkyWeather_arclance_v6.2.py 
using cPickle
no pull yet
Traceback (most recent call last):
  File "conkyWeather_arclance_v6.2.py", line 987, in <module>
    conkyWeather()
  File "conkyWeather_arclance_v6.2.py", line 233, in conkyWeather
    lastPullBackup = open(logDirectory + "/lastPullBackup.txt", "r") # file for keeping local copy of weather information incase of program/internet errors and to keep track of lastPull if the program is stopped
IOError: [Errno 2] No such file or directory: '/home/ian/Downloads/conkyWeather_arclance_v6.1_2012-09-16/log/lastPullBackup.txt'

but the file definately exists in that location and all permissions are set on every file there.


...to swing on the spiral of ...our divinity and ...still be a human.

Offline

#21 2012-09-24 02:48:04

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

^ Yikes that is a really hard error to debug over the Internet.
Could you zip up the whole folder for the script and upload it somewhere so I can look at it?
I need to look at the log files generated by the python script to see what the problem is.

Offline

#22 2012-09-24 04:06:25

Lateralus138
Member
From: Decatur, Il.
Registered: 2012-09-19
Posts: 41
Website

Re: arclances conky weather script - v6.2.1

arclance wrote:

^ Yikes that is a really hard error to debug over the Internet.
Could you zip up the whole folder for the script and upload it somewhere so I can look at it?
I need to look at the log files generated by the python script to see what the problem is.

This is my folder zipped up:
https://www.box.com/s/ia8p9z9m5f3zlkoohjdh


...to swing on the spiral of ...our divinity and ...still be a human.

Offline

#23 2012-09-24 20:34:34

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

Lateralus138 wrote:
arclance wrote:

^ Yikes that is a really hard error to debug over the Internet.
Could you zip up the whole folder for the script and upload it somewhere so I can look at it?
I need to look at the log files generated by the python script to see what the problem is.

This is my folder zipped up:
https://www.box.com/s/ia8p9z9m5f3zlkoohjdh

Okay it looks like it was a typo in script from when I was updating the version.
In the python file this line

installLocation = "/home/ian/Downloads" + "/conkyWeather_arclance_v6.1_2012-09-16" # location of the conkyWeather_arclance_v6.1.py file

should be

installLocation = "/home/ian/Downloads" + "/conkyWeather_arclance_v6.2_2012-09-16" # location of the conkyWeather_arclance_v6.2.py file

Offline

#24 2012-09-24 21:46:21

Lateralus138
Member
From: Decatur, Il.
Registered: 2012-09-19
Posts: 41
Website

Re: arclances conky weather script - v6.2.1

Okay thanx and yes that resolved the first issue, but now I run the py file and it seems to hang at

Next Update At: 2012-09-24 | 04:56:05 PM CDT

should I wait a while or should it not hang there? Sorry for the million questions, but I'd liek to see this work, it looks very useful.

Last edited by Lateralus138 (2012-09-24 21:47:09)


...to swing on the spiral of ...our divinity and ...still be a human.

Offline

Help fund CrunchBang, donate to the project!

#25 2012-09-24 21:54:23

arclance
#! Die Hard
Registered: 2012-03-29
Posts: 987

Re: arclances conky weather script - v6.2.1

Lateralus138 wrote:

Okay thanx and yes that resolved the first issue, but now I run the py file and it seems to hang at

Next Update At: 2012-09-24 | 04:56:05 PM CDT

should I wait a while or should it not hang there? Sorry for the million questions, but I'd liek to see this work, it looks very useful.

That is normal, it means it is working correctly.
What is happening is that the script is waiting until it is time to update the weather data.
At that time it will wakeup, update the information, and go back to sleep again.
This allows the script to alway update at the correct interval even if you kill and restart the script.

Offline

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.
Server: acrobat

Debian Logo