Return to Snippet

Revision: 7911
at August 20, 2008 12:33 by LondonWeb


Initial Code
<%
Dim StrUrl, strCorpo, strTemperatura, StrSensacao, StrImagem, StrClima, StrCidade
Dim arr, arrTemperatura, ArrClima, ArrImagem, ArrSensacao, ArrCidade
Dim objXMLHTTP, strXmlHttp
StrUrl = "http://br.weather.com/weather/local/BRXX0109" 'url da cidade desejada            
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "get", StrUrl,false        
objXMLHTTP.send
strXmlHttp = objXMLHTTP.responseText
set objXMLHTTP = nothing

function limpa(str)
    Dim var
    var = replace(trim(str),"""","")    
    var = replace(var,">","")
    var = replace(var,"xt","")    
    var = replace(var,"TeT","T")    
    var = replace(var,"Text","")    
    var = replace(var,"OP","")    
    var = replace(var,"Sensa&ccedil;&atilde;o de&nbsp;","")        
    limpa=var
end function


'Array global para pegar apenas a tabela que contem as informações desejadas
arr=split(strXmlHttp,"<!-- insert reported by and last updated info -->")
strCorpo = mid(arr(1),1,6300)

Initial URL

                                

Initial Description

                                

Initial Title
XML HTTP request Weather

Initial Tags
http, xml, web, service

Initial Language
ASP