help with geektool script for local weather xml

Discussion in 'Mac Apps and Mac App Store' started by telemark948, Aug 18, 2010.

  1. telemark948 macrumors member

    Joined:
    Jul 31, 2010
    #1
    Ok I can get geektool to work on Yahoo weather by copying someones script see below and thanks.

    Code:
    curl --silent "http://xml.weather.yahoo.com/forecastrss?p=NOXX0035&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//' 
    However their is a local site for my location in Norway that provides great xml data for the weather. Now I can call some of the information out with grep but struggle when it gets complex. Below is an extract from the xml file
    Code:
    <time from="2010-08-19T00:00:00" to="2010-08-19T06:00:00" period="0">
            <!-- Valid from 2010-08-19T00:00:00 to 2010-08-19T06:00:00 -->
            <symbol number="9" name="Rain" />
            <precipitation value="0.7" />
            <!-- Valid at 2010-08-19T00:00:00 -->
            <windDirection deg="12.3" code="NNE" name="North-northeast" />
            <windSpeed mps="1.6" name="Light breeze" />
            <temperature unit="celcius" value="18" />
            <pressure unit="hPa" value="999.1" />
          </time>
    This is repeated around 30 times in the xml file for different times of the day. Now I would like to get geektool to display a couple of the options on the first entry only, something like name, temp and windspeed. I keep calling too many entries.

    can anyone help.

    Thanks

    Andy
     
  2. fhall1 macrumors 68040

    fhall1

    Joined:
    Dec 18, 2007
    Location:
    (Central) NY State of mind
    #2
    You should post this in the large "Geektool scripts" thread in this forum instead of making it a separate thread. Also, have you tried searching that thread? It's got lots of weather script info.
     

Share This Page