Net::MRIM

Net::MRIM is a Perl implementation of mail.ru agent protocol.
Download

Net::MRIM Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Alexandre Aufrere
  • Publisher web site:
  • http://search.cpan.org/~aau/Net-MRIM-1.08/MRIM.pm

Net::MRIM Tags


Net::MRIM Description

Net::MRIM is a Perl implementation of mail.ru agent protocol. Net::MRIM is a Perl implementation of mail.ru agent protocol.This is a Perl implementation of the mail.ru agent protocol, which specs can be found at http://agent.mail.ru/protocol.htmlSYNOPSISTo construct and connect to MRIM's servers: my $mrim=Net::MRIM->new( Debug=>0, PollFrequency=>5 ); $mrim->hello();To log in: if (!$mrim->login("login@mail.ru","password")) { print "LOGIN REJECTEDn"; exit; } else { print "LOGGED INn"; }To authorize a user: my $ret=$mrim->authorize_user("friend@mail.ru");To add a user to contact list (sends automatically auth request): $ret=$mrim->add_contact("friend@mail.ru");To remove a user from contact list: $ret=$mrim->remove_contact("friend@mail.ru");To send a message: $ret=$mrim->send_message("friend@mail.ru","hello");To change user status: $ret=$mrim->change_status(status);Where status=0 means online and status=1 means awayGet information for a contact: $ret=$mrim->contact_info("friend@mail.ru");Search for users: $ret=$mrim->search_user(email, sex, country, online);Where sex=(1|2), country can be found at http://agent.mail.ru/region.txt or in Net::MRIM::Data.pm, and online=(0|1)Analyze the return of the message: if ($ret->is_message()) { print "From: ".$ret->get_from()." Message: ".$ret->get_message()." n"; } elsif ($ret->is_server_msg()) { print $ret->get_message()." n"; }Looping to get messages: while (1) { sleep(1); $ret=$mrim->ping(); if ($ret->is_message()) { print "From: ".$ret->get_from()." Message: ".$ret->get_message()." n"; } }Disconnecting: $mrim->disconnect(); Requirements: · Perl


Net::MRIM Related Software