need Net::AIMTOC help
am 18.05.2005 16:40:19 von DFS
Hello all,
Hoping someone here has some experience with the Net::AIMTOC module, which
have just started to play with. Below is the complete working test sample i
made, with the exception being the three ----insert somethign here------
lines.
I know that the module works to the point of signing on. Since I keep the
same screenname up on my AIM, when I run this module, it gets logged off of
AIM, saying someone else signed on with same name. However, the IM never
seems to get sent.
Was hoping someone had some experience with this module and coudl shed some
light for me. Thanks!
Daniel
#!/usr/bin/perl
use warnings;
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Net::AIMTOC;
my $q = new CGI;
my $aim = Net::AIMTOC->new;
my $screenname = "----insert screenname here------";
my $password = "----insert password here------";
my $buddy = "----insert screenname to IM here------";
my $msg = "Hello World\n";
my $out;
$aim->connect;
$aim->sign_on( $screenname, $password );
my $msgObj = $aim->recv_from_aol;
$out = $msgObj->getMsg . "
";
$aim->send_im_to_aol( $buddy, $msg );
$msgObj = $aim->recv_from_aol;
$out .= $msgObj->getMsg;
$aim->disconnect;
print $q->header();
print $out;
exit 0;
Re: need Net::AIMTOC help
am 18.05.2005 18:36:26 von John Bokma
daniel kaplan wrote:
> I know that the module works to the point of signing on. Since I keep
> the same screenname up on my AIM, when I run this module, it gets
> logged off of AIM, saying someone else signed on with same name.
> However, the IM never seems to get sent.
Does the call to send block until it's finished, or return immediately?
In case of the latter, it might be the case that you close the connection
before the message is actually send out.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Re: need Net::AIMTOC help
am 18.05.2005 22:51:08 von DFS
"John Bokma" wrote in message
news:Xns965A76139E080castleamber@130.133.1.4...
> daniel kaplan wrote:
>
> Does the call to send block until it's finished, or return immediately?
> In case of the latter, it might be the case that you close the connection
> before the message is actually send out.
Can't tell if it does or doesn't. The code I posted in the OP is the sample
code from the CPAN, in the module. So am a little screwed, cause Googlling
ain't giving me any anwsers either. Help!
What's a guy to do in this situation?
Re: need Net::AIMTOC help
am 18.05.2005 23:48:48 von John Bokma
daniel kaplan wrote:
> "John Bokma" wrote in message
> news:Xns965A76139E080castleamber@130.133.1.4...
>> daniel kaplan wrote:
>>
>> Does the call to send block until it's finished, or return
>> immediately? In case of the latter, it might be the case that you
>> close the connection before the message is actually send out.
>
> Can't tell if it does or doesn't. The code I posted in the OP is the
> sample code from the CPAN, in the module. So am a little screwed,
> cause Googlling ain't giving me any anwsers either. Help!
>
> What's a guy to do in this situation?
catch Net::AIMTOC::Error with {
my $err = shift;
print $err->stringify, "\n";
};
Can't remember if I saw that in your code, guess not.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Re: need Net::AIMTOC help
am 19.05.2005 00:50:35 von DFS
"John Bokma" wrote in message
news:Xns965AAB0356C01castleamber@130.133.1.4...
> daniel kaplan wrote:
> catch Net::AIMTOC::Error with {
> my $err = shift;
> print $err->stringify, "\n";
>
> };
>
> Can't remember if I saw that in your code, guess not.
this is my current app, and still the same:
#!/usr/bin/perl
use warnings;
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Net::AIMTOC;
use Error qw( :try );
my $q = new CGI;
my $screenname = "---insert signon---";
my $password = "---insert password---";
my $out = ();
try {
my $aim = Net::AIMTOC->new;
$aim->connect;
$aim->sign_on( $screenname, $password );
my $msgObj = $aim->recv_from_aol;
$out = $msgObj->getType() . "";
$out .= $msgObj->getRawData(). "
";
$aim->send_im_to_aol( '---insert buddy---', '---insert password---' );
$aim->disconnect;
print $q->header();
print $out;
exit 0;
}
catch Net::AIMTOC::Error with {
my $err = shift;
$out = $err->stringify;
};
print $q->header();
print $out;
exit 0;
Re: need Net::AIMTOC help
am 19.05.2005 20:37:45 von John Bokma
daniel kaplan wrote:
> this is my current app, and still the same:
>
> #!/usr/bin/perl
>
> my $out = ();
my $out;
Does the script print anything at all? Oh, and since the print + exit is
exacly the same as the code after the catch, I would remove it (the script
will skip the catch if there is nothing to catch).
Did you view the source of the page you output?
Does the script run on the command line (shell)?
Did you check your error log?
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Re: need Net::AIMTOC help
am 21.05.2005 05:38:01 von jgamble
In article <1116456646.253455@nntp.acecape.com>,
daniel kaplan wrote:
>"John Bokma" wrote in message
>news:Xns965AAB0356C01castleamber@130.133.1.4...
>> daniel kaplan wrote:
>> catch Net::AIMTOC::Error with {
>> my $err = shift;
>> print $err->stringify, "\n";
>>
>> };
>>
>> Can't remember if I saw that in your code, guess not.
>
>this is my current app, and still the same:
>
>#!/usr/bin/perl
>
>use warnings;
>use strict;
>use CGI;
>use CGI::Carp qw(fatalsToBrowser);
>use Net::AIMTOC;
>use Error qw( :try );
>
>my $q = new CGI;
>my $screenname = "---insert signon---";
>my $password = "---insert password---";
>my $out = ();
>
> try {
^^^^^^^^^^^
"try"?
Unless there's been a massive change lately (entirely possible),
i don't believe that try is a recognized operator. Hmm, or
unless it's added via a module (sorry, can't google and trn at
the same time).
But if i'm right, look up eval.
--
-john
February 28 1997: Last day libraries could order catalogue cards
from the Library of Congress.
Re: need Net::AIMTOC help
am 21.05.2005 09:04:36 von John Bokma
John M. Gamble wrote:
>>use Error qw( :try );
.....
>> try {
>
> ^^^^^^^^^^^
>
> "try"?
>
> Unless there's been a massive change lately (entirely possible),
> i don't believe that try is a recognized operator. Hmm, or
> unless it's added via a module (sorry, can't google and trn at
> the same time).
Doesn't trn support scroll up?
use Error qw( :try );
^^^^
> But if i'm right, look up eval.
No, you're not ;-)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Re: need Net::AIMTOC help
am 31.05.2005 06:52:56 von jgamble
In article ,
John Bokma wrote:
>
>Doesn't trn support scroll up?
>
>use Error qw( :try );
>
> ^^^^
>
Yeah, missed that. Sorry for the waste of time.
>> But if i'm right, look up eval.
>
>No, you're not ;-)
>
--
-john
February 28 1997: Last day libraries could order catalogue cards
from the Library of Congress.