Think about Loose Coupling | |
PerlMonks |
Re: Logging in to cbstream from a scriptby Tanktalus (Canon) |
on Aug 07, 2008 at 20:40 UTC ( [id://702991]=note: print w/replies, xml ) | Need Help?? |
By "Some people" you were politely avoiding mentioning my nick :-P By "trouble" I was pointing out that: a) I had to learn an entirely new manner of coding in perl (Xchat's interface, and hook-programming in general, which seems backwards relative to procedural or OO programming), b) the curve combined with less-than-stellar documentation for the Xchat interface resulted in surprises which were difficult to overcome. I suspect it took me about 5 or 6 hours to get to a working Xchat script (though if I knew what I was doing, it likely would have been less than one hour), whereas if the interface were to be using CGI on the server side, a quick LWP or WWW::Mechanize script would have been whipped out in a matter of five minutes. (In fact, you probably would have had one already for testing with.) Granted, this would be far more work for you than the current method... :-) However, I did get something that seems to work. It doesn't fully auto-login. I haven't yet figured out how to get it to run as I do my initial connect to the FreeNode server, but just typing "/cblog" is sufficiently easy to remember. For others who use Xchat, here is what I ended up with: You'll obviously have to change the user and password near the top. Save this to a file with a .pl extention in your xchat directory (for me on unix, it's ~/.xchat2, on Windows it should be something like "C:\Documents and Settings\youruser\Application Data\X-Chat 2"). I think that will get it autoloading, though I've not really tested to be sure. Then you can just type "/cblog" to log in to cbstream. The surprising bit was that I couldn't merge the "join" command with the "say plogin" command in the same routine. They had to be separate. Update: closing tabs is fine... restoring your last tab is interestingly not. Added code to handle the closing of tabs - though it happens too quick, so I've opted to copy the message over to the #cbstream tab (it doesn't get sent to the IRC server, so your secret of using IRC for CB remains safe).
In Section
Perl Monks Discussion
|
|