Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hello Monks,

I'm working on a new project called Net::IM, which has the aim of being for Perl what libpurple is for C/C++ - a set of modules for interacting with various instant messaging networks.

The first network I'm developing a module for is Yahoo Messenger, because Net::YMSG has been broken for 7 years, and there is already code out there for AIM and MSN and various other networks.

The code is still in development, and it has a Google Code project at http://code.google.com/p/perl-net-im/.

Currently, YMSG support is working well enough to run a chatterbot on it if you wanted. It supports:
  • Signing in, sign out
  • Send/receive instant messages
  • Send/receive typing notifications
  • Upload an avatar (PNG file) for itself
  • Accept new add requests
Adding/removing contacts from its contact list isn't fully implemented yet.

How It's Used

Your code can use Net::IM itself, which will allow you to manage multiple connections to multiple networks with just the one Net::IM object. This would be most similar to libpurple/Pidgin. Or, you can use the network modules directly, like Net::IM::YMSG.

Example:

my $im = Net::IM->new(debug => 1); my $yahoo = $im->addConnection ( network => "YMSG", username => "aidenrive", password => "big-secret", hexdump => 1, ); $im->addHandlers ( connected => \&on_connected, notification => \&on_notification, Message => \&on_message, Attention => \&on_buzzed, AddRequest => \&on_added, Typing => \&on_typing, BuddyStatus => \&on_buddy_status, BuddyList => \&on_buddylist, BuddyOnline => \&on_buddy_online, BuddyOffline => \&on_buddy_offline, Disconnected => \&on_disconnected, BuddyIconDownloaded => \&on_icon_downloaded, BuddyIconUploaded => \&on_icon_uploaded, ); $im->login(); $im->run();
The method names and event names are to be kept consistent among all the supported networks. So, setting handlers in Net::IM will cause those handlers to be called by every network that has a handler for that event.

Check it out if you have any interest. I plan on implementing thorough support for as many networks as possible (including file transfers and tricky things like that).


In reply to Net::IM - Instant Messaging for Perl by Kirsle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (11)
    As of 2015-07-03 11:40 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (51 votes), past polls