Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with connecting to yahoo messenger(ymsg) using perl program

Status
Not open for further replies.

wawa88

Programmer
Jun 15, 2008
1
SG
I am new to Perl. Currently i doing some programming related to yahoo messenger on window platform. I got the latest activeperl 5.10. I would like to send and received message via yahoo messenger but i have problem when i run the perl script. And i also need to received attachment file. So i need some help to it. Anyway now the first thing is i can't connect to yahoo messenger. Please help me!!Thanks.

I got the following code: It is receiving message and i save the file as testing.pl

#!perl
use Net::YMSG;
use strict;

my $yahoo = Net::YMSG->new(
id => 'yahoo_id',
password => 'password',
pre_login_url => 'hostname => 'sc126.msg.sp1.yahoo.com',
);
$yahoo->set_event_handler(new ToStdoutEventHandler);
$yahoo->login or die "Can't login Yahoo!Messenger: $!"; # important: $! prints error message;
$yahoo->start;



package ToStdoutEventHandler;
use base 'Net::YMSG::EventHandler';
use strict;

sub ChangeState {}
sub GoesOffline {}
sub GoesOnline {}
sub UnImplementEvent {}

sub ReceiveMessage
{
my $self = shift;
my $event = shift;
printf "%s: %s\n", $event->from, $event->body;
}
__END__

When i run perl testing.pl in command prompt, it showed that unknown error at C:/Perl/site/lib/Net/YMSG.pm line 344.

sub get_connection
{
my $self = shift;
return $self->handle if $self->handle;

my $server = IO::Socket::INET->new( => this is line 344
PeerAddr => $self->{hostname},
PeerPort => $self->get_port,
Proto => 'tcp',
Timeout => 30,
) or die $!;
$server->autoflush(1);
return $self->handle($server);
}


Seriously need help. Thanks you.
 
That module stopped working several years ago, when Yahoo decided to shut down the old protocols just because MSN Messenger was doing the same.

A co-worker of mine has some code for a new Yahoo module he's developing as kinda a side project, but there's not very much interest in such a module so development is really slow.

(I used to be a chatterbot programmer, making bots for AIM, MSN, and Yahoo, and once MSN and Yahoo decided they'd copy eachother in their effort to try to lock out third-party clients by changing their protocols... well, that broke the Yahoo module and nobody's ever released a working version on CPAN since then. There's a module for MSN Messenger though but you'd have to dig around (it's just MSN.pm and therefore didn't have an acceptable namespace for CPAN and was never uploaded there)).

-------------
Cuvou.com | My personal homepage
Project Fearless | My web blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top