summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-02-16 23:07:48 -0600
committerJesse Luehrs <doy@tozt.net>2012-02-16 23:07:48 -0600
commit56fb1802ddfb11c7e72a33ed18c72d7138c4e611 (patch)
treee5f2f538e2fa53b1ece4c03f28f307a9f30f8b9c
parent48345713b87ac389c68c46173994a96560266f52 (diff)
downloadbot-flowdock-irc-56fb1802ddfb11c7e72a33ed18c72d7138c4e611.tar.gz
bot-flowdock-irc-56fb1802ddfb11c7e72a33ed18c72d7138c4e611.zip
shorten the compare url
-rw-r--r--dist.ini3
-rw-r--r--lib/Bot/Flowdock/IRC.pm5
2 files changed, 6 insertions, 2 deletions
diff --git a/dist.ini b/dist.ini
index fd60eec..2bfca43 100644
--- a/dist.ini
+++ b/dist.ini
@@ -7,3 +7,6 @@ copyright_holder = Jesse Luehrs
dist = Bot-Flowdock-IRC
[AutoPrereqs]
+
+[Prereqs]
+WWW::Shorten::GitHub = 0
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);
}