#!/usr/bin/perl use LWP::Simple; use Jcode; $url = "http://entry.jasc.or.jp/keitai/i/include/xt_login.asp?"; $user = "120986"; $password = "24811470"; $up = "c=2&pUserID=$user&pPassword=$password&r=1"; $c = "$url" . "$up"; open(REQ, "< request.txt"); @request = ; close(REQ); open(RES, "> result.txt"); print RES localtime() . "\n"; # $connect = get($c); # print "$connect"; # exit; # open(FILE , "< result.txt"); # for TEST # @connect = ; # for TEST # @connect = split /\n/ ,; # for TEST @connect = split /\n/ ,get($c); print RES @connect; # print "orig file\n"; # print "@connect"; foreach $line (@connect) { # check userID and SessionID if($line =~ /jwi1001/) { # Yoyaku-bi if($line =~ /.*s=(.{31}).*m=(.{32}).*/) { $s = $1; print RES "USERID=$s\n"; $m = $2; print RES "SESSION=$m\n"; } } } if ($m && $s) { $keitai = "http://entry.jasc.or.jp/keitai/i/" ; foreach $request (@request) { chomp($request); ($month, $day, $code) = split /\t/, $request; $ak = "$keitai" . "jwi1002.asp?" . "s=$s&m=$m" . "&pMONTH=$month&pDAY=$day&pCODE=$code" ; print RES "$ak\n"; $abk = get($ak); print RES $abk; foreach $ck (split /\n/, $abk) { if($ck =~ /value=\"(06)\"/ && $ck =~ /name=\"dm\"/) { print "dm=$1\n"; } elsif ($ck =~ /name=\"dd\"/) { print "dd=dd\n"; } } } } $logout = $keitai . "jwi6001.asp?s=$s&m=$m"; print RES $logout; $res_logout = get($logout); print RES $res_logout; exit();