Skip to content

Instantly share code, notes, and snippets.

@Newlifer
Forked from kiy0taka/commit-irc.groovy
Last active December 14, 2015 06:09
Show Gist options
  • Save Newlifer/5040577 to your computer and use it in GitHub Desktop.
Save Newlifer/5040577 to your computer and use it in GitHub Desktop.
@Grab('pircbot:pircbot:1.4.2')
import org.jibble.pircbot.*;
def (host, port, channel) = ['chat.freenode.net', 6667, 'gitbot']
def bot = [:] as PircBot
bot.name = 'groovy_bot'
bot.encoding = 'ISO-2022-JP'
bot.connect host, port
bot.joinChannel channel
bot.sendRawLine(args*.split('\n').flatten().collect{"PRIVMSG $channel :$it"}.join('\n'))
bot.disconnect()
System.exit 0
#!/bin/bash
export LANG=ja_JP.UTF-8
export JAVA_HOME=/usr/lib/jvm/jre-1.6.0-openjdk/
export GROOVY_HOME=/usr/local/groovy
export PATH=$JAVA_HOME/bin:$GROOVY_HOME/bin:$PATH
LOG=`git log -1`
groovy /path/to/git-repo/hooks/commit-irc.groovy "$LOG" >> /tmp/post-commit.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment