This is fantastic! I wasted hours of my life yesterday trying to figure out the weather image. Once I figure this out it worked perfectly. I'm wondering if there's any way to add the barometric pressure to the current conditions??? I tried looking at the code, but couldn't understand any of it. :) Thanks for this script!
Then I get the following return:
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]
It's looking for the base file in this folder:
/Users/nickthomas/Documents/Geektools/WeatherIcons/weatherparser.rb forecast/unknown.png
Which obviously doesn't exist. What do you have the $basedir setting configured as?
Don't know what you mean. I just installed Ruby and then downloaded your zip file. I opened the .glet files and changed the path of each shell. I also changed the zip code to my city in the script.
<ol>
<li>There's a variable at the top (near the zip code) where you tell it what directory to look for your icons in.</li>
<li>What do you mean by "installed ruby?" Ruby comes with OS X by default, you shouldn't have to install anything unless you're upgrading, in which case you should use a tool like rvm
or rbenv
...</li>
</ol>
load more (2 remarks)
I'm having the same problem as above! Everything works except for the current weather. When I run this command: /Users/nickthomas/Documents/Geektools/WeatherIcons/weatherparser.rb
I get this:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ftools.rb:59:in stat': No such file or directory - /Users/nickthomas/Documents/Geektools/WeatherIcons/weatherparser.rb forecast/unknown.png (Errno::ENOENT)
syscopy'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ftools.rb:59:in
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ftools.rb:89:in copy'
set_icon'
from /Users/nickthomas/Documents/Geektools/WeatherIcons/weatherparser.rb:52:in
from /Users/nickthomas/Documents/Geektools/WeatherIcons/weatherparser.rb:41:in `current'
from /Users/nickthomas/Documents/Geektools/WeatherIcons/weatherparser.rb:90
When I add "forecast" or "time", everything is just fine!
The icon doesn't seem to change depending on the weather or time. Just stays as weathericon.png
Tried playing with different file path formats ( ~ vs /Users etc) in both the geeklet path and .rb config path, played with adding "cloudy" as mentioned in the post to force the image to change, but I get nothing. Just stays the same.
Any idea what I'm doing wrong?
Not sure what I'm doing wrong. It's basically stuck on cloudy though it is not cloudy according to the real weather or wunderground.com. Is there a need to have another shell running the weatherparser.rb? Very confused. Also this: http://imgur.com/6n9DW
This is great! I have loved using this, one issue though is the pictures just rotate through and don't match the forecast as @Chi Vu has commented about. Here is a screenshot of me using it. :) I would appreciate why the image is not working. http://www.flickr.com/photo...
@Chi Vu and @Domenica, what countries are you in? The API may be returning strings that aren't recognized by the hardcoded presets in the file. Let me know, I have a localizable version that might help.
I realized that it was working, but it had no corresponding picture for partly cloudy during the nighttime, therefore it reverted to the daytime picture for the specific forecast, making me think the icons don't work. @Domenica, one thing that helped me when I was configuring the icon however, is to make sure that your image geeklet url ends ".png" instead of the WeatherIcon folder that contains all the icons. For example mine is:
file://localhost/Users/username/Documents/Geeklets/WeatherIcons/weathericon.png
When I set it as "file://localhost/Users/username/Documents/Geeklets/WeatherIcons", it just rotated through the list. Hope this helps!
This is by far the best weather geeklet I've come across. I've managed to configure the current weather condition via the comments, but for some reason, the icon doesn't match up to the forecast. Instead, it just rotates through the different pictures based on the intervals I set. Is this because of my image geeklet or is it due to the ruby coding? Any ideas would be appreciated!!
I am also having problems with the 'current' command. Below please find the output when running the command from terminal:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ftools.rb:59:in stat': No such file or directory - /Users/username/Users/username/Documents/Geeklets/WeatherIcons/unknown.png (Errno::ENOENT)
syscopy'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ftools.rb:59:in
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/ftools.rb:89:in copy'
set_icon'
from weatherparser.rb:52:in
from weatherparser.rb:41:in `current'
from weatherparser.rb:84
I got it working, here's what needed to be done on my Lion 10.7.2 system.
The Ruby script I was using had the full path, I shortened it to '~/Documents/Geeklets/WeatherIcons' and the Geeklet commands were modified to this: ruby Users/username/Documents/Geeklets/WeatherIcons/weatherparser.rb time/current/forecast. I hope this helps anyone else having issues getting the current conditions to display.
Everything works great for me except the current as well. My full path is "/Users/holscherct/Documents/geektool/weather/weatherparser.rb current". The forecast and icons work but the current does not and I don't know why. Any suggestions?
Running Lion 10.7.2 and Geektool from MAS downloaded today.
I have gotten everything to work except for the current geeklet, my command is set to "/Users/WeatherIcons/weatherparser.rb current" I have my WeatherIcons folder directly in my users folder. I used the same command except instead of current, I have either forecast or time for the other two geeklets and they work perfectly. Any help would be greatly appreciated.
I added the following location code to call instead of hardcoding mycity (mycity = location). It converts your IP address to the city of your IP host. It's close enough for the weather. Now when I travel I always get local weather.
def location
response = Net::HTTP.get_response(URI.parse(URI.escape("http://api.hostip.info/get_xml.php?")))
doc = REXML::Document.new(response.body)
features = doc.root.elements[4]
hostip = features.elements[1]
city = hostip.elements[2].text
return city
end
This is a great idea/feature. Do I need to change anything or is it enough to paste the code at the bottom of the document (that's what I did).
It sound like I have to replace the hardcoded mycity variable. I tried to replace it with your code exchange 'city' for 'mycity'. Since this didn't work I just put your snippet at the bottom. By now you can tell that I got no clue of ruby and so, if you find the time to help me out on this one I'd be very thankful.
I'm having an issue getting this to work. I enter in the path to the specific folder like this: /Users/***********/WeatherIcons/ with the last part being the specific command in each shell and I get the failure icon on all 3. Any Idea as to what I am doing wrong?
Here are the pics. Adding/removing geektool on the menu bar did nothing though.
That's really odd. Do you have the individual geeklets set to "always on top" or anything like that?
Everything's on 'Set locale environment', however when I check 'keep on top', Mission Control won't show any of my Geeklets but it would always be on top of everything whenever I'm not on M.ctrl, ultimately disrupting whatever I'm doing.
load more (1 remarks)
The icons don't seem to display correctly according to time of day. I haven't really ever messed with Ruby, but I see that you have it set from 19:00 to 08:00 to show the "nighttime_icons" version of the icons. This doesn't seem to work quite right. Do I have to set a timezone some where in the weatherparser.rb file? I have my zipcode set already.
Do the nighttime icons show up at all? Mine sometimes need a kickstart (manual refresh) before they start updating. If that's not the case and you think something is up with timezones, run this at the command line:
ruby -e 'puts Time.now'
That will show you what time your default Ruby install thinks it is… some adjustments may be necessary to the script from there.
The one that seems to provide an issue is the nighttime partly cloudy. I corrected the times to account for daylight time here (thanks DST!), but still get a sun when it's "partly cloudy" out. What could I add to the parser file to fix this? I added the 'partlycloudy' line to the nighttime_icons = line and created a new png file to accommodate for the nt_partlycloudy call, to no result. I hope this makes sense. I'm a super noob to Ruby.
Thanks!
My desktop icons seem to go under my geeklets, how can bring them to be over the geeklets...is that possible?
Not sure, I've never had that problem. Is it above your icons but below your windows? There's an "always on top" setting, so check that, but otherwise I wonder whether you're running PathFinder's desktop or anything else that would be masking the original desktop layer?
how do I find out if I'm running PathFinder's desktop?
I'm using this look, the beach scene, http://desktopspotting.com/...
the bottom part of the sand and the clock and date, everything, is somehow going above my desktop icons...any icons that are where that sand is, are behind the sand so I cant see them...
how do I find out if I'm running PathFinder's desktop?
I'm using this look http://desktopspotting.com/...
the bottom part of the sand and the clock and date, everything, is somehow going above my desktop icons...any icons that are where that sand is, are behind the sand so I cant see them...
I love this. I'm quite glad to stop using the different menu bar apps for the weather. With this, I can get current and forecast weather right on my desktop in an nice format.
Do you have a recommendation for a fog icon? I just ran across fog and the parser pulled the unknown icon. Cloudy kind of works, but isn't quite right.
Is there a way for the calls to Weather Underground to use the system proxy settings? My laptop moves between work and home and while at work I'm behind a proxy. I'm sure I could modify the calls to use a proxy but a more elegant solution would be for it to just look at the system proxy settings and thus use a proxy if one's configured.
Thanks!
I created a site a while back that makes grabbing weather info for GeekTool really easy. It's gtwthr.com. It performs basically the same task as your script, but runs remotely. You would simply create a shell script geeklet and set the command to curl a url. The url consists of the location id and the data element you want. It also works with icons.
Y'know, Brett, keeping up with you is becoming a pain in the ass. I decided to use NerdTool rather than GeekTool on the strength of this post of yours from back in February. NerdTool just became Lion compatible a couple of weeks ago, and now I'm wondering if I should switch back to GeekTool.
Seriously, I'd like to hear what you see as the strengths and weaknesses of GT and NT and why you've chosen one over the other.
I haven't done an honest comparison between NT and GT since the Lion upgrade. I grabbed GeekTool to see what was up in the new version, but these geeklets were written for NerdTool originally. Now that GeekTool supports ANSI colors and does a decent job of font smoothing, the only valid comparison (in my eyes) would be memory footprint, which seems negligible in both cases.
I grabbed the Lion build of NerdTool, too, but haven't even loaded it up yet. I'd been going Nerd/GeekTool free since Lion for various reasons. Reasons I have realized are less important than having nerd fun. I'd be curious to hear any comparisons you have, though.