나는 현지 포털에서 일하며 웹 사이트의 날씨는 매일 업데이트되어야합니다. 시간이 지남에 따라 나는 꽤 번거로운 느낌이 들었습니다. 그래서 나는 시간이 지정된 뉴스 도둑을 썼고, 시스템 요구 사항을 참조하십시오. 지원 FSO, 서버 UDP TCP/IP가 차단되지 않았습니다.
도둑의 내용은 다음과 같습니다.
| filename tianqi.asp niaooked qq408611119에 의해 작성하십시오 www.knowsky.com <% 시간 (지금) = 9와 분 (현재) < 30 인 경우 getCategories () 끝 If 함수 getCategories () 다음에 오류가 재개됩니다 객체로서 Dim Oxmlhttp ' Dim Ocategories '는 객체로서 희미한 바디 텍스트 Dim Pos, POS1 set oxmlhttp = createobject (microsoft.xmlhttp) '--- xmlhttp 호출을 설정하고 발송합니다 (Parm No Parm은 범주로 '----는 URL에 포함되어 있습니다 oxmlhttp.open get, http : //weather.china.com.cn/travel_gntq.php? cityId = 56196 & cityName = Mianyang, False '이 장소는 자신의 주소로 변경됩니다. oxmlhttp.send '--- 응답을 카테고리 데이터 섬에로드하십시오 BodyText = oxmlhttp.ResponseBody BodyText = ByTestObstr (BodyText, GB2312) pos = instr (bodytext, < body) pos1 = instr (bodytext, </body >) BodyText = MID (BodyText, POS, POS1) bodytext = split (bodytext, < 테이블) pos = instr (bodytext (4), < tr) pos1 = instr (bodytext (4), </tr>) Body = MID (BodyText (4), POS, Len (BodyText (4))-POS) body = split (body, (/table >) body1 = split (replace (replace (body (0), <br>,), </td>,), </tr>,), 날씨)) i = 1에서 Ubund (body1)의 경우 body3 = split (body1 (i), < td) Weather = Weather & Document.write (& i & $ & weather & htmlencode (trim (body3 (0)) &); 다음 날씨 = 교체 (날씨, 1 $, < font color =#ffffffff >【 오늘 】</font >) 날씨 = 교체 (날씨, 2 $, < 글꼴 색상 =#ffffff >【 내일 】</font >) 날씨 = 교체 (날씨, 3 $, < 글꼴 색상 =#ffffffff >【 매일 】</font >) set fs = createobject (scripting.filesystemobject) set f = fs.creatextfile (request.servervariables (appl_physical_path) & tq.js, true) F.Write (Document.Write ( 'Mianyang Weathergast :'); & vbcrlf & Replace (Weather, <br>,)) f.close f = 아무것도 설정하지 않습니다 fs = 아무것도 설정하지 않습니다 응답. Mianyang 일기 예보 : & 날씨 oxmlhttp = 아무것도 설정하지 않습니다 err.number umber 0이면 오류 응답이있었습니다 .Write, 오류 설명 : & err.Description & <BR> 오류 소스 & err.source 응답 () 끝 If 엔드 기능 기능 bytestobstr (body, cset) 희미한 objstream set objstream = server.createobject (adodb.stream) objstream.type = 1 objstream.mode = 3 objstream.open objstream.write body objstream.position = 0 objstream.type = 2 objstream.charset = cset bytestobstr = objstream.readtext objstream.close objstream = 아무것도 설정하지 않습니다 엔드 기능 공개 기능 htmlencode (fstring) 그렇지 않다면 (fstring) fstring = replace (fstring, >, & gt;) fstring = replace (fstring, <, & lt;) fstring = 교체 (fstring, chr (32),) '& nbsp; fstring = replace (fstring, chr (9),) '& nbsp; fstring = 교체 (fstring, chr (34), ") fstring = replace (fstring, chr (39), ') '단일 견적 필터링 fstring = 교체 (fstring, chr (13),) fstring = replace (fstring, chr (10) 및 chr (10), </p> < p>) fstring = replace (fstring, chr (10), <br>) htmlencode = fstring 끝 If 엔드 기능 %> |