<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
body {
	margin-left: 10px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<%
Function GetURL(url) 
Set Retrieval = CreateObject("Microsoft.XMLHTTP") 
With Retrieval 

.Open "GET", url, False
.Send 
GetURL = bytes2bstr(.responsebody)
'对取得信息进行验证，如果信息长度小于100则说明截取失败
if len(.responsebody)<100 then
response.write "获取远程文件 <a href="&url&" target=_blank>"&url&"</a> 失败。"
response.end
end if

End With 
Set Retrieval = Nothing 
End Function
' 二进制转字符串，否则会出现乱码的！
function bytes2bstr(vin) 
strreturn = "" 
for i = 1 to lenb(vin) 
thischarcode = ascb(midb(vin,i,1)) 
if thischarcode < &h80 then 
strreturn = strreturn & chr(thischarcode) 
else 
nextcharcode = ascb(midb(vin,i+1,1)) 
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode)) 
i = i + 1 
end if 
next 
bytes2bstr = strreturn 
end function 
'声明截取的格式，从Start开始截取，到Last为结束
Function GetKey(HTML,Start,Last)
filearray=split(HTML,Start)
filearray2=split(filearray(1),Last)
GetKey=filearray2(0)
End Function

Dim Softid,Url,Html,Title 
'把下面的[襄樊]改成你的城市，就是你城市的天气预报了，可到www.tq121.com.cn里查一下，有没收录你的城市,一般到县级的都有。
if request("tq")="" then
	if request("id")<>"" then
		Url="http://www.weathercn.com/forecast/24time.jsp?sta_id="&request("id")
	else
		Url="http://www.weathercn.com/forecast/24time.jsp?sta_id=54511"
	end if
else
	
	url = "http://www.weathercn.com/forecast/"&request("tq")&".jsp?sta_id="&request("sta_id")
	'response.write url
	'response.End()
end if
aa = right(Url,len(Url)-instr(Url,"?"))
bb = Mid(Url, instr(Url,"/forecast/")+10, instr(Url,"?"))
Url1 = "http://www.weathercn.com/forecast/"&bb
'response.write Url
'response.end()
Html = GetURL(Url) 
'response.Write Html
'response.End()
'搜索要偷取的内容的开始位置
'Str_start = instr(Html, "<html>")target=_blank><FONT 
'Str_end = instr(Html, "</html>")
'Html = Mid(Html, Str_start, Str_end - Str_start)中国气象影视信息网
if request("chengshi")="" then
city = "山西"
else
city = request("chengshi")
end if
Html=replace(Html,"中国气象影视信息网","&nbsp;&nbsp;&nbsp;"&city)
Html=replace(Html,"target=_blank class="," class=")
Html=replace(Html,"http://www.weathercn.com","javascript:;")
Html=replace(Html,"background-color: #4A6595;","")
Html=replace(Html,"BACKGROUND-COLOR: #4a6595","")
Html=replace(Html,"body,td,th","aa")
Html=replace(Html,"24time.jsp?","?tq=24time&")
Html=replace(Html,"qushi.jsp?","?tq=qushi&")
Html=replace(Html,"shikuang.jsp?","?tq=shikuang&")
Html=replace(Html,"life.jsp?","?tq=life&")
Html=replace(Html,"health.jsp?","?tq=health&")
Html=replace(Html,"Health.jsp?","?tq=health&")
Html=replace(Html,"travel.jsp?","?tq=travel&")
Html=replace(Html,"lishi.jsp?","?tq=lishi&")
Html=replace(Html,"/cewolf;jsessionid=","http://www.weathercn.com/cewolf;jsessionid=")
response.Write(Html&"</cache:cache>")
%> 
