Skip to content

Commit

Permalink
send-im example script
Browse files Browse the repository at this point in the history
  • Loading branch information
sartak committed Aug 18, 2009
1 parent a1dc1b3 commit b6ddfd9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/send-im
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env perl
use strict;
use warnings;
use IM::Engine;
use Getopt::Whatever;

my $protocol = delete $ARGV{protocol};
my $recipient = (delete $ARGV{recipient}) || $ENV{USER};

my $engine = IM::Engine->new(
interface => {
protocol => $protocol,
credentials => \%ARGV,
},
);

$engine->send_message(
IM::Engine::Outgoing->new(
recipient => IM::Engine::User->new(
name => $recipient,
),
message => "@ARGV",
),
);

0 comments on commit b6ddfd9

Please sign in to comment.