Post2irc gem by by javier ramirez

==========

This gem will start a sinatra script that will listen to posts and will publish the contents to an irc channel. Simple authentication via a secret token in the URL is provided

You can just install the gem and run the provided post2irc command with appropriate parameters

post2irc “irc.freenode.net” “6667” “#your_channel” “nickname” “0.0.0.0” “8080”

This would connect to the irc server “irc.freenode.net” at port 6667 entering the channel “#your_channel” using the nickname “nickname”

The local webserver would listen on the 0.0.0.0 interface at port 8080

Now you can issue a post like this curl -X POST http://localhost:8080/public?q=hi and you should see the bot saying “hi” on IRC

There is a built-in service hook for bitbucket, so you can receive alerts of your commits on irc. Go to the admin of your bitbucket repository, look for services and select the POST service. Now just enter this value for the URL

http://your_url:8080/public/sources/bitbucket/service

There us a built-in service hook for pivotal tracker, so you can receive notifications on story changes on irc. Go to the admin of your pivotal repository, look for project/integrations and add a webhook pointing to

http://your_url:8080/public/sources/pivotal/webhook

Of course both the url and port must be accessible from the internet

Authentication

========

If you want to authenticate the request, there is a basic mechanism built in. You can pass an extra parameter when starting the server and it will be used in the url instead of /public. For example

post2irc “irc.freenode.net” “6667” “#your_channel” “nickname” “0.0.0.0” “8080” “supersecr3t”

Would respond to POSTs sent to the following URLs

http://localhost:8080/supersecr3t http://your_url:8080/supersecr3t/sources/bitbucket/service

Take into account the secret is part of the URL, so unless you are using https it’s not really that secure, but still better than nothing and easy to integrate with external tools