xxx-api-send.pl

某家用網頁發送簡訊的連結,找了一個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/send.php?gid=1133&id=帳號&password=密碼&tel=電話&msg=$ARGV[$argnum]&mname=寄件者名稱&mtype=G")
    $req = $http->request("http://api.message.com.tw/send.php?gid=1133&id=帳號&password=密碼&tel=電話;電話;電話&msg=$ARGV[$argnum]&mname=寄件者名稱&mtype=G")
#   $req = $http->request("http://api.message.com.tw/send.php?gid=1133&id=帳號&password=密碼&tel=電話;電話;電話;&msg=訊息內容&mname=寄件者名稱&mtype=G")
        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();

評論: 0 | 引用: 0 | 閱讀: 848 | 列印 | 文件 | 轉發

發表評論
暱 稱: 密 碼:
網 址: E - mail:
驗證碼: 驗證碼圖片 選 項:
頭 像:
內 容:
  • 粗體
  • 斜體
  • 底線
  • 插入圖片
  • 超連結
  • 電子郵件
  • 插入引用
  • 表情符號