#!/usr/bin/env perl -w use Irssi; use LWP::Simple; use strict; use vars qw($VERSION %IRSSI); my $VERSION = '0.1'; my %IRSSI = ( authors => 'James Newton', contact => 'james@sindacio.us', name => 'AUTO MEME', description => 'Spout random crap from automeme.net', license => 'Public Domain', ); print CLIENTCRAP "AUTOMEME.PL VERSION $VERSION"; sub cmd_meme { my $meme = get('http://api.automeme.net/text?lines=1'); my ($data, $server, $witem) = @_; if ($witem) { $witem->command("MSG $witem->{name} $meme"); } else { Irssi::print('No active channel or query in this window.'); } } Irssi::command_bind('meme', 'cmd_meme');