App-TimeTracker-Command-TellRemote
view release on metacpan or search on metacpan
lib/App/TimeTracker/Command/TellRemote.pm view on Meta::CPAN
my $ua = LWP::UserAgent->new( timeout => 3 );
my $message
= $task->user
. ( $status eq 'start' ? ' is now' : ' stopped' )
. ' working on '
. $task->say_project_tags;
# Use bytes for creating the digest, otherwise we'll get into trouble
# https://rt.cpan.org/Public/Bug/Display.html?id=93139
my $token = sha1_hex( encode_utf8($message), $cfg->{secret} ) if $cfg->{secret} ;
my $url = $cfg->{url} . '?message=' . uri_escape_utf8($message);
$url .= '&token='. $token if $cfg->{secret};
my $res = $ua->get($url);
unless ( $res->is_success ) {
error_message( 'Could not post to remote status via %s: %s',
$url, $res->status_line );
}
}
no Moose::Role;
( run in 0.816 second using v1.01-cache-2.11-cpan-73692580452 )