• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: Gary Shainberg <email@hidden>
  • Date: Thu, 21 Feb 2002 21:24:58 +0000

List members,

Some help for a new AppleScripter, please

What I am trying to do is parse some data from Intermapper on an OSX box (using AppleScript) into a perl script to send to an application that sends text messages messages on our network.

The perl script is below and as you can see currently takes some data from a webform and then uses this script to send the data using the http post command to post it to the URL which happened to be on another server.

The aim is to have Intermapper send it's alerts to our sms gateway which can only accept data from a "post" command (if that makes sense).

Any help would be appreciated.

Please mail me back direct

Regards

Gary Shainberg


********
*******
#! /usr/bin/perl -w

use CGI ;
use LWP::UserAgent ;
use HTTP::Request::Common qw(POST) ;
use Net::SMTP;

my $user = "xxxxx" ;
my $pass = "xxxxx" ;

my $q = new CGI ;
my $message = $q->param('message') ;
my $phone = $q->param('number') ;
my $flash = $q->param('flash') ;

my $ua = LWP::UserAgent->new();
my $req = POST "http://sms.labs.bt.com/IgniteSolns/sms-bin/wapper.pl"; ,
[user => $user,
pass => $pass,
number => $phone,
message => $message,
flash => $flash,
] ;
my $response = $ua->request($req);
print $q->header ;
print $response->content ;

$MailServer = 'post.techtrek.net';

$smtp = Net::SMTP->new($MailServer);

$from = "gary\@techtrek.net";
$to = "gary\@techtrek.net";
$subject = "$phone has been sent an SMS";

$body = "To: $phone\n \nMessage: $message\n";

$smtp->mail($from);
$smtp->to($to);

$smtp->data();
$smtp->datasend("To: ", $to, "\n");
$smtp->datasend("Subject: ", $subject, "\n");
$smtp->datasend("\n");
$smtp->datasend($body);
$smtp->dataend();
$smtp->quit;

exit();
--
Gary Shainberg
email@hidden

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: properties of quark xpress text box
  • Next by Date: Re: Newbies Question...
  • Previous by thread: Re: (no subject)
  • Next by thread: quick postscript re coercing integer to real
  • Index(es):
    • Date
    • Thread