Announcement

Collapse
No announcement yet.

Weather.com changed format

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Weather.com changed format

    All,

    Looks like weather.com has changed their format for displaying pages. I'll see how quick I can figure out what has changed and make the changes to WeatherMan.

    For those still using weather_report2, chances are that you could cut and paste the fixes back into this script, but not sure yet.
    Mike

    #2
    All,

    The updated WeatherMan script is posted in the Original post in the Scripts Lib: WeatherMan Script

    I'll need to do some additional testing to see if all the features still work, other than 36hr forecast.

    Note that you might receive a error in line 711 if weather.com returns their new 'We are too busy' page. I'll look to code around this in the future.


    Let me know of any bugs that you find
    Mike

    [This message was edited by Mike Hunter on Sunday, 16 June 2002 at 12:00 PM.]

    Comment


      #3
      Mike, thanks for the qucik patches. I think that it is time to change some the "guts" of the scripts. Weather,com has been using "hooks" in the html code for some time. These will make it easier to parse out the information and hopefully stable with weather.com changes.

      ------------------



      <!-- insert current tempature --> <B>70°F</B></TD>


      <!-- insert current weather icon -->
      <IMG SRC="http://image.weather.com/web/common/wxicons/52/30.gif" WIDTH="52" HEIGHT="52" BORDER="0" ALT=""></TD>


      <!-- insert feels like temp -->N/A°F</B></TD>

      <!-- insert UV index -->3 Low</TD>
      <!-- insert dew point -->61°F</TD>
      <!-- insert humidity -->73%</TD>
      <!-- insert visibility -->Unlimited miles</TD>
      <!-- insert pressure -->29.91 inches and steady</TD>
      <!-- insert wind --> From the West Northwest at 12 gusting to 16 mph</TD>

      <!-- insert reported/last updated info -->

      <FONT COLOR="#333367">As reported at Miramar MCAS, CA Last Updated Friday, June 14, 2002, at 4:56 PM Pacific Daylight Time (Friday, 7:56 PM EDT).</FONT></TD>

      My Configuration is here
      DSteiNeuro

      HS3Pro

      MSI Cubi Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2201 Mhz, 2 Core(s), 4 Logical Processor(s) 16GB DDRl RAM

      Enabled Plug-Ins
      BLRussound, BLSpeech, HSTouch Server, JowiHue, MyQ, Nest, Rain8, Squeezebox, Ultra1Wire3, UltraGCIR3, Vista Alarm, X10,Z-Wave

      Comment


        #4
        For example getting the temperature is as easy as :

        '<!-- insert current tempature -->" 70°F</TD>'

        <pre class="ip-ubbcode-code-pre">
        temp = Instr ( Webpage, "&lt;!-- insert current tempature --&gt;")
        temp = Mid ( Webpage, temp + 37 ,3)
        temp = Replace (temp, "d", "",1,-1,1)
        temp = Replace (temp, "e", "",1,-1,1)
        temp = Replace (temp, "e", "",1,-1,1)

        </pre>

        Result = 70


        Basically using geturl without the HYTML stripped the first line finds the hook "&lt;!-- insert current tempature --&gt;"

        and the second line moves 37 spaces from start of the hook and comes back with the next 2 chatacters

        the next lines get rid of extra characters if the temp if less than 3 digits (100+)

        I will do the others later today and update weather2.txt. Mike will update wetaherman.

        My Configuration is here

        [This message was edited by DSteiNeuro on Saturday, 15 June 2002 at 02:24 PM.]
        DSteiNeuro

        HS3Pro

        MSI Cubi Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2201 Mhz, 2 Core(s), 4 Logical Processor(s) 16GB DDRl RAM

        Enabled Plug-Ins
        BLRussound, BLSpeech, HSTouch Server, JowiHue, MyQ, Nest, Rain8, Squeezebox, Ultra1Wire3, UltraGCIR3, Vista Alarm, X10,Z-Wave

        Comment


          #5
          David,

          Yep I agree, I had started looking at it one other time, but was in the middle of a few other changes and only wanted to make one major change at a time.

          For the next version I'll get the page un-stripped and locate those tags. Let's see how long that stays a standard. It looks like the last 3 or 4 changes, this has always stayed the same.

          Thanks again
          Mike

          Comment


            #6
            Mike, I should have it all parsed out later today. I suspect that this will be stable for a long time.

            I also noticed the weather.com "Busy" page. This might be a good thing. Rather than geturl timing out, it can look for the "Busy" page and end the script and try again later.

            My Configuration is here
            DSteiNeuro

            HS3Pro

            MSI Cubi Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz, 2201 Mhz, 2 Core(s), 4 Logical Processor(s) 16GB DDRl RAM

            Enabled Plug-Ins
            BLRussound, BLSpeech, HSTouch Server, JowiHue, MyQ, Nest, Rain8, Squeezebox, Ultra1Wire3, UltraGCIR3, Vista Alarm, X10,Z-Wave

            Comment

            Working...
            X