Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

miK.

macrumors 6502
Mar 13, 2008
261
21
Thanks for this - a nice update to my desktop.

Having some trouble getting the correct icon to work... it keeps cycling though different icons.
I'm somewhat of a Gt noob. Any help? Thanks!
 

gr4z

macrumors 6502
Aug 7, 2010
318
48
England
Having some trouble getting the correct icon to work... it keeps cycling though different icons.
I'm somewhat of a Gt noob. Any help? Thanks!

Not sure what you mean. Make sure the weather icons are in a subfolder called PNG and then you reference the icon image weathericon.png in GT.
 

Natrogon

macrumors newbie
May 4, 2014
2
0
Here's one.

cap_2_zpsfbceed3f.png
[/URL][/IMG]
 

yetiboy

macrumors member
Mar 23, 2011
35
0
Iron Man/Jarvis desktop

Inspired by some of the Rainmeter desktops I've seen, I've stolen quite a few images and added a couple of my own.

yeti

2j4oufa.png
 

Nickwell24

macrumors regular
Nov 13, 2008
149
12
Hi mates: After working two weeks finally I set up new scrips working with the nice yahoo icons.

1. Open geek tools

2. WEATHER IMAGE SCRIPT (image)
file://localhost/tmp/weatherYfr.png

Refresh every 30 seconds


3. go to http://www.fr.meteo.yahoo.com set your city (for me is Barcelona, Spain) and copy your url:

http://fr.meteo.yahoo.com/espagne/catalogne/barcelone-753692

4. IMAGE GRAB SCRIPT (Shell)

curl --silent "http://fr.meteo.yahoo.com/united-states/missouri/kansas-city-12786046/" | grep "url('http://l.yimg.com/os/mit/media/m/weather/images/icons/l/"| sed -e "s/\yom-mod yom-weather.*obs-current-weather//" | sed -e "s/\-100567.png.*//" | sed -e "s/[0-9][0-9][a-z]/&-100567.png/" | sed -e "s/\<div.*http/http/" | xargs curl --silent -o /tmp/weatherYfr.png\

Refresh every 30 seconds


Works fine for me in Mavericks.

LOL. BIG_JM:D:D

Can you verify this is still working? I've tried it multiple times, even including your exact code and I can't get an image to pull up.

When trying it for my location I use this:
curl --silent "http://fr.meteo.yahoo.com/united-states/missouri/kansas-city-12786046/" | grep "url('http://l.yimg.com/os/mit/media/m/weather/images/icons/l/"| sed -e "s/\yom-mod yom-weather.*obs-current-weather//" | sed -e "s/\-100567.png.*//" | sed -e "s/[0-9][0-9][a-z]/&-100567.png/" | sed -e "s/\<div.*http/http/" | xargs curl --silent -o /tmp/weatherYfr.png\

But i'll look in the tmp folder and there are no .png files being written to display. Any ideas?
 

tag

macrumors 6502a
Apr 29, 2005
918
9
Can you verify this is still working? I've tried it multiple times, even including your exact code and I can't get an image to pull up.

When trying it for my location I use this:
/code

But i'll look in the tmp folder and there are no .png files being written to display. Any ideas?

It seems like Yahoo France has changed their webpage code slightly (their URLs seem to be using https now and the URL for the image itself has changed slightly), so after a couple quick changes, this following code should work for you...

Code:
curl --silent "https://fr.meteo.yahoo.com/united-states/missouri/kansas-city-12786046/" | grep "url('https://s.yimg.com/os/mit/media/m/weather/images/icons/l/"| sed -e "s/\yom-mod yom-weather.*obs-current-weather//" | sed -e "s/\-100567.png.*//" | sed -e "s/[0-9][0-9][a-z]/&-100567.png/" | sed -e "s/\<div.*http/http/" | xargs curl --silent -o /tmp/weatherYfr.png\
 

FreemanW

macrumors 6502
Sep 10, 2012
483
93
The Real Northern California
Jim how do you get the detailed 5 day forecast? Can you post the script.

Drag a shell to the desktop . . . . . in the "command" blank, you will insert the following (I'm using the 'code' command here, be sure to capture the entire curl statement!):
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=USCA0741&u=f" | grep -E '(High:)' | sed -e 's/<BR \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<br \/>//'

. . . . . now the USCA0741 is the location code for Mount Shasta, CA (USA).

You will want to find your location code from this URL:
Code:
http://edg3.co.uk/snippets/weather-location-codes/
. . . . and insert it into that curl command in place of the USCA0741 and you ought to be golden.

If you want Kansas City, MO . . . . . your code is USMO0460 If you, instead, wanted the airport, you would utilize USMO0461. So, your curl would be:
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=USMO0460&u=f" | grep -E '(High:)' | sed -e 's/<BR \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<br \/>//'

I placed a refresh of 600 seconds on mine, I don't think it is too critical what you put in for a refresh time.
 
Last edited:

jwhitt3

macrumors newbie
Jun 1, 2014
8
0
At the end the mine.

BIGJM :p :p


BIGJM: Or Anyone

I have tried many times for the last few days to get the weather script and image to work from the french site to no avail.

I live in Louisiana, Baton Rouge to be exact. Is there any way someone could walk me through the steps.

I followed BIGJM post to the T and cannot get a description or image.

My script is as follows:

curl --silent "https://fr.meteo.yahoo.com/états-unis/louisiane/baton-rouge-2446480/" | grep "url('https://s.yimg.com/os/mit/media/m/weather/images/icons/l/"| sed -e "s/\yom-mod yom-weather.*obs-current-weather//" | sed -e "s/\-100567.png.*//" | sed -e "s/[0-9][0-9][a-z]/&-100567.png/" | sed -e "s/\<div.*http/http/" | xargs curl --silent -o /tmp/weatherYfr.png\


file://localhost/tmp/weatherYfr.png

(PS: the only image i was successful in pulling is the moon, partly cloudy but it never changed and it was at 5pm)

Can someone please tell me what I am doing wrong? Should I be saving weather icons images on my computer as a local host and then have a temp.png set or something? I have no clue how it works.

PLEASE HELP.
 
Last edited:

yetiboy

macrumors member
Mar 23, 2011
35
0
It's possible you're having an issue with the é. I tried this (same script without the accent):

Code:
curl --silent https://fr.meteo.yahoo.com/etats-unis/louisiane/baton-rouge-2446480 | grep "url('https://s.yimg.com/os/mit/media/m/weather/images/icons/l/"| sed -e "s/\yom-mod yom-weather.*obs-current-weather//" | sed -e "s/\-100567.png.*//" | sed -e "s/[0-9][0-9][a-z]/&-100567.png/" | sed -e "s/\<div.*http/http/" | xargs curl --silent -o /tmp/weatherYfr.png\

and it worked fine for me. I have the moon partially cloud covered too, but that's what the current weather is. Just make sure you set a refresh rate on the script - you don't have to do it more often than once an hour, so every 3600 seconds or more if you want.

yeti

BIGJM: Or Anyone

I have tried many times for the last few days to get the weather script and image to work from the french site to no avail.

I live in Louisiana, Baton Rouge to be exact. Is there any way someone could walk me through the steps.

I followed BIGJM post to the T and cannot get a description or image.

My script is as follows:

curl --silent "https://fr.meteo.yahoo.com/états-unis/louisiane/baton-rouge-2446480/" | grep "url('https://s.yimg.com/os/mit/media/m/weather/images/icons/l/"| sed -e "s/\yom-mod yom-weather.*obs-current-weather//" | sed -e "s/\-100567.png.*//" | sed -e "s/[0-9][0-9][a-z]/&-100567.png/" | sed -e "s/\<div.*http/http/" | xargs curl --silent -o /tmp/weatherYfr.png\


file://localhost/tmp/weatherYfr.png

(PS: the only image i was successful in pulling is the moon, partly cloudy but it never changed and it was at 5pm)

Can someone please tell me what I am doing wrong? Should I be saving weather icons images on my computer as a local host and then have a temp.png set or something? I have no clue how it works.

PLEASE HELP.
 

jwhitt3

macrumors newbie
Jun 1, 2014
8
0
It's possible you're having an issue with the é. I tried this (same script without the accent):

Code:
curl --silent https://fr.meteo.yahoo.com/etats-unis/louisiane/baton-rouge-2446480 | grep "url('https://s.yimg.com/os/mit/media/m/weather/images/icons/l/"| sed -e "s/\yom-mod yom-weather.*obs-current-weather//" | sed -e "s/\-100567.png.*//" | sed -e "s/[0-9][0-9][a-z]/&-100567.png/" | sed -e "s/\<div.*http/http/" | xargs curl --silent -o /tmp/weatherYfr.png\

and it worked fine for me. I have the moon partially cloud covered too, but that's what the current weather is. Just make sure you set a refresh rate on the script - you don't have to do it more often than once an hour, so every 3600 seconds or more if you want.

yeti


Yeti, Thank you for the quick reply. Am I understanding this correctly in that, that script will not produce any conditions but rather it is the script to pull the image for the weather? So it will remain a blank script but is necessary for the correct image to pull with the image shell. If so, i just copied and pasted your reply script and will see what happens.

Thanks again.
 

yetiboy

macrumors member
Mar 23, 2011
35
0
Yes, this script will only download the image to your /tmp folder. You would need another script (just an img script) that you would also run every hour or so to display it. You would need a completely separate script to get conditions.

yeti

Yeti, Thank you for the quick reply. Am I understanding this correctly in that, that script will not produce any conditions but rather it is the script to pull the image for the weather? So it will remain a blank script but is necessary for the correct image to pull with the image shell. If so, i just copied and pasted your reply script and will see what happens.

Thanks again.
 

jwhitt3

macrumors newbie
Jun 1, 2014
8
0
Yeti, I appreciate your response and help! I have the conditions but wanted to make sure I was understanding the blank script shell was necessary to pull the image from the french site. I'm obviously a newb at this but it is very addicting an I am determined.

I tried to play with grz4's method and had the 47 pngs saved and ran all the geeklets and scripts for that way but couldn't get it to work correctly. I had the cript running but couldn't get it to pull the info into a shell. Not sure what was happenng. I was intrigued by it since it did not have to pull the image from the site.

Many thanks!!



Yes, this script will only download the image to your /tmp folder. You would need another script (just an img script) that you would also run every hour or so to display it. You would need a completely separate script to get conditions.

yeti
 

jwhitt3

macrumors newbie
Jun 1, 2014
8
0
RAM Meter Script Help

Can anyone help out with this script? I'm on a MBP mid 2009 if that helps. I keep getting the error message,

"error "Can’t divide 0.0 by zero." number -2701 from 0.0"

Here is my Script:

Code:
on run
	set pathName to "/Users/USERNAME/Tools/RAMMeter"
	
	set ramFile to pathName & "/RAMMeter.txt"
	set COL_RED to "\\\\x1b[31\\;01m"
	set COL_GREEN to "\\\\x1b[32\\;01m"
	set COL_YELLOW to "\\\\x1b[33\\;01m"
	set COL_RESET to "\\\\x1b[39\\;49\\;00m"
	set newline to "\\\\n"
	set colour to ""
	set echoRAM to ""
	
	do shell script ("top -l 1 | grep  'PhysMem' >" & ramFile)
	
	set myUsedRAM to (do shell script ("grep -E 'PhysMem' " & ramFile & "| awk  '{print $8}'  | sed 's/M//'"))
	set myFreeRAM to (do shell script ("grep -E 'PhysMem' " & ramFile & "| awk  '{print $10}'  | sed 's/M//'"))
	set myTotalRAM to (myUsedRAM + myFreeRAM)
	
	set myPercentRAMIcon to (round ((100 * myUsedRAM / myTotalRAM + 1) / 5)) * 5
	set myPercentRAM to round (100 * myUsedRAM / myTotalRAM)
	
	do shell script ("cp " & pathName & "/img/" & myPercentRAMIcon & ".png " & pathName & "/RAMMeter.png")
	
	if myPercentRAM ≤ 50 then
		set echoRAM to newline & COL_GREEN & myPercentRAM & "%" & COL_RESET & newline & myUsedRAM & " MB"
	else if myPercentRAM ≤ 75 then
		set echoRAM to newline & COL_YELLOW & myPercentRAM & "%" & COL_RESET & newline & myUsedRAM & " MB"
	else if myPercentRAM > 75 then
		set echoRAM to newline & COL_RED & myPercentRAM & "%" & COL_RESET & newline & myUsedRAM & " MB"
	end if
	
	do shell script ("echo RAM" & echoRAM)
	
end run

To anyone who can help, Thank you in Advance!!
 
Last edited by a moderator:

Kornelis

macrumors member
Dec 4, 2010
79
18
Amsterdam, NL
Looks like the awk print statements in the program are not correct. The first part of the program works if I change the following lines to:

set myUsedRAM to (do shell script ("grep -E 'PhysMem' " & ramFile & "| awk '{print $2}' | sed 's/M//'"))
set myFreeRAM to (do shell script ("grep -E 'PhysMem' " & ramFile & "| awk '{print $6}' | sed 's/M//'"))
 
Last edited:

jwhitt3

macrumors newbie
Jun 1, 2014
8
0
Looks like the awk print statements in the program are not correct. The first part of the program works if I change the following lines to:

set myUsedRAM to (do shell script ("grep -E 'PhysMem' " & ramFile & "| awk '{print $2}' | sed 's/M//'"))
set myFreeRAM to (do shell script ("grep -E 'PhysMem' " & ramFile & "| awk '{print $6}' | sed 's/M//'"))


Kornelis, Many thanks. Your find worked perfectly.
 

Binarymix

macrumors 65816
Nov 1, 2007
1,121
353
Seems Yahoo has added weather codes, but not released the new list in the api documentation.

I'm getting quite a few errors lately, because the api is stating a weather condition that doesn't link up to the icons.

Many people use these apis in their apps, they gotta stop changing them all willy nilly, or at least update their api documentation when they do.

:mad:
 

Kornelis

macrumors member
Dec 4, 2010
79
18
Amsterdam, NL
I haven't seen any problems sofar, my weather geeklets are running fine on three computers. Maybe it is because of the nice stable weather we have had the last couple of weeks. ;)
 

z06gal

macrumors 6502a
Aug 30, 2011
503
16
Seems Yahoo has added weather codes, but not released the new list in the api documentation.

I'm getting quite a few errors lately, because the api is stating a weather condition that doesn't link up to the icons.

Many people use these apis in their apps, they gotta stop changing them all willy nilly, or at least update their api documentation when they do.

:mad:


I am having this issue with mine now. We were having a thunderstorm Saturday and my icon was reading as sunny. It has been messed up for several days now :(


I just deleted everything, re-downloaded the script from a couple pages back and am now getting the correct icon. I hope it continues ;)
 
Last edited:

anonymous4a

macrumors 6502
Aug 6, 2012
471
3
great desktops here, I'm new to this but is there anyway to hide the menu bar on the desktop ? I'm running mountain lion and I just want to see my wallpaper full screen .
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.