22

GeekWeather2

Posted in Weather by alexwasserman 298 days ago

A new script, using the ForeCast.io embed URL - http://blog.forecast.io/forecast-embeds/

Pass in your coordinates from http://itouchmap.com/latlong.html, the name you want and whether you want it LIGHT or DARK.

So, create a script geeklet to run something like this, depending on where you store the script:

/Users/myuser/Documents/GeekWeather2/geekWeather2.sh 40.410259 -74.035055 "Atlantic Highlands" LIGHT

This will then run the script, and create the image.

Then, create an image one pointing to:

/Users/myuser/Documents/GeekWeather2/weather.png

Updated: https://github.com/alexwasserman/GeekWeather2

Or, use this one by djparadyme, which is pretty neat, and has more options:

http://www.macosxtips.co.uk/geeklets/weather/forecast-io-weather


Geeklet files to download

Comments

User Avatar
bselman 295 days ago
Awesome glet! I haven't been able to get this to work. I've downloaded the homebrew and xcode products, everything is installed and updated, created the script and image in geektool using the same paths as yours with my username, yet nothing is happening/refreshing... I know I'm missing something...
User Avatar
bselman 295 days ago
Nevermind....I forgot the FILE in my image command! DUH!
User Avatar
alexwasserman 290 days ago
Great to hear it works.
User Avatar
DonMoeMU 223 days ago
Does your Image URL: look like this

file://localhost/Users/username/Desktop/GeekWeather2/
User Avatar
shaolex 287 days ago
First of all, I love this weather Geeklet and thank you! My question is if there is any way to modify the color of the image output? I'm using the LIGHT skin but I would like it to be a little lighter/brighter color of gray (more white) so that it stands out a little more against my desktop.
User Avatar
alexwasserman 287 days ago
Yes, you can do some post processing with an additional convert step.

You'd need to edit the existing 'convert' line to output to a temporary image, so change weather.png to temp.png.

Then, add something like in the next line:

convert -fill white -fuzz 30% -opaque '#888' /tmp/temp.png /tmp/weather.png

That will match the existing grey (#888) with a 30% fuzzy match to include any aliasing, and will turn it to dark grey. You can adjust the -fill parameter to whatever color you want. Names are here: http://en.wikipedia.org/wiki/X11_color_names . You can also use # values.

So, you'll get something like this:

convert -density 200 -fuzz 25% -transparent white $LIGHT pdf:/tmp/weather.pdf png:/tmp/temp.png

convert -fill maroon -fuzz 30% -opaque '#888' /tmp/temp.png /tmp/weather.png
User Avatar
bluespider 281 days ago
Great work!!!! is it possible to

1. make the animation work for the image?

2. get the RightNow info too?
User Avatar
alexwasserman 278 days ago
Bluespider,

1. The website is created using HTML5, so there's no GIF or anything to save. The script converts the page to a PDF then to a PNG for display.

As far as I know GeekTool doesn't have the ability to display animated images, and I know it won't handle the HTML straight out, hence the conversion.

2. You can pull the RightNow using the GeekWeather script I wrote before, it's more customizable, but requires a dev account. This just pulls the standard information from the Forecast.io public embed.
User Avatar
bluespider 277 days ago
awesome! Thanks for the response Alex, very much appreciated! Again, nice work!
User Avatar
technogorilla 272 days ago
I am looking forward to giving this geeklet a try -- it looks really nice. Any chance you can post a really simple set of instructions for us non-programmer GeekTools users?
User Avatar
LostInInaka 253 days ago
Any chance for this awesome script to be updated to output Celsius? (or sharing the source code for the app that does all the work?)
User Avatar
Leon 253 days ago
Optional parameters explained here: http://blog.forecast.io/forecast-embeds/

Just edit the line in "geekWeather2.sh"
User Avatar
technogorilla 245 days ago
I'm clearly missing something... and fully prepared for a "well, duh" moment.

Could it have something to do with the following error when installing homebrew:

`Error: Homebrew doesn't know what compiler versions ship with your version

of Xcode (dunno).`
User Avatar
YKargon 243 days ago
I have the same problem. When I open up the image Geeklet, it just shows the default Monmouth, NJ picture.
User Avatar
technogorilla 242 days ago
Thanks YKargon, I was beginning to think I was either too old or too dumb to figure this out. I remembered something about Xcode not being part of Mountain Lion, so I went looking... you can download [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12#) for free from the app store -- be aware, it's a big download, 1.65GB.

I'm downloading now and will follow up when I try this again.
User Avatar
YKargon 241 days ago
Please follow up, that would be great. I had heard something about XCode not being part of mountain lion, and I thought I downloaded a replacement recommended by Apple, but IDK how that works, maybe I was wrong.
User Avatar
technogorilla 241 days ago
Well... I was part right. With Xcode installed the homebrew installed correctly and so did the GhostScript and ImageMagick apps. Unfortunately, it didn't seem to change anything for me.

I invoke the name of alexwasserman for some guidance.
User Avatar
skonesam 229 days ago
Registered just to give this an up vote. Perfect!
User Avatar
bgibson72 195 days ago
ok, I seem to be having the same issues with GeekWeather2 that YKargon and technogorilla are both having.

I'm supposed to paste the text from the .sh file into the command field for a geeklet shell, correct? or do I just use the "/Users/myuser/Documents/GeekWeather2/geekWeather2.sh 40.410259 -74.035055 "Atlantic Highlands" LIGHT" in that field per the directions.

And why would you use the weather.png image when it's just a static image for weather in New Jersey?

Please help as I'm close to getting this but it's frustrating!
User Avatar
alexwasserman 186 days ago
bgibson72 -

Just use the short command the arguments to it:

This is my example:

/Users/myuser/Documents/GeekWeather2/geekWeather2.sh 40.410259 -74.035055 "Atlantic Highlands" LIGHT"

Basically, it's the script, then your coordinates, your location name, and whether you want it light or dark.

The weather.png is a link to the picture and will be recreated each time the script runs. It comes with my weather, because that's how it was when I zipped it up. It'll get overwritten.

- Alex
User Avatar
apitlekays 131 days ago
Hi Alex,

Need a little help here. I'm on Mavericks, and has been trying to make this awesome little glet to work, but so far i've failed.

I've followed every step.

I used this for the shell script:

/Users/hafizhanif/Documents/GeekWeather2/geekWeather2.sh 52.406822 -1.519693 "Coventry" LIGHT

And this for the image:

/Users/hafizhanif/Documents/GeekWeather2/weather.png

But currently nothing is in display. Did i missed something?
User Avatar
marktenney2 64 days ago
I'm missing something as well. Am I supposed to edit the shell script file or just leave it as is and add the arguments in my shell geek let?

I've installed the apps via Homebrew, but not Xcode. Do I need Xcode as well?

Homebrew couldn't install wkhtmltoimage but it was able to install wkhtmltopdf. Should that work?

Sorry, I'm really new to all this... :)
User Avatar
roadglide03 60 days ago
Its part of that package go to /usr/local/bin and it should be there I just installed it and it showed up. Here is the real path in case the link did not get created for you:

wkhtmltoimage -> ../Cellar/wkhtmltopdf/0.11.0_rc1/bin/wkhtmltoimage
User Avatar
bgibson72 53 days ago
Ok, I've gotten a little further this time, but all the output says for the script now is "converting to image". I ran the geekweather2.sh file manually in terminal and it runs but I don't see anything being output to the Documents/GeekWeather2/ folder. A YouTube video would be really nice...
User Avatar
djparadyme 53 days ago
I could never get this to work. So I created my own, using phantomjs instead of wkhtmltopdf. It seems to be much faster, and I could actually get it to work.

http://www.macosxtips.co.uk/geeklets/weather/forecast-io-weather

It looks like for whatever reason, that url is going to the Geekweather2 geeklet, so here is a link to the github repo:

https://github.com/nickroberts/geektool-forecast.io-weather

I'm not sure why I can't get these to show up as links...oh well.
User Avatar
rjman 35 days ago
Hi, I seem to be stuck at your "clone the repo into a directory step"

This is the error on terminal:

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

Could you help me configure what to do next?

Thanks
User Avatar
djparadyme 27 days ago
You should be able to clone the repo, as it's a public one on github.

You might need to use https, though.

Maybe try this:

git clone https://github.com/nickroberts/geektool-forecast.io-weather.git yourdirectory
User Avatar
djparadyme 27 days ago
You can also just download the zip from github, as well:

https://github.com/nickroberts/geektool-forecast.io-weather/archive/master.zip
User Avatar
rjman 21 days ago
Thanks. I don't know why it's not working. I made the shell with the script and the image with the url.

When is the weather.png supposed to be created?
User Avatar
beaks 51 days ago
#### For those having issues with the packages from Homebrew

#### update homebrew

cd /usr/local

git fetch origin

git reset --hard origin/master

#### update wkhtmltoimage

wkhtmltoimage is now part of wkhtmltopdf. If the wkhtmltopdf homebrew install doesn't work try this:

cd /usr/local/Library/Formula/

git checkout 6e2d550 /usr/local/Library/Formula/wkhtmltopdf.rb

brew install wkhtmltopdf

As of this post, wkhtmltopdf has been removed from brew. There is a binary available at http://sourceforge.net/projects/wkhtmltopdf/files/0.12.1-773cad3/
User Avatar
alexwasserman 34 days ago
Actually, gave up on the wkhtml as the quality isn't so great - using webkit2png now, on my github link.

However, djparadyme has done a pretty awesome job, and is using the latest options from ForeCast.io on colors. Check his out.
User Avatar
jspence77 15 days ago
Could you explain this in a simpler way? Not really sure what to do with all this info. I've put in my lat and long but don't really understand how I switch light/dark, get it to work, make it show up on my screen, or get it to work. Any chance I can get this a little more clearly explained? Thanks!
User Avatar
-cj81499- 5 days ago
I've got it working, but the image is 800px X 600px. Is there any way to crop it?

Another problem I'm having is every time the script runs (every minute), the application Python opens and takes me out of whatever program I was using before and into Python.
User Avatar
jspence77 3 days ago
No
User Avatar
gvantass 3 days ago
I started having issues with GeekWeather2 a few days ago, so I came out to grab the latest version of everything, which I have done. However, I can't get the image to process anymore. It seems like the temp image is not created somewhere, but I'm not sure how to get it to work.

This is the result:

gvantass@Enso ~/Documents/GeekTool/GeekWeather2 $ ./geekWeather2.sh 42.294439 -89.105217 "The Homestead" LIGHT

Converting to image

--filename option requires exactly one url

Running image smoothing

convert: unable to open image `/tmp/tmpWeather-full.png': No such file or directory @ error/blob.c/OpenBlob/2645.

convert: unable to open file `/tmp/tmpWeather-full.png' @ error/png.c/ReadPNGImage/4021.

convert: no images defined `png:/tmp/GeekWeather.png' @ error/convert.c/ConvertImageCommand/3150.

Log in to comment or register here.