6

Many of you know that www.wunderground.com provides highly accurate weather information. It has not been so well-known in term of geeklets. The Geektool cannot get images from the website because the website uses SVG format for its weather icons.

However, Geektool can get current location from the website. It means that in stead of only sticking with weather information of your location Geektool will display such of any place you travel to. It is exactly like weather applications on smartphones.

These geeklets are tested and worked smoothly on my computer running Mac OS X 10.9.4 Mavericks. I do not have lower versions of Mac OS X to test. Please follow strickly my guides and hope that it works on your computers :-)

Part One: Testing commands.

Step 1: Open Terminal on your computer.

Step 2: Open the website http://www.wunderground.com and see your location displayed on it (e.g. in my case, it is Ha Noi - the capital of Viet Nam).

Step 3: Copy the follow command: curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' | sed -n '8p' | awk -F '>' '{print $2}' | sed 's/<\/a//' and paste in your Terminal and press Return. If the command does not return anything, try to replace ‘>’ (greater than) in the command by ‘&gt;’. If the command returns something, compare it with the location displayed on the website. E.g. in my case, the command returns ‘Ha Noi’ which is exactly similar to the location displayed on the website.

Step 4: Copy the follow command: curl -s 'http://www.wunderground.com' | grep 'hpIcon' | awk -F '=' '{print $4}' | sed 's/"//' | sed 's/" class//' and paste in your Terminal and press Return. If the command does not return anything, try to replace ‘>’ (greater than) in the command by ‘&gt;’. If the command returns something, compare it with the weather condition displayed on the website.

Step 5: Copy the follow command: curl -s 'http://www.wunderground.com' | grep 'wx-value' | sed -n '1p' | awk -F '>' '{print $2}' | sed 's/<\/span//' | awk '{print $0"°C"}' and paste in your Terminal and press Return. If the command does not return anything, try to replace ‘>’ (greater than) in the command by ‘&gt;'. If the command returns something, compare it with the current temperature displayed on the website.

Step 6: Copy the follow command: curl -s 'http://www.wunderground.com' | grep 'wx-value' | sed -n '2p' | awk -F '>' '{print $2}' | sed 's/<\/span//' | awk '{print "Feel like "$0"°C"}' and paste in your Terminal and press Return. If the command does not return anything, try to replace ‘>’ (greater than) in the command by ‘&gt;’. If the command returns something, compare it with the ‘feel like’ temperature displayed on the website.

Step 7: Copy the follow command: curl -s 'http://www.wunderground.com' | grep 'wx-value' | sed -n '3p' | awk -F '>' '{print $2}' | sed 's/<\/span//' | awk '{print "Hi "$0"°C"}'; curl -s 'http://www.wunderground.com' | grep 'wx-value' | sed -n '4p' | awk -F '>' '{print $2}' | sed 's/<\/span//' | awk '{print "Lo "$0"°C"}' and paste in your Terminal and press Return. If the command does not return anything, try to replace ‘>’ (greater than) in the command by ‘&gt;’. If the command returns something, compare it with the ‘Hi Lo’ temperature displayed on the website.

Please be advised that if all the commands return results it means that geeklets can work well on your computer. Now turn to Part Two if you want to do it yourselves or Part Four for easier way. But if the commands does not run, these geeklets cannot work. Poor you !!! Turn to Part Three: Diagnosing errors

Part Two: Turning commands to geeklets

Step 1: Open Geektool and you will see a windows with three icons (File, Image and Shell).

Step 2: Left-click and hold your mouse on Shell and drag it to your desktop. Properties windows will appear.

Step 3: Copy commands tested and run in Part One and paste in Command Box on Shell Properties windows. Input ‘600’ for ‘Refresh every’ just under Command Box on Properties. You will see the results displayed on your desktop.

Step 4: Click on “click here to set font and colors” to change font type and colors.

Part Three: Diagnosing errors

If the command cannot run on your computer, please try to run it part by part as follow. I will take this command: curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' | sed -n '8p' | awk -F '>' '{print $2}' | sed 's/<\/a//' as an example.

Step 1: Run the first part of command as follow: curl -s 'http://www.wunderground.com' => Any result or not? If yes, follow next step. If not, sorry computer is not compatible.

Step 2: Run the second part of the command: curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' => Any result or not? If yes, follow next step.

Step 3: Run the third part of the command: curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' | sed -n '8p' => Any result or not? If yes, follow next step.

Step 4: Run the next part of the command: curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' | sed -n '8p' | awk -F '>' '{print $2}' => Any result or not? If yes, follow next step. If not, try to replace ‘>” (greater than) by in the command by ‘>’.

Step 5: Run the next part of the command: curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' | sed -n '8p' | awk -F '>' '{print $2}' | sed 's/<\/a//' => Any result or not? If yes, follow next step.

Part Four: Adding complete geeklets to you

I also attach complete geeklets here. If you test and find out all commands work in Part One, you can use these complete geeklets on your computer. Follow here:

Step 1: Download all attached geeklets to your computers.

Step 2: Double click on each geeklets. A pop-up appears and select Yes. Geeklet will appear on your desktop.


Comments

User Avatar
DBStudiosMedia 1657 days ago
This works great! However I'm not sure if it's a script error or something with the website, but I am getting
User Avatar
Rafagon 1645 days ago
This did not work for me, unfortunately. OS X 10.10.2 here, if it matters. I folllowed the instruction to a tee. FWIW, here are the results I got. Any help would be appreciated!

When I typed -> curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' | sed -n '8p' | awk -F '>' '{print $2}' | sed 's/” prompt and waited for input. Had to Ctrl+C out of it to get back to the Terminal prompt.

Then, per the instructions, "If the command does not return anything, try to replace ‘>’ (greater than) in the command by ‘&gt;’"

Ok, so now with &gt; replacement in single quotes:

I typed -> curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' | sed -n '8p' | awk -F ‘&gt;' '{print $2}' | sed 's/ curl -s 'http://www.wunderground.com' | grep -E 'cgi-bin/findweather' | sed -n '8p' | awk -F &gt; '{print $2}' | sed 's/” prompt and waited for input. Had to Ctrl+C out of it to get back to the Terminal prompt.
User Avatar
Dratsabtaf 1617 days ago
I love these, and they were working until a few days ago. I don't know if Wunderground did any changes. But not working anymore. Thanks.

Log in to comment or register here.