Foros del Web » Programando para Internet » ASP Clásico »

urge estdo del tiempo

Estas en el tema de urge estdo del tiempo en el foro de ASP Clásico en Foros del Web. tengo una pagina asp que utiliza javascript del lado del servidor para jalar los datos de una pagina web el script es <script language='javascript'> <% ...
  #1 (permalink)  
Antiguo 14/10/2008, 16:31
 
Fecha de Ingreso: octubre-2008
Mensajes: 4
Antigüedad: 15 años, 8 meses
Puntos: 0
urge estdo del tiempo

tengo una pagina asp que utiliza javascript del lado del servidor para jalar los datos de una pagina web el script es
<script language='javascript'>
<%


set ofile = fso.OpenTextFile(straux, 1)
straux = trim(ofile.ReadAll)
straux = mid(straux,instr(straux,"id=current_box_temp"),ins tr(straux,"temp"))
strmsg = mid(straux,InStr(straux,"temp")+5,instr(straux,"te mp"))
strmsg = replace (strmsg,"Â"," ",1,-1,1)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.temphoy.innerHTML='"& strmsg&"';"&vbcrlf)


straux=mid(straux,instr(straux,"id=current_update" ),len(straux))
strmsg= mid(straux,instr(straux,"update"),len(straux))
strmsg=mid(straux,instr(straux,"actualización")+1 5,instr(straux,"actualización")-48)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.actual.innerHTML='"&s trmsg&"';"&vbcrlf)

' imagen hoy '
strmsg=""
straux = mid(straux,(instr(straux,"img src=http")),(len(straux)-instr(straux,"img src=http")))
straux = mid(straux,instr(straux,".gif")-3,(len(straux)-instr(straux,".gif")-4))
straux = mid(straux,instr(straux,"/")+1,(len(straux)-instr(straux,"/")+1))
strmsg = mid(straux,1,instr(straux,".gif")-1)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.imghoy.src='../w_edotpo/yahoo/images/"&strmsg&".gif';"&vbcrlf)




' descripción hoy'
strmsg = ""
response.write("document.all.deschoy.innerHTML='"& strmsg&"';"&vbcrlf)

'maxima'
strmsg=""
straux = mid(straux,(instr(straux,"Max.")+4),(len(straux)-instr(straux,"Max.")+4))
strmsg = mid(straux,1,instr(straux,"&deg")-1)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.maxhoy.innerHTML='"&s trmsg&"';"&vbcrlf)
'minmima'
strmsg=""
straux = mid(straux,(instr(straux,"Min.")+4),(len(straux)-instr(straux,"Min")+4))
strmsg = mid(straux,1,instr(straux,"&deg")-1)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.minhoy.innerHTML='"&s trmsg&"';"&vbcrlf)

'Viento'
strmsg=""
straux = mid(straux,(instr(straux,"id=current_right")),len( straux))
straux = mid(straux,instr(straux,"right"),len(straux))
strmsg= mid(straux,instr(straux,"Viento")+6,instr(straux," Viento")-7)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.viento.innerHTML='"&s trmsg&"';"&vbcrlf)

'Humedad'
strmsg=""
straux = mid(straux,(instr(straux,"id=current_right")),len( straux))
straux = mid(straux,instr(straux,"right"),len(straux))
strmsg = mid(straux,instr(straux,"Humedad")+7,instr(straux, "Humedad")-99)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.humedad.innerHTML='"& strmsg&"';"&vbcrlf)


'Presion atmosferica'
strmsg=""
straux = mid(straux,(instr(straux,"id=current_right")),len( straux))
straux = mid(straux,instr(straux,"right"),len(straux))
strmsg = mid(straux,instr(straux,"Presión"),instr(straux," Presión"))
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.presion.innerHTML='"& strmsg&"';"&vbcrlf)


'Visibility'
strmsg=""
straux = mid(straux,(instr(straux,"Visibilidad</td>")),(len(straux)-instr(straux,"Visibilidad</td>")))
straux = mid(straux,(instr(straux,"<td>")+4),(len(straux)-instr(straux,"<td>")+4))
strmsg = mid(straux,1,instr(straux,"</td")-1)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.visibilidad.innerHTML ='"&strmsg&"';"&vbcrlf)

'Condensacion'
strmsg=""
straux = mid(straux,(instr(straux,"Punto de ")),(len(straux)-instr(straux,"Punto de ")))
straux = mid(straux,(instr(straux,"<td>")+4),(len(straux)-instr(straux,"<td>")+4))
strmsg = mid(straux,1,instr(straux,"</td")-1)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.condensacion.innerHTM L='"&strmsg&"';"&vbcrlf)






'Salida'
strmsg=""
straux = mid(straux,(instr(straux,"Salida del sol</td>")),(len(straux)-instr(straux,"Salida del sol</td>")))
straux = mid(straux,(instr(straux,"<td>")+4),(len(straux)-instr(straux,"<td>")+4))
strmsg = mid(straux,1,instr(straux,"</td")-1)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.salida.innerHTML='"&s trmsg&"';"&vbcrlf)

'Puesta'
strmsg=""
straux = mid(straux,(instr(straux,"Puesta del sol</td>")),(len(straux)-instr(straux,"Puesta del sol</td>")))
straux = mid(straux,(instr(straux,"<td>")+4),(len(straux)-instr(straux,"<td>")+4))
strmsg = mid(straux,1,instr(straux,"</td")-1)
strmsg = replace (strmsg,vbCr," ",1,-1,1)
strmsg = replace (strmsg,vbCrLf," ",1,-1,1)
strmsg = replace (strmsg,vbLf," ",1,-1,1)
strmsg = replace (strmsg,vbNewLine," ",1,-1,1)
response.write("document.all.puesta.innerHTML='"&s trmsg&"';"&vbcrlf)
el problema es que no me lee todos los datos que necesito de la pagina
http://espanol.weather.com/weather/today-Cancun-MXQR0138
necesito ayuda e spara la acrtulizaciòn de una pagina que muestra el estdo del tiempo
  #2 (permalink)  
Antiguo 14/10/2008, 16:54
Avatar de u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 22 años, 5 meses
Puntos: 98
Respuesta: urge estdo del tiempo

Mmmmhhh no...eso no es script del lado del servidor, es un script cliente generado dinámicamente, resulta complicado ayudarte porque tendríamos que saber la fuente de ese script, que al parecer es un archivo de texto plano que de alguna manera es actualizado en tu servidor, parseado por ASP, y genera un javascript que actualiza elementos HTML.

Necesitarías investigar ese archivo plano y ver que datos son los que quieres imprimir, parsearlos me imagino que es lo de menos pues tienes muchos ejemplos ahí mismo.

Saludos
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway
  #3 (permalink)  
Antiguo 15/10/2008, 07:47
 
Fecha de Ingreso: octubre-2008
Mensajes: 4
Antigüedad: 15 años, 8 meses
Puntos: 0
Respuesta: urge estdo del tiempo

es una parte del texto a leer
<DIV id=current_box_icon><IMG class=transparent height=93 alt=""
src="C:\intrades\weather\w_edotpo\yahoo\cancun_arc hivos\28(1).png"
width=93></DIV>
<DIV id=current_box_temp>31°C</DIV>
<DIV id=current_box_cond><FONT color=#666666>Sensación térmica
35°C</FONT><BR></DIV><BR clear=all>
<DIV style="PADDING-TOP: 5px; TEXT-ALIGN: center"><B>Mayormente nublado</B>
</DIV></DIV>
<DIV id=current_updated style="WIDTH: 207px; text-wrap: normal">Última
actualización: 07 oct 2008 11:44 <BR>Hora local (martes, 16:44
GMT)<BR>Observatorio: Cancun </DIV></DIV>
<DIV id=current_right
style="WIDTH: 120px; text-wrap: normal"><STRONG>Viento</STRONG><BR>Del este
noreste a 19 km/h
<BR><BR><STRONG>Humedad</STRONG><BR>62%<BR><BR><STRONG>Presión</STRONG><BR>1,014.22
mb<BR><BR><STRONG>Punto de
rocío</STRONG><BR>23°C<BR><BR><STRONG>Visibilidad</STRONG><BR>11.3 km </DIV>
<DIV id=current_bottom><!--conditional display for upcoming timeframe-->Ver:
&nbsp; <!--display if a holiday appears in the next 10 days --><A
href="http://espanol.weather.com/weather/10day-Cancun-MXQR0138">Yom Kippur</A> <!--else, display if day range is weds to sunday --><!--else, default display --><!--end conditional display--></DIV></DIV><!--display when transition for the today period: from 12am to 2pm local time. -->
<H2>Las probabilidades de hoy</H2>
<DIV id=today_outlook>
<DIV class=outlook_cell>
<DIV class=outlook_cell_header>El pronóstico para hoy</DIV>
<DIV class=outlook_cell_content>
<DIV class=outlook_cell_icon><IMG class=transparent height=61 alt=""
src="cancun_archivos/37.png" width=61> </DIV>
<DIV class=outlook_cell_temp><SPAN
style="FONT-SIZE: 12px; MARGIN-LEFT: 3px">Máxima</SPAN><BR><SPAN
style="FONT-SIZE: 26px">30°</SPAN> </DIV>
<DIV class=outlook_cell_desc>Salida del sol: 06:40 <BR>Probabilidad de precip.
30% <BR>
<DIV style="MARGIN-TOP: 5px; FONT-WEIGHT: bold; COLOR: #333333">Tormentas
aisladas </DIV></DIV></DIV></DIV>
<DIV class=outlook_cell>
<DIV class=outlook_cell_header style="WIDTH: 177px; BORDER-RIGHT-WIDTH: 0px">El
pronóstico para esta noche</DIV>
<DIV class=outlook_cell_content>
<DIV class=outlook_cell_icon><IMG class=transparent height=61 alt=""
src="cancun_archivos/47.png" width=61> </DIV>
<DIV class=outlook_cell_temp><SPAN
style="FONT-SIZE: 12px; MARGIN-LEFT: 3px">Mínima</SPAN><BR><SPAN
style="FONT-SIZE: 26px">24°</SPAN> </DIV>
<DIV class=outlook_cell_desc>Puesta del sol: 18:30 <BR>Probabilidad de precip.
30%<BR>
<DIV style="MARGIN-TOP: 5px; FONT-WEIGHT: bold; COLOR: #333333">Tormentas
aisladas</DIV></DIV></DIV></DIV></DIV></DIV>
<DIV id=today_right>
<DIV id=today_specialty_link>
<DIV style="FLOAT: left">
<H2>Intereses</H2></DIV>
<DIV style="FLOAT: right">
<DIV class=link_arrow><IMG class=aroRight height=11 alt=""
src="cancun_archivos/spacer.gif" width=12></DIV><INPUT type=hidden
value="¿Le gustaría que aparezca este panel cada vez que visita esta página?"
name=personalizeText>
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 02:18.