Simple HipChat notifier

We needed a simple way of sending messages to HipChat (great online chat software, BTW), so I cooked up this:

#!/usr/bin/env perl

use strict;
use warnings;
use WWW::Mechanize;

# See for info
my $url = '';
my $api_key = 'your-api-key';
my $from = 'User-to-post-as';
my $room = 'room-to-post-to';
my $message = $ARGV[0];
my $color = $ARGV[1];

my $mech = WWW::Mechanize->new;
$mech->post( $url, {
room_id => $room,
from => $from,
color => $color,
message => $message,
auth_token => $api_key,

Quick and dirty - no error checking. Works well for the situations we are using it in, but you may wish to make something more robust before doing anything serious with it.


Leave a comment

About Jason A. Crome

user-pic Dancer developer, pilot, and hockey player.