#!/usr/bin/perl use strict; use warnings; use File::Spec (); BEGIN { use lib File::Spec->catdir( Xchat::get_info('xchatdir'), 'lib' ); } use N0i::Xchat::GoogleMoron; my $moron = N0i::Xchat::GoogleMoron->new or die "Fucked up. :(\n"; $moron->register; $moron->set_hooks( [ 'command', 'moron', sub { my ($txt, $error) = $moron->moron($_[1]->[1]); if ($error) { Xchat::print('ERROR: ' . $error); } else { Xchat::command("say $txt"); } Xchat::EAT_ALL; }, { help_text => '\cC11/moron\cO <\x02nick\x02> <\x02Google query string\x02>' } ] ); $moron->loaded;