*99の指定したCGIを*00が作るスレ (327レス)
*99の指定したCGIを*00が作るスレ http://medaka.5ch.io/test/read.cgi/php/1037501017/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
リロード規制
です。10分ほどで解除するので、
他のブラウザ
へ避難してください。
299: nobodyさん [ ] 03/05/21 18:33 ID:??? SARSの死者の自動カウントCGI http://medaka.5ch.io/test/read.cgi/php/1037501017/299
254: nobodyさん [sage] 03/01/15 01:19 ID:??? >>299 Age2chを越える荒らしツール依頼よろ http://medaka.5ch.io/test/read.cgi/php/1037501017/254
310: perlお勉強中 [sage] 03/07/12 16:37 ID:??? >>299のネタ #/usr/local/bin/perl use Socket; use FileHandle; # 最新のURLを探索 $list_url = 'http://www.who.int/csr/sars/country/en/'; $key = 'Full text'; &http_connect; while (<SOCKET>) { last if(/$key/); } close(SOCKET); # SARS情報を取得 $list_url="http://www.who.int".$&."/" if(m!(/[\w\.\~\-\/\?\&\+\=\:\@\%\;\#\%]+)!); $list_url =~ s/entity\///; $key = 'Total'; &http_connect; while (<SOCKET>) { last if(/$key/); } # 行数決め打ちで死亡者数を切り出し for($i=0;$i<24;$i++) {$number=<SOCKET>;} $number =~ m/\d+/; $number = $&; #結果表示 print "Content-type: text/html\n\n"; print "<html lang=\"jp\"><body>"; print "SARSによる死者数は$number人です\n<br>"; print "ソ\ース:$list_url\n</body></html>\n"; close(SOCKET); exit; http://medaka.5ch.io/test/read.cgi/php/1037501017/310
311: perlお勉強中 [sage] 03/07/12 16:38 ID:??? >>299のネタ#2 # socket接続 sub http_connect { $list_url =~ m!(http:)?(//)?([^:/]*)?(/.*)?!; if ($3) {$_host = $3;} if ($4) {$_path = $4;} $_ip = inet_aton($_host) || die "host($_host) not found.\n"; $_sockaddr = pack_sockaddr_in(80, $_ip); socket(SOCKET, PF_INET, SOCK_STREAM, 0) || die "socket error.\n"; # ソケットの接続 connect(SOCKET, $_sockaddr) || die "connect $_host error.\n"; autoflush SOCKET (1); # HTTP要求を送信 print SOCKET "GET $_path HTTP/1.1\n"; print SOCKET "Host: $_host\n"; print SOCKET "Connection: close\n\n"; # HTTP応答を受信 while (<SOCKET>) { last if(/^\n$/); } } http://medaka.5ch.io/test/read.cgi/php/1037501017/311
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.009s