Foros del Web » Programando para Internet » ASPX (.net) »

Leer XML de Weather.com

Estas en el tema de Leer XML de Weather.com en el foro de ASPX (.net) en Foros del Web. Alguien sabe como leer desde ASP.NET en VB los archivos de Weather.com Ejemplo de archivo XML Código: <?xml version="1.0" encoding="ISO-8859-1"?> <!--This document is intended only ...
  #1 (permalink)  
Antiguo 26/12/2007, 13:07
 
Fecha de Ingreso: febrero-2006
Mensajes: 155
Antigüedad: 18 años, 2 meses
Puntos: 0
Leer XML de Weather.com

Alguien sabe como leer desde ASP.NET en VB los archivos de Weather.com

Ejemplo de archivo XML
Código:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--This document is intended only for use by authorized licensees of The Weather Channel. Unauthorized use is prohibited. Copyright 1995-2005, The Weather Channel Interactive, Inc. All Rights Reserved.-->
<weather ver="2.0">
  <head>
    <locale>en_US</locale>
    <form>MEDIUM</form>
    <ut>C</ut>
    <ud>km</ud>
    <us>km/h</us>
    <up>mb</up>
    <ur>mm</ur>
  </head>
  <loc id="MXSR0159">
    <dnam>Ciudad Obregon, Mexico</dnam>
    <tm>11:10 AM</tm>
    <lat>27.49</lat>
    <lon>-109.94</lon>
    <sunr>7:08 AM</sunr>
    <suns>5:33 PM</suns>
    <zone>-7</zone>
  </loc>
  <cc>
    <lsup>12/26/07 10:48 AM Local Time</lsup>
    <obst>Ciudad Obregon, Mexico</obst>
    <tmp>15</tmp>
    <flik>15</flik>
    <t>Sunny</t>
    <icon>32</icon>
    <bar>
      <r>1017.3</r>
      <d>falling</d>
    </bar>
    <wind>
      <s>14</s>
      <gust>N/A</gust>
      <d>300</d>
      <t>WNW</t>
    </wind>
    <hmid>36</hmid>
    <vis>16.1</vis>
    <uv>
      <i>3</i>
      <t>Moderate</t>
    </uv>
    <dewp>0</dewp>
    <moon>
      <icon>17</icon>
      <t>Waning Gibbous</t>
    </moon>
  </cc>
  <dayf>
    <lsup>12/26/07 8:17 AM Local Time</lsup>
    <day d="0" t="Wednesday" dt="Dec 26">
      <hi>19</hi>
      <low>12</low>
      <sunr>7:08 AM</sunr>
      <suns>5:33 PM</suns>
      <part p="d">
        <icon>32</icon>
        <t>Sunny</t>
        <wind>
          <s>14</s>
          <gust>N/A</gust>
          <d>326</d>
          <t>NW</t>
        </wind>
        <bt>Sunny</bt>
        <ppcp>0</ppcp>
        <hmid>31</hmid>
      </part>
      <part p="n">
        <icon>33</icon>
        <t>Mostly Clear</t>
        <wind>
          <s>11</s>
          <gust>N/A</gust>
          <d>309</d>
          <t>NW</t>
        </wind>
        <bt>M Clear</bt>
        <ppcp>0</ppcp>
        <hmid>42</hmid>
      </part>
    </day>
    <day d="1" t="Thursday" dt="Dec 27">
      <hi>19</hi>
      <low>10</low>
      <sunr>7:09 AM</sunr>
      <suns>5:34 PM</suns>
      <part p="d">
        <icon>34</icon>
        <t>Mostly Sunny</t>
        <wind>
          <s>18</s>
          <gust>N/A</gust>
          <d>329</d>
          <t>NNW</t>
        </wind>
        <bt>M Sunny</bt>
        <ppcp>0</ppcp>
        <hmid>38</hmid>
      </part>
      <part p="n">
        <icon>33</icon>
        <t>Mostly Clear</t>
        <wind>
          <s>19</s>
          <gust>N/A</gust>
          <d>342</d>
          <t>NNW</t>
        </wind>
        <bt>M Clear</bt>
        <ppcp>0</ppcp>
        <hmid>31</hmid>
      </part>
    </day>
    <day d="2" t="Friday" dt="Dec 28">
      <hi>20</hi>
      <low>12</low>
      <sunr>7:09 AM</sunr>
      <suns>5:34 PM</suns>
      <part p="d">
        <icon>34</icon>
        <t>Mostly Sunny</t>
        <wind>
          <s>16</s>
          <gust>N/A</gust>
          <d>336</d>
          <t>NNW</t>
        </wind>
        <bt>M Sunny</bt>
        <ppcp>0</ppcp>
        <hmid>30</hmid>
      </part>
      <part p="n">
        <icon>33</icon>
        <t>Mostly Clear</t>
        <wind>
          <s>11</s>
          <gust>N/A</gust>
          <d>327</d>
          <t>NNW</t>
        </wind>
        <bt>M Clear</bt>
        <ppcp>0</ppcp>
        <hmid>33</hmid>
      </part>
    </day>
    <day d="3" t="Saturday" dt="Dec 29">
      <hi>21</hi>
      <low>13</low>
      <sunr>7:09 AM</sunr>
      <suns>5:35 PM</suns>
      <part p="d">
        <icon>34</icon>
        <t>Mostly Sunny</t>
        <wind>
          <s>11</s>
          <gust>N/A</gust>
          <d>332</d>
          <t>NNW</t>
        </wind>
        <bt>M Sunny</bt>
        <ppcp>0</ppcp>
        <hmid>32</hmid>
      </part>
      <part p="n">
        <icon>31</icon>
        <t>Clear</t>
        <wind>
          <s>10</s>
          <gust>N/A</gust>
          <d>334</d>
          <t>NNW</t>
        </wind>
        <bt>Clear</bt>
        <ppcp>0</ppcp>
        <hmid>40</hmid>
      </part>
    </day>
    <day d="4" t="Sunday" dt="Dec 30">
      <hi>23</hi>
      <low>14</low>
      <sunr>7:10 AM</sunr>
      <suns>5:35 PM</suns>
      <part p="d">
        <icon>32</icon>
        <t>Sunny</t>
        <wind>
          <s>11</s>
          <gust>N/A</gust>
          <d>336</d>
          <t>NNW</t>
        </wind>
        <bt>Sunny</bt>
        <ppcp>0</ppcp>
        <hmid>39</hmid>
      </part>
      <part p="n">
        <icon>33</icon>
        <t>Mostly Clear</t>
        <wind>
          <s>10</s>
          <gust>N/A</gust>
          <d>331</d>
          <t>NNW</t>
        </wind>
        <bt>M Clear</bt>
        <ppcp>0</ppcp>
        <hmid>45</hmid>
      </part>
    </day>
  </dayf>
</weather>
  #2 (permalink)  
Antiguo 26/12/2007, 16:08
Avatar de royrojas  
Fecha de Ingreso: diciembre-2004
Mensajes: 458
Antigüedad: 19 años, 4 meses
Puntos: 3
Re: Leer XML de Weather.com

Aqui estan estos ejemplos, espero que te sirvan

Crea tu propio lector de RSS en tu página web

Como leer un archivo XML en VB.NET
__________________
roy rojas
Programación en Español: DotNetcr.com
  #3 (permalink)  
Antiguo 14/05/2008, 13:34
 
Fecha de Ingreso: mayo-2008
Mensajes: 13
Antigüedad: 15 años, 11 meses
Puntos: 0
Re: Leer XML de Weather.com

Llegue a la misma situacion que esta persona!
estoy haciendo el sitio del aeropuerto de Armenia www.aia-zvartnots.aero, y necesito que las partidas muestre la temperatura del lugar destino, si bien ya esta funcionando, los de yahoo me pidieron que lo saque.
The Weather channel tambien tiene un xml con la temperatura, en mi caso uso ASP y tampoco encuentro el modo de utilizar los datos.
hasta donde yo sabia habia que poner lo siguiente:
esta url es la verdadera, pueden ver de ahi que es lo que hace.
url= "http://xoap.weather.com/weather/local/NLXX0002?cc=tmp&dayf=1&par=1064301537&key=9869a8bd 1419d3fc"
Set objHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
objHTTP.Open "POST", url, false
objHTTP.send()
For Each objItem in objHTTP.responseXML.SelectNodes("weather/cc/tmp")
clima=objItem.SelectSingleNode("description").text & "<br />"
Next
la cuestion es que no esta entrando al foreach, no se porque.
los xml comunes tienen rss/channel/item y se recorren perfecto, pero este no.
alguno puede ayudar a ambos dos?
desde ya muchisimas gracias!


Ariel.
  #4 (permalink)  
Antiguo 14/05/2008, 14:11
Avatar de royrojas  
Fecha de Ingreso: diciembre-2004
Mensajes: 458
Antigüedad: 19 años, 4 meses
Puntos: 3
Re: Leer XML de Weather.com

aqui esta el ejemplo con ese url del clima que pones ahi.

http://www.forosdotnet.com/viewtopic.php?f=2&t=91
__________________
roy rojas
Programación en Español: DotNetcr.com
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:19.