Solved

need a script

Posted on 2002-03-03
11
170 Views
Last Modified: 2008-03-03
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=predifined&from=predifined&fromaddr=needtobedefined&msginv=message 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.
0
Comment
Question by:arvind
  • 6
  • 3
  • 2
11 Comments
 
LVL 16

Expert Comment

by:maneshr
ID: 6838214
arvind,

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.
0
 
LVL 5

Author Comment

by:arvind
ID: 6840103
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
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6842089
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.

0
 
LVL 10

Expert Comment

by:rj2
ID: 6848262
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}&partner_ap=predifined&partner_phone=$args{n}&partner_gateway=$args{g}&from=predifined&fromaddr=$args{s}&msginv=$args{m}";

$url=uri_escape($url);

#print "url=$url\n";

$result=get($url);




0
 
LVL 5

Author Comment

by:arvind
ID: 6850938
rj2 shuld I put the predefined values to the URL and args also
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Author Comment

by:arvind
ID: 6851006
I tried ur script but it not posting data to URL and even not calling the URL
0
 
LVL 10

Accepted Solution

by:
rj2 earned 200 total points
ID: 6852598
Try again as shown below
perl send.pl -s arvind -n 11223344 -m "This is a message" -i id -a partneran -g gateway

You could also modify the script to read the three last values from a file instead

Are you sure the URL you provided in your question is correct?
There is no site called http://partnerweb.some.com
Try replacing this URL with the correct URL


#!/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("nsmiag",\%args);


$url="http://partnerweb.some.com/Partner/api41/ChkDevSndMsg41.asp?partner_id=$args{i}&partner_an=$args{a}&partner_ap=predifined&partner_phone=$args{n}&partner_gateway=$args{g}&from=predifined&fromaddr=$args{s}&msginv=$args{m}";

$url=uri_escape($url);

#print "url=$url\n";

$result=get($url);

print "$result\n";
0
 
LVL 5

Author Comment

by:arvind
ID: 6853200
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
0
 
LVL 5

Author Comment

by:arvind
ID: 6853203
Please find comment below ...
Arvind
0
 
LVL 5

Author Comment

by:arvind
ID: 6853592
rj2,

Something wornd with my perl module - not script not calling URL. what wud be the worng
0
 
LVL 10

Expert Comment

by:rj2
ID: 6854262
Try to uninstall Perl, download updated Perl from http://www.activestate.com
and then reinstall Perl

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now