Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.
I followed the HTC Geeklet write up and everything works except for getting the weather image. Do I need two shells? One for

Code:
curl --silent "http://weather.yahooapis.com/forecastrss?p=USNY1401&u=f" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

This is the incorrect code. That link, while it does give you a parsable page, does not have a "forecast-icon" field to search for.

Try using this to grab the image.

Code:
curl --silent "http://weather.yahoo.com/united-states/new-york/new-york-12761484" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

and then use the image shell that you had to display the image.
 
This is the incorrect code. That link, while it does give you a parsable page, does not have a "forecast-icon" field to search for.

Try using this to grab the image.

Code:
curl --silent "http://weather.yahoo.com/united-states/new-york/new-york-12761484" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\

So I only need that one shell containing the corrected code you posted? I just used that code and still nothing is showing up for an image.
 
Heres Mine. Thanks guys for writing the guide and stuff.
screenshot20100117at827.png
 
You guys will have to excuse me. Been
absent from here for a few days.

OH MY GOD! I have to have that flip clock.

Went back a few pages but I can't locate
the code for it. Can someone just give me
a reference to the coding for that clock?

This is such an awesome thread. Thank
you all for sharing your work.
 
Yeah the guide will help you make the geeklet, but make sure you do read on from there. Myself and some of the others have added some other scripts you may or may not want to use aswell as/instead of some of the scripts in the guide. There's a link for my guide in my sig.

p.s. Thanks MacDawg for providing the link.
 
Heres Mine. Thanks guys for writing the guide and stuff.
screenshot20100117at827.png

That’s looks great bud! I would suggest you use the current weather conditions script in the guide. that way you won't have the temperature showing twice.

Code:
curl --silent "http://weather.yahooapis.com/forecastrss?p=UKXX1561&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' -e 's/, [0-9]* [A-Z]//' | tail -n1

You can also have the temperature showing in Celcius if you want.

Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX1561&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °C/' | sed 's/ //' | tail -n1

You can also have it without the Celcius altogether. (I personally prefer this way.)
Code:
curl --silent "http://xml.weather.yahoo.com/forecastrss?p=UKXX1561&u=c" | grep -E '(Current Conditions:|[A-Z]<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/[A-Z a-z]*, //' -e 's/\(.*\) F/\1 °F/' -e 's/\(.*\) C/\1 °/' | sed 's/ //' | tail -n1
 
I'm having a little trouble with the weather icon. I get an icon, but it the wrong icon, like right now I tried and it came out as a cloudy icon when it should be snowing. Please help.
 
I'm having a little trouble with the weather icon. I get an icon, but it the wrong icon, like right now I tried and it came out as a cloudy icon when it should be snowing. Please help.

Are you sure you have the right zipcode entered into the code?
Have you checked the refresh rate on the image grab as well as the image post?
Have you compared it directly to the one posted on Yahoo?

Woof, Woof - Dawg
pawprint.gif
 
Are you sure you have the right zipcode entered into the code?
Have you checked the refresh rate on the image grab as well as the image post?
Have you compared it directly to the one posted on Yahoo?

Woof, Woof - Dawg
pawprint.gif

yes, I have.
 
I tested this code and it worked for me
Delete your old shells and use these

Copy and paste the code
This should be a shell script

Code:
curl --silent "http://weather.yahoo.com/united-states/connecticut/enfield-12760229/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /var/tmp/weather_image.png\

This should be a picture

Code:
file://localhost/var/tmp/weather_image.png

Woof, Woof - Dawg
pawprint.gif
 
I tested this code and it worked for me
Delete your old shells and use these

Copy and paste the code
This should be a shell script

Code:
curl --silent "http://weather.yahoo.com/united-states/connecticut/enfield-12760229/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /var/tmp/weather_image.png\

This should be a picture

Code:
file://localhost/var/tmp/weather_image.png

Woof, Woof - Dawg
pawprint.gif


still the wrong image. Now yahoo weather is down
 
I couldn't access it at all this weekend

Well, I am certain your issues are with Yahoo Weather access and not the Geektool code
You are still posting the last valid image you grabbed from Yahoo

Perhaps it is an issue with your provider or your IP address being blocked

Some reported being blocked by accessing Yahoo too much with the refresh rates, but I haven't seen that here in this thread for a while

I have never had a problem with access, but it might be blocked by your provider and not Yahoo

You might want to wait a few days before trying to access again and see if you get reset

Woof, Woof - Dawg
pawprint.gif
 
Well, I am certain your issues are with Yahoo Weather access and not the Geektool code
You are still posting the last valid image you grabbed from Yahoo

Perhaps it is an issue with your provider or your IP address being blocked

Some reported being blocked by accessing Yahoo too much with the refresh rates, but I haven't seen that here in this thread for a while

I have never had a problem with access, but it might be blocked by your provider and not Yahoo

You might want to wait a few days before trying to access again and see if you get reset

Woof, Woof - Dawg
pawprint.gif


It's working right now. Thanks for your help.:)
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.