GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::SMS::PChome(3) User Contributed Perl Documentation Net::SMS::PChome(3)

Net::SMS::PChome - Send SMS messages via the sms.pchome.com.tw service.

  use strict;
  use Net::SMS::PChome;

  my $sms = new Net::SMS::PChome;
     $sms->login('username', 'password', 'auth_code');
     $sms->smsRecipient('0912345678');
     $sms->smsSend("The SMS be send by PChome SMS Service!");

  if($sms->is_success) {
     print "Successfully sent message to ".$sms->successcount." number!\n";
  } else {
     print "Something went horribly wrong!\n".
           "Error: ".$sms->resultmessage." (".$sms->resultcode.")".
  }

or, if you like one liners:

  perl -MNet::SMS::PChome -e 'send_sms("pchome_username", "pchome_password", "auth_code", "recipient", "messages text")'

Net::SMS::PChome allows sending SMS messages via <http://sms.pchome.com.tw/>

new creates a new Net::SMS::PChome object.

baseurl
Defaults to <http://sms.pchome.com.tw/jsp/smslong.jsp>
ua
Configure your own WWW::Mechanize object, or use our default value.
username
Your pchome.com.tw username
password
Your pchome.com.tw password
authcode
Your PChome Micro Payment System authcode
smsMessage
The actual SMS text
smsType
Defaults to 1, but could be set to 2

1 mean send SMS now. 2 mean send SMS at a delivery date.

smsEncode
Defaults to BIG5, but could be set to ASCII

BIG5: the SMS context in Chinese or Engilsh, the max of SMS context length is 70 character. ASCII: the SMS context in Engilsh, the max of SMS context length is 140 character.

smsDeliverydate
smsDeliverydate mean send SMS at a reserved time.

Its format is YYYYMMDDHHII.

Example: 200607291730 (mean 2006/07/29 17:30)

All these options can be set at creation time, or be set later, like this:

  $sms->username('my_username');
  $sms->password('my_password');
  $sms->smsType('2');
  $sms->smsDeliverydate('200608141803');  # Send SMS at 2006/08/14 PM 06:03.

Set the username, password and authcode in one go.

  $sms->login('my_pchome_username', 'my_pchome_password', 'my_pchome_authcode');

  # is basically a shortcut for

  $sms->username('my_pchome_username');
  $sms->password('my_pchome_password');
  $sms->authcode('my_pchome_authcode');

Without arguments, it will return the array containing username, password and authcode.

   my ($username, $password, $authcode) = $sms->login();

Push numbers in the recipients array

  foreach(qw/0912345678 0987654321 0912920542/) {
     $sms->smsRecipient($_);
  }

Send the actual message. If this method is called with an argument, it's considered the message. Returns true if the sending was successful, and false when the sending failed (see resultcode and resultmessage).

Returns true when the last sending was successful and false when it failed.

Returns the resulting code.

When LWP::UserAgent reports an error, the resultcode will be set to "-999".

Returns the result message, as provided by sms.pchome.com.tw, or LWP::UserAgent.

    send_sms

You can find information about PChome SMS Service at :

   http://sms.pchome.com.tw/

Tsung-Han Yeh, <snowfly@yuntech.edu.tw>

Copyright (C) 2006 by Tsung-Han Yeh

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

2006-08-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.