Geektool Yahoo Weather must have changed coding

Discussion in 'UI Customization' started by FreemanW, Apr 24, 2016.

  1. FreemanW, Apr 24, 2016
    Last edited: Apr 24, 2016

    FreemanW macrumors 6502

    Joined:
    Sep 10, 2012
    Location:
    The Real Northern California
    #1
    Title says it all.

    My GeekTool weather scripts, specifically, "Current Conditions" along with the PNG file grab and the "Four-day Forecast" have gone AWOL.

    Everything was fine, it was working, then there was a day or maybe two where it looked as though it was pulling forecast information for somewhere else, the highs, lows, and weather were off from what the National Weather Service forecasts were. Then, finally, nothing. Just gone.

    Does anyone have any information or resolution for this issue?

    Here is the curl code that I've been using, location is Mount Shasta, CA

    Weather Image Grab =
    curl --silent "https://uk.weather.yahoo.com/23424977/california/mount-shasta-2455436/" | grep "current-weather" | sed "s/.*background\:url(\'\(.*\)\') .*/\1/" | xargs curl --silent -o /tmp/weather1.png\

    Current Conditions =
    curl --silent "http://xml.weather.yahoo.com/forecastrss?p=USCA0741&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'

    Four Day Forecast =
    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 \/>//'

    [edit] The smilie after 'High' is actually a colon and close parenthesis.
     
  2. miK., Apr 24, 2016
    Last edited: Apr 24, 2016

    miK. macrumors 6502

    miK.

    Joined:
    Mar 13, 2008
    #2
    This thread may be of some help:
    https://forum.rainmeter.net/viewtopic.php?f=13&t=23010&sid=4aaccd03b6a6795bb8227936f4ec0263

    I totally abandoned Yahoo for weather info a while back. I use the below accuweather settings to get my attached look. I don't use a forecast geeklet, though.

    Current Conditions:
    curl --silent "http://www.accuweather.com/en/us/albany-ny/12208/weather-forecast/4543_pc" | awk -F\' '/acm_RecentLocationsCarousel.push/{print$14", "$10"°" }'| head -1
    (use link with your city at the http)

    Weather Image Grab:

    curl --silent "http://www.accuweather.com/en/us/albany-ny/12208/current-weather/4543_pc" | grep -o 'http://vortex.accuweather.com/adc2010/images/icons-numbered/[0-9][0-9]-xl.png' | xargs curl -o /tmp/weather.png
    (use link with your city at the http)

    Screen shot 2016-04-24 at 8.14.14 PM.png
     
  3. FreemanW thread starter macrumors 6502

    Joined:
    Sep 10, 2012
    Location:
    The Real Northern California
    #3
    Thank you!

    I will check this link out and utilize the information you've graciously provided.
     
  4. dwfaust macrumors 68040

    dwfaust

    Joined:
    Jul 3, 2011
    Location:
    I am here =>[*]
    #4
    Great info... thanks. A minor tweak to replace Albany with my location and I am golden.
     
  5. bluereef macrumors member

    Joined:
    Jan 29, 2012
    #5
  6. dwfaust macrumors 68040

    dwfaust

    Joined:
    Jul 3, 2011
    Location:
    I am here =>[*]
    #6
    The command that you quoted simply captures the image and stores it locally at tmp/weather.png.

    You need to add an IMAGE applet with the URL of file:///tmp/weather.png, which will actually display the image.
     
  7. FreemanW thread starter macrumors 6502

    Joined:
    Sep 10, 2012
    Location:
    The Real Northern California
    #7
    Finally had a moment to implement this.

    Once again, thank you for the assist on this, works like a charm. ;)
     
  8. bluereef, Apr 27, 2016
    Last edited: Apr 27, 2016

    bluereef macrumors member

    Joined:
    Jan 29, 2012
    #8
    --- Post Merged, Apr 27, 2016 ---
    Thanks, it worked fine.

    Can the icons be changed to a flat weather icon that I used before with Yahoo???

    I have the png files on my laptop.

    I have been running a apple script for the 2 day forecast but since Yahoo weather has shut down, I am kind of lost on how to get my 2 day forecast back and the icons...along with current wind chill humidity. I can post the scripts if you think you can help us??

    Thanks again for your time.
     
  9. dwfaust macrumors 68040

    dwfaust

    Joined:
    Jul 3, 2011
    Location:
    I am here =>[*]
    #9
    I am sure all of that is possible, but I am not sure how to do it. The script shown uses the images stored on the Accuweather site and references them with the appropriate "current conditions" indicator. You would need to know what that indicator is on the Accuweather site, and be able to translate that to match the image file name for the appropriate that you have stored locally.

    As for the 2 day forecast, again, it can probably be done, but not sure how, as the data to build that 2 day forecast would have to be built from different areas of the Accuweather page.
     

Share This Page