Gentoo Archives: gentoo-user

From: Stroller <stroller@××××××××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: [gentoo-user] OT: a script involving an IRC connection
Date: Tue, 28 Jul 2009 23:44:08
Message-Id: 30FD2CBF-3343-4F48-A77B-1126763250A2@stellar.eclipse.co.uk
1 Hi there,
2
3 I want to write a script that I'll run on my server & which will
4 connect to an IRC host and send a message to me if I'm logged on
5 there. It can then disconnect from the server (or just plain drop the
6 connection).
7
8 Any suggestions as to how to achieve this?
9
10 I'm reasonably proficient in Bash.
11
12 I think IRC protocol is fairly texty, so maybe I could use `expect` <http://www.linux.com/archive/articles/56066
13 > to automate this. ??
14 (Is the correct package dev-tcltk/expect?)
15
16 But I believe I've been given to understand in the past that use of
17 `expect` is bad practice.
18 What if it doesn't receive the result it expects?
19
20 I believe Perl has some pretty good modules for interacting with IRC.
21 Would this be a good opportunity to learn Perl?
22 I'd rather do this the simplest way possible (that still wossisnames
23 best practices).
24
25 I think a full-blown eggdrop bot would be overkill for this simple task.
26 But I also wondered if it might be possible to call irissi with a
27 scripted set of '\server host.foo.co \nick my_messenger \msg nick
28 "Your message here"' commands?
29
30 Any thoughts?
31
32 Cheers,
33
34 Stroller.