IM
Panoptes can interact with instant messaging in a number of different ways.
Currently IM options are limited to protocols that have an IRC gateway. This includes AIM, Yahoo messenger, Jabber, and other IM protocols using Bitlbee.
Panoptes::Monitor::IRC
This plugin will connect to an IRC server and generate event messages for all activity observed, e.g. private messages and activity on public channels.
I like to use this plugin to do bot-less IRC monitoring, i.e. I connect to an IRC proxy/bouncer as my own account. This way panoptes can observe everything I see--all the channels I'm on and notify me if someone sends me a private message or mentions my name.
I tend to run the bouncer/proxy on localhost on some machine with a persistent connection to the irc server. I use the proxy in irssi since that is my favorite IRC client.
On the server, the irssi proxy listens only on 'localhost. Then, on my laptop, I forward the traffic over a port using ssh.
Consistent with the Panoptes::Monitor paradigm, this plugin will not send any messages to irc channels or users--it's receive only. This turns out to be handy since I want it to connect to my personal account in 'read-only' mode, i.e. I never want panoptes to pretend to be me and send out a notification from my personal account. For info on sending messages, see the IRC action.
Here is an example configuration for a couple of IRC servers:
---
myhostname:
plugins:
Panoptes-Monitor-IRC:
servers:
someserver:
nick: mynick
server: localhost
port: 6661
password: asdfjkl
channels:
#somechannel: ''
#otherchannel: ''
otherserver:
nick: othernick
server: someserver.org
port: 6667
channels:
#anotherchannel: ''
Panoptes::Rules::Action::IRC
Before creating a new action, you'll need to be able to configure Panoptes monitors and rules. For more info, see:
The IRC action will allow you to send a message that matched the rule condition to a public IRC channel:
action:
Panoptes-Rules-Action-IRC:
to: '#somechannel'
Or as a private message:
action:
Panoptes-Rules-Action-IRC:
to: 'someuser'
When enabled, this plugin will establish a persistent connection to an IRC server. Using this plugin, panoptes can appear to act more like the typical irc bot, e.g. announcing notifications for updates for monitors that are being fed into the system. The bot does not accept much input other than a simple 'ignore' command that can be used by channel members or private message recipients to suppress message floods with a regexp.
Generally 'interesting' events that are generated by the monitoring system will contain a 'subject' field that contains some meaningful descriptive explanation of the event. The IRC action will currently only notify for messages that contain a subject field.
If the message contains a 'color' field, this plugin will display ANSI color sequences to colorize the irc notifications. Colors can be added or removed by rules.
Putting it all together
Here is an example rule that will match every event with a 'subject' and send it to the #monitor channel. It also contains a rule to suppress some messages that shouldn't be directed to irc.
---
myhostname:
plugins:
Panoptes-Monitor-IRC:
servers:
someserver:
nick: mynick
server: localhost
port: 6661
password: asdfjkl
channels:
#somechannel: ''
#otherchannel: ''
otherserver:
nick: othernick
server: someserver.org
port: 6667
channels:
#anotherchannel: ''
rules:
10_irc_suppress:
condition:
plugin: Panoptes-Monitor-RSS
matches:
site: somesite|someothersite
add_field:
irc_quiet: 1
10_rss_quiet_subject_match:
condition:
plugin: Panoptes-Monitor-RSS
matches:
subject: ignorethis|ignorethat
add_field:
quiet: 1
20_color_slashdot:
condition:
plugin: Panoptes-Monitor-RSS
matches:
site: slashdot
add_field:
color: green
50_irc_message:
condition:
contains:
subject: {}
action:
Panoptes-Rules-Action-IRC:
to: '#monitor'
preload:
Panoptes-Rules-Action-IRC:
server: localhost
port: 6667
nick: panoptibot
channels:
- '#monitor'
51_irc_private_message:
condition:
contains:
subject: {}
errmsg: {}
action:
Panoptes-Rules-Action-IRC:
to: 'vvupod'
Explanation:
Rule 10_irc_suppress is searching for messages for a couple of different sites and setting the irc_quiet flag which prevents the message from being send to IRC.
Rule 10_rss_quiet_subject_match is searching for any RSS feed subjects that match some things I don't want to hear about. They get the global 'quiet' flag which prevents all enabled notification plugins from firing (e.g. console, irc, growl).
Rule 20_color_slashdot colorizes all slashdot notifications in green.
Rule 50_irc_messages searches for all plugins that have a subject and sends them to the #monitor channel. One thing to notice here that was not mentioned previously is that one of your rules must contain a 'preload' value that configures the persistent connection to the IRC server. This 'preload' should only be specified on one IRC rule (only the first one encountered will be enabled, all others will be ignored).
Rule 51_irc_private_message searches for all messages that have an 'errmsg' field and sends them as private messages to the irc account being used by my ipod.
See also: http://www.geekfarm.org/wu/panoptes/ipod_touch_push.html