in reply to like DBI - but for IM

Describe your ideal API in a reply to this post and either someone will write it or you'll realize it's so simple that you'll write it.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: DBI - but for IM
by qbxk (Friar) on Jan 01, 2006 at 16:33 UTC
    I suppose it would be something akin to (nonexistent module) Net::IM - maybe read thusly:

    my $im = new Net::IM; $im->on_connect( &on_connect_handler ); $im->on_im_recv( &on_im_recv_handler ); $im->connect( 'Net::OSCAR', $username, $password ); $im->send_im( $to_user, $msg ); sub on_im_recv_handler { my ($user, $msg) = @_; print localtime() . "\tYou recieved an im from $user!\n\t\t$msg\n\n +"; }

    It's not what you look like, when you're doin' what you’re doin'.
    It's what you’re doin' when you’re doin' what you look like you’re doin'!
         - Charles Wright & the Watts 103rd Street Rhythm Band
      This sounds like a good exercise for you to undertake. This will teach you about factories and APIs, both as a user and as a designer.

      Seriously - this would probably take you about a week to get working with 2 of the protocols you mentioned. Write tests. :-)


      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?