Geektool weather images

Discussion in 'macOS' started by alfredlgj, May 11, 2012.

  1. alfredlgj macrumors newbie

    Joined:
    Nov 1, 2011
    #1
    I need some help here as the shell my Geektool shell for yahoo weather images seem not to be working. I have been using this and it works fine until recent weeks. And I haven't changed it recently (or at least i think i didnt)

    Shell:

    curl --silent "http://hk.weather.yahoo.com/hong-kong/hong-kong-island/hong-kong-2165352/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather1.png\

    Image:

    file:///tmp/weather1.png

    Any insight?
     
  2. kamuix, May 11, 2012
    Last edited: May 11, 2012

    kamuix macrumors regular

    Joined:
    Feb 9, 2011
    Location:
    california
    #2
    If you check out here http://forums.macrumors.com/showthread.php?t=628023&page=150 you'll see yahoo made some changes, so that you can no longer get the images. In that thread, there is the ultimate weather package made by xtacocorex. There are examples of how to run the scripts and also getting weather from various sites besides yahoo with images.
     
  3. alfredlgj thread starter macrumors newbie

    Joined:
    Nov 1, 2011
    #3
    Oh thank you!

    That seems to work but the images seem to be crappy.
    The .gif image from yahoo was way worse then the original one. Doesnt even have a transparent background.
    Is that supposed to be so?
     
  4. Ivan Lee macrumors newbie

    Joined:
    May 12, 2012
    #4
    Here:
    curl --silent "http://weather.yahoo.com/hong-kong/hong-kong-island/hong-kong-2165352/" | grep "current-weather" | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl --silent -o /tmp/weather1.png\
     
  5. alfredlgj thread starter macrumors newbie

    Joined:
    Nov 1, 2011
  6. RMG19 macrumors newbie

    Joined:
    May 15, 2012
    #6


    could you please change my url too?

    curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-735160/?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

    thanks a lot
     
  7. xtacocorex macrumors regular

    Joined:
    Oct 23, 2010
    Location:
    Iowa
    #7
    All you have to do is go to Yahoo! Weather, type in your location and copy the url in the address bar of your browser and replace the url in the curl command.
     
  8. RMG19 macrumors newbie

    Joined:
    May 15, 2012
    #8
    i have tried it,

    curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-12852803//?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

    this is the new code, but it still doesn't work. am I missing something?

    thanks for your reply
     
  9. b-rad g macrumors 6502a

    b-rad g

    Joined:
    Jun 29, 2010
    #9

    I changed how the location was coded before to how Yahoo! is coding it now.

    Try this....

    Replace what is in red

    curl --silent "http://weather.yahoo.com/netherlands/gelderland/zutphen-12852803//?unit=c" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

    With this

    ?w=12852803/

    After I made this change the image popped back up after a minute.
     
  10. RMG19 macrumors newbie

    Joined:
    May 15, 2012
    #10
    Is this correct?

    curl --silent "http://weather.yahoo.com/?w=12852803/" | grep "forecast-icon" | sed "s/.*background\\:url(\\'\\(.*\\)\\')\\;\\ _background.*/\\1/" | xargs curl --silent -o /tmp/weather.png

    I still don't have the image back
     
  11. b-rad g macrumors 6502a

    b-rad g

    Joined:
    Jun 29, 2010
    #11

    If 12852803 is the code for your city then it should work. As soon as I changed mine I got my image back. I had to restart earlier today for something else and it took about 5 minutes for it to pop back up. So I imagine its still finicky.
     
  12. RMG19 macrumors newbie

    Joined:
    May 15, 2012
    #12

    12852803 is correct I checked it again, but still nothing, the computer is on for a few hours and it hasn't showed.
     
  13. b-rad g macrumors 6502a

    b-rad g

    Joined:
    Jun 29, 2010
    #13
    Hmmm. Maybe someone else can chime in with some help as to why it's not showing up.

    Also I redid mine with this one....

    http://www.macosxtips.co.uk/geeklets/weather/new-yahoo-weather-geeklet/

    Just changed for my location.
     
  14. RMG19 macrumors newbie

    Joined:
    May 15, 2012
    #14
    It's finally working, the problem was in the image path

    thanks for the help all
     
  15. onthedlo macrumors newbie

    Joined:
    Oct 14, 2007
    #15
    Would you mind pasting your final code? I've tried a few combinations of the suggestions here, but still can't seem to get it to work. I've triple-checked my image path--but no luck. Thanks in advance.
     
  16. c1366611 macrumors newbie

    Joined:
    May 28, 2012
    #16
    Hello,
    Yahoo changed source... Picture doesn't work anymore. Any suggestions for new code? :(
     
  17. harmonicaminor, Aug 27, 2012
    Last edited: Aug 28, 2012

    harmonicaminor macrumors newbie

    Joined:
    Aug 27, 2012
    #17
    I made one! It gets the icon from weather.com.

    curl --silent "http://www.weather.com/weather/right-now/ZIPCODE" | grep -E -o 'http://s.imwx.com/v.20120328.084208//img/wxicon/120/.*png' | head -1 | xargs curl -o /tmp/weather.png

    Replace ZIPCODE with your zip code. You can also look up your town on weather.com and paste the url in.

    In geektool, make that a shell geeklet and make another image geeklet with the url "file://localhost/private/tmp/weather.png"

    Hope it works.

    Edit: I also made something to get the numerical temperature off of weather.com:

    curl --silent "http://www.weather.com/weather/right-now/ZIPCODE" | grep -E -o 'itemprop="temperature-fahrenheit">[0-9]*' | head -1 | awk -F'>' '{print $2;}'
     
  18. wild4life2013 macrumors newbie

    Joined:
    Mar 13, 2013
    #18
    the weather image from weather .com

    the weather image from weather.com is no longer working
    please can you look into it and email me wild4lifedesigns @ live dot co dot uk
    thanx for your help.

    I cant find any other decent weather image scripts as yahoo weather is rubbish
     
  19. alfredlgj thread starter macrumors newbie

    Joined:
    Nov 1, 2011
    #19
    After working for half a year, it has stopped working again
    Help, Ivan!
     
  20. z06gal macrumors 6502

    Joined:
    Aug 30, 2011
    #20
    I cannot get the weather image to show. I can get the forecast and the temp but have not had any luck with an image. Any help would be greatly appreciated :)
     
  21. BIGJM macrumors newbie

    Joined:
    Mar 9, 2014
    Location:
    Barcelona, Spain
    #21
    Yahoo weather icon working in Maveriks

    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 www.fr.meteo.yahoo.com set your city (for me is Barcelona, Spain) and copy your url:

    [COLOR="Blue"][COLOR="Blue"]http://...orks fine for me in Mavericks. LOL. BIG_JM
     
  22. fhall1 macrumors 68040

    fhall1

    Joined:
    Dec 18, 2007
    Location:
    (Central) NY State of mind
    #22
    2. WEATHER IMAGE SCRIPT (image)
    file://localhost/tmp/weatherYfr.png

    That points to a file on YOUR machine.....what do others use?
     
  23. BIGJM macrumors newbie

    Joined:
    Mar 9, 2014
    Location:
    Barcelona, Spain
    #23
    Find the path to your tmp folder inside your USER.

    (You need to set to view all archives in your folders...)

    BIGJM
     
  24. woodenbrain macrumors member

    Joined:
    Sep 2, 2009
    #24
    this working for me

    where the fr.meteo.yahoo URL is obtained from fr.meteo.yahoo.com:

    Code:
    curl -s https://fr.meteo.yahoo.com/états-unis/michigan/ann-arbor-2354842/ | grep ‘obs-current-weather’ | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl -s -o /tmp/weather.png
     
  25. becerrag macrumors newbie

    Joined:
    Sep 2, 2014
    #25
    Yahoo alternatives?

    Hi all,

    A lot of people seem to have had trouble with the images from Yahoo weather so I was wondering whether it was possible to write a script to get the info from another website.

    The BBC weather page has some really nice, simple images (for those of us who like minimalist icons). I don't know very much about coding at all (the best I've been able to do is tweak other people's scripts to change values like size, color etc.) but it seems no one has tried to create a geeklet with images using the BBC page. Some people have gotten weather conditions in written form from the BBC's Conditions RSS feed, but then how does one go about getting the weather images? Is it possible to tweak the Yahoo geeklet script to use another page? Help please!
     

Share This Page