arvind
asked on
need a script
Hi, I have a URL from sms company, which will send SMS to anywhere in the world. I would like a script which will ask a value like mobilenumber sendername and message and send the abobe message to SMS URL format.
Here are the URL:
http://partnerweb.some.com/Partner/api41/ChkDevSndMsg41.asp?partner_id=predifined&partner_an=predifined&partner_ap=predifined&partner_phone=needtobedeined(mobile number)&partner_gateway=pr edifined&f rom=predif ined&froma ddr=needto bedefined& msginv=mes sage part.
Note:
[1] The last value did not accept space - means If we want add space we need to give %20 as a space
[2] fromaddr value can be email address or anything less then 14 chr.
[3] predefined - means value that I have to put like login password.
Here are the URL:
http://partnerweb.some.com/Partner/api41/ChkDevSndMsg41.asp?partner_id=predifined&partner_an=predifined&partner_ap=predifined&partner_phone=needtobedeined(mobile number)&partner_gateway=pr
Note:
[1] The last value did not accept space - means If we want add space we need to give %20 as a space
[2] fromaddr value can be email address or anything less then 14 chr.
[3] predefined - means value that I have to put like login password.
ASKER
no I want command line binary which will accept values and send message- like If I got the alerts mail from system- so I can send to my mobile -
example - binary -n 98923 -s (ex .sendername) arvind -m test message
and all the hardcoded values stored in the cfg file
thnx in advance
Arvind
example - binary -n 98923 -s (ex .sendername) arvind -m test message
and all the hardcoded values stored in the cfg file
thnx in advance
Arvind
arvind,
".. command line binary wh..."
What is a command line binary? Do you mean a compiled executable file?
If yes, then how does Perl fit into the picture. Typically, Perl is an interpreted language & cannot be compiled (unless you buy a commercial product that can compile Perl code into an executable format).
Please explain, in plain english, what exactly you are trying to do, & more importantly, how you think Perl can help you.
This will help you get a more accurate answer, faster.
".. command line binary wh..."
What is a command line binary? Do you mean a compiled executable file?
If yes, then how does Perl fit into the picture. Typically, Perl is an interpreted language & cannot be compiled (unless you buy a commercial product that can compile Perl code into an executable format).
Please explain, in plain english, what exactly you are trying to do, & more importantly, how you think Perl can help you.
This will help you get a more accurate answer, faster.
example usage of script below (DOS)
perl send.pl -s arvind -n 11223344 -m "This is a message"
#!/usr/bin/perl
use LWP::Simple;
use Getopt::Std;
use URI::Escape;
#-n number
#-s sender
#-m message
#-i partner id
#-a partner_an
#-g partner_gateway
getopt("nsm",\%args);
$url="http://partnerweb.some.com/Partner/api41/ChkDevSndMsg41.asp?partner_id=$args{i}&partner_an=$args {a}&partne r_ap=predi fined&part ner_phone= $args{n}&p artner_gat eway=$args {g}&from=p redifined& fromaddr=$ args{s}&ms ginv=$args {m}";
$url=uri_escape($url);
#print "url=$url\n";
$result=get($url);
perl send.pl -s arvind -n 11223344 -m "This is a message"
#!/usr/bin/perl
use LWP::Simple;
use Getopt::Std;
use URI::Escape;
#-n number
#-s sender
#-m message
#-i partner id
#-a partner_an
#-g partner_gateway
getopt("nsm",\%args);
$url="http://partnerweb.some.com/Partner/api41/ChkDevSndMsg41.asp?partner_id=$args{i}&partner_an=$args
$url=uri_escape($url);
#print "url=$url\n";
$result=get($url);
ASKER
rj2 shuld I put the predefined values to the URL and args also
ASKER
I tried ur script but it not posting data to URL and even not calling the URL
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi rj2 ,
I did some changes in URL like I'd put some values predined. After that I need to put only number and message is working fine. Thnx for ur help
Further I need some help I'll ask u - becoz we are converting above simple http submit to XMLRPC call.
Arvind
arvind_s@hotmail.com
I did some changes in URL like I'd put some values predined. After that I need to put only number and message is working fine. Thnx for ur help
Further I need some help I'll ask u - becoz we are converting above simple http submit to XMLRPC call.
Arvind
arvind_s@hotmail.com
ASKER
Please find comment below ...
Arvind
Arvind
ASKER
rj2,
Something wornd with my perl module - not script not calling URL. what wud be the worng
Something wornd with my perl module - not script not calling URL. what wud be the worng
Try to uninstall Perl, download updated Perl from http://www.activestate.com
and then reinstall Perl
and then reinstall Perl
Let me explain what i have understood from your comments so far.
* You want a HTML form in which a user can enter mobile number, sender name & some message
* This HTML form will then call a Perl script.
* This Perl script will take all these user entered values, add some more predefined (hardcoded) values, like partner_id, partner_an, partner_ap, partner_gateway & from to a URL & then call this URL.
* The output from the URL will then be displayed by the script.
Let me know if this is correct.
If this is correct, please provide the HTML form that you want to use.
Let me know.