Geektools Weather Image Problem

Discussion in 'OS X' started by Jphilippon, Nov 30, 2010.

  1. macrumors member

    Joined:
    Jun 28, 2010
    #1
  2. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
  3. Jphilippon, Nov 30, 2010
    Last edited by a moderator: Dec 1, 2010

    thread starter macrumors member

    Joined:
    Jun 28, 2010
    #3
    I've tried these:
    Code:
    curl --silent "http://weather.yahoo.com/united-states/california/fullerton-2408095/" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather.png\
    ^Returns green feedback. (success)
    +

    Code:
    file:/localhost/Users/tmp/
    FIRST CODE EDITED.


    The problem is the second. Can't figure it out.

    I'm sorry if my problem is ridiculously easy or simple or something, I'm new to Geektools.
     
  4. upaymeifixit, Nov 30, 2010
    Last edited: Nov 30, 2010

    macrumors 6502a

    upaymeifixit

    Joined:
    Feb 13, 2009
    #4
    It looks like the problem if you have the location to the weather icon set to "file:/localhost/Users/tmp/" which is a directory, not a file, and there are supposed to be two /'s. Either try "file://localhost/Users/tmp/weather.png" for your file location, or try this:

    Shell command:
    Code:
    curl --silent "http://xml.weather.yahoo.com/forecastrss?p=USCA0127&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>//'
    Shell command:
    Code:
    curl -o /tmp/weather.html http://weather.yahoo.com/united-states/california/fullerton-2408095/; curl -o /tmp/currenttemp.png  `grep "div\ class=\"forecast-icon\"\ style=\"background:url" /tmp/weather.html | awk -F"'" '{ printf $2 }'`
    File location:
    Code:
    file://localhost/tmp/currenttemp.png
     
  5. thread starter macrumors member

    Joined:
    Jun 28, 2010

Share This Page