http://www.perlmonks.org?node_id=72672

As a sequal on my previous CUFP, here's a way to reply to private messages... this chunk is ofcourse based on lhoward's node too... (no XML this time, sorry OeufMayo :) )
Update: Tweaked some Monestary related things... Thanks epoptai
#!/usr/bin/perl use LWP::UserAgent; use URI::URL; use HTTP::Cookies; IRC::register("Monk Messenger", "0.1", "", ""); IRC::print "\0035:: Loading Monk Messenger ::\003\n"; IRC::add_command_handler("msgmonk", "msg_monk"); sub msg_monk { my $message = @_[0]; $message = substr($message,0,255); ($user,$message) = split(/ /,$message,2); my $pm_user=''; # Monk alias my $pm_password=''; # Monk password my $WWWAgent = new LWP::UserAgent(); my $co=new HTTP::Cookies(file=>'./cookies.dat',autosave=>1,ignore_ +discard=>1); $WWWAgent->cookie_jar($co); my $url=new URI::URL 'http://www.perlmonks.org/index.pl'; $url->query_form(op => "login",node_id => "16046",user => $pm_user +,passwd => $pm_password,expires=> "+10y"); my $WWWRequest = new HTTP::Request 'GET', $url->as_string() ; my $WWWResult = $WWWAgent->request($WWWRequest); die "Error logging in $WWWResult->code $WWWResult->message" if(!$W +WWResult->is_success); $url=new URI::URL 'http://www.perlmonks.org/index.pl'; $url->query_form(op => 'message',node=>"16046", message=>"/msg $us +er $message"); $WWWRequest = new HTTP::Request 'GET', $url->as_string() ; $WWWResult = $WWWAgent->request($WWWRequest); die "Can't load Monk Messanger $WWWResult->code $WWWResult->messag +e" if(!$WWWResult->is_success); IRC::print "you said $message to $user\n"; 1; }
You can put this in your .xchat directory to get automatically loaded on startup...
How this works : /msgmonk <monk> <message> ,like in CB... (Something like "/msgmonk Beatnik hey dude your code sucks" will ofcourse work :-|)

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.