私は地元のポータルで働いており、ウェブサイトの天気は毎日更新する必要があります。時間が経つにつれて、私は非常に厄介だと感じたので、タイミングのあるニュース泥棒を書きました。システム要件を参照してください。
これが泥棒の内容です:
| Filename Tianqi.asp Niaooked QQ40861119による書き込み www.knowsky.com <% 時間(現在)= 9および分(現在)<30の場合 getCategories() ifを終了します 関数getCategories() エラーの再開時に次に再開します オブジェクトとしてdim oxmlhttp ' dim ocategories 'asオブジェクト Dim BodyText DIM POS、POS1 set oxmlhttp = createObject(microsoft.xmlhttp) '--- xmlhttp呼び出しを設定してsend(カテゴリとして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 = strust(bodytext、<body) pos1 = instr(bodytext、</body>) bodytext = mid(bodytext、pos、pos1) bodytext = split(bodytext、<テーブル) pos = strust(bodytext(4)、<tr) pos1 = strust(bodytext(4)、</tr>) body = mid(bodytext(4)、pos、len(bodytext(4))-pos) ボディ=スプリット(ボディ、</テーブル>) body1 = split(置き換え(置換(body(0)、<br>、)、</td>、)、</tr>、)、天気) i = 1 to Ubund(body1)の場合 body3 = split(body1(i)、<td) 天気=天気&document.write(&i&$&weather&htmlencode(trim(body3(0)))&&vbcrlf 次 天気=交換(天気、1 $、<フォント色=#fffffffff今日】</フォント>) 天気=交換(天気、2 $、<フォント色=#ffffff >【/フォント>) 天気=交換(天気、3 $、<フォント色=#fffffffff >【翌日】</フォント>) fs = createObject(scripting.filesystemObject)を設定します f = fs.createTextfile(request.servervariables(appl_physical_path)&tq.js、true) f.write(document.write( 'mianyang天気予報:');&vbcrlf&置換(天気、<br>、)) f.close f =何も設定しません fs = Nothingを設定します Response.Write Mianyang天気予報:&天気 oxmlhttp =何も設定しません err.Number <> 0の場合 エラー応答がありました。書き込み、エラー説明:&err.description&<br>エラーソース&err.source Response.End() ifを終了します エンド関数 関数bytestobstr(body、cset) DIM OBJSTREAM 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 = Nothingを設定します エンド関数 パブリック機能htmlencode(fstring) そうでない場合は(fstring) fstring =置換(fstring、>、>) fstring =置換(fstring、<、<) fstring = falling(fstring、chr(32)、) '  fstring = falling(fstring、chr(9)、) '  fstring = cheplage(fstring、chr(34)、") fstring = cheplage(fstring、chr(39)、') '単一の引用フィルタリング fstring =置換(fstring、chr(13)、) fstring = ealling(fstring、chr(10)&chr(10)、</p> <p>) fstring = ealling(fstring、chr(10)、<br>) htmlencode = fstring ifを終了します エンド関数 %> |