···11+PipeEvent Adium Plugin
22+33+Copyright (c) 2010 joshua stein <jcs@jcs.org>
44+55+Redistribution and use in source and binary forms, with or without
66+modification, are permitted provided that the following conditions
77+are met:
88+99+1. Redistributions of source code must retain the above copyright
1010+ notice, this list of conditions and the following disclaimer.
1111+2. Redistributions in binary form must reproduce the above copyright
1212+ notice, this list of conditions and the following disclaimer in the
1313+ documentation and/or other materials provided with the distribution.
1414+3. The name of the author may not be used to endorse or promote products
1515+ derived from this software without specific prior written permission.
1616+1717+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1818+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1919+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2020+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2121+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2222+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2323+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2424+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2525+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2626+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
···11+# vim:ts=8:sw=8:tw=80
22+33+PipeEvent Plugin for {Adium}[http://adium.im/]
44+Written by {joshua stein}[mailto:jcs@jcs.org] - {http://jcs.org/}[http://jcs.org/]
55+66+This is a simple plugin that will add a "Pipe event" action that you can add
77+to events, which will pipe the contents of the event text to an executable of
88+your choosing.
99+1010+The most common case would be adding it to the "Message received" event, which
1111+would pipe the content of the incoming message to your program.
1212+1313+To install, download the plugin:
1414+1515+ https://github.com/downloads/jcs/adium-pipemessage/PipeEventPlugin.AdiumPlugin.zip
1616+1717+Unzip it and double-click it. Adium should notify you that the plugin has been
1818+installed and you may have to restart Adium.
1919+2020+In Adium's Preferences, choose Events. You may also create a per-contact alert
2121+by double-clicking on a contact and clicking the Events icon.
2222+2323+Click an event, such as "Message received", and click the [+] button. Select
2424+"Pipe event to command". Enter the *full path* to your command and hit OK.
2525+2626+The command will be executed every time the event is run and have STDOUT and
2727+STDERR closed, and then have the full content of the event/message written to
2828+its STDIN. For easier scripting, the event/message has a trailing newline
2929+appended. The title of the event (for messages, the sender's name) will be
3030+passed to the command as its first argument.
3131+3232+A simple script that will write every received message to a file:
3333+3434+ #!/usr/bin/ruby
3535+ File.open("#{ENV['HOME']}/adium.log", "a+") do |f|
3636+ f.puts "#{Time.now}: #{ARGV[0]} - #{STDIN.read}"
3737+ end
3838+3939+Note: make sure the command is executable (chmod +x).