From 56fb1802ddfb11c7e72a33ed18c72d7138c4e611 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 16 Feb 2012 23:07:48 -0600 Subject: shorten the compare url --- lib/Bot/Flowdock/IRC.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Bot/Flowdock/IRC.pm b/lib/Bot/Flowdock/IRC.pm index 0389eff..72973d5 100644 --- a/lib/Bot/Flowdock/IRC.pm +++ b/lib/Bot/Flowdock/IRC.pm @@ -7,6 +7,7 @@ use List::MoreUtils 'any'; use Net::Flowdock 0.03; use Net::Flowdock::Stream; use String::Truncate 'elide'; +use WWW::Shorten 'GitHub'; extends 'Bot::BasicBot'; @@ -199,13 +200,13 @@ sub flowdock_github_event { my $commits = @{ $content->{commits} }; my $repo = $content->{repository}{name}; (my $branch = $content->{ref}) =~ s{^refs/heads/}{}; - my $compare = $content->{compare}; + my $compare = makeashorterlink($content->{compare}); my $commit_messages = join(' / ', map { $_->{message} } @{ $content->{commits} }); my $msg = "[github] $pusher pushed $commits commit" . ($commits == 1 ? '' : 's') - . " to $repo/$branch ($compare): $commit_messages"; + . " to $repo/$branch (compare $compare): $commit_messages"; $self->_say_to_channel($msg); } -- cgit v1.2.3-54-g00ecf