某家用網頁查詢已發送簡訊的連結,找了一個perl程式,套用上去

#!/usr/bin/perl

#$numArgs = $#ARGV + 1;
#print "thanks, you gave me $numArgs command-line arguments.
";

#foreach $argnum (0 .. $#ARGV) {

#   print "$ARGV[$argnum]
";

#}

# Get and print out the headers and body of the CPAN homepage
    use HTTP::Lite;
    $http = new HTTP::Lite;
#    $req = $http->request("http://api.message.com.tw/query.php?gid=1133&id=帳號&password=$ARGV[$argnum]")
    $req = $http->request("http://api.message.com.tw/query.php?gid=1133&id=帳號&password=密碼")
        or die "Unable to get document: $!";
    die "Request failed ($req): ".$http->status_message()
      if $req ne "200";
    @headers = $http->headers_array();
    $body = $http->body();
    foreach $header (@headers)
    {
      print "$header$CRLF";
    }
    print "$CRLF";
    print "$body$CRLF";

# POST a query to the dejanews USENET search engine
#    use HTTP::Lite;
#    $http = new HTTP::Lite;
#    %vars = (
#             "QRY" => "perl",
#             "ST" => "MS",
#             "svcclass" => "dncurrent",
#             "DBS" => "2"
#            );
#    $http->prepare_post(\%vars);
#    $req = $http->request("http://www.deja.com/dnquery.xp")
#      or die "Unable to get document: $!";
#    print "req: $req
";
#    print $http->body();

Related posts 相關文章

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。