| 1 | package Exobrain::Agent::Idonethis::Sink; | ||
| 2 | use Method::Signatures; | ||
| 3 | use Moose; | ||
| 4 | |||
| 5 | with 'Exobrain::Agent::Idonethis'; | ||
| 6 | with 'Exobrain::Agent::Run'; | ||
| 7 | |||
| 8 | # ABSTRACT: Send personal log events to iDoneThis | ||
| 9 | our $VERSION = '1.08'; # VERSION | ||
| 10 | |||
| 11 | method run() { | ||
| 12 | $self->exobrain->watch_loop( | ||
| 13 | class => 'Intent::PersonalLog', | ||
| 14 | then => sub { | ||
| 15 | my $event = shift; | ||
| 16 | |||
| 17 | my $text = $event->summary; | ||
| 18 | |||
| 19 | $self->idone->set_done( | ||
| 20 | text => $text, | ||
| 21 | date => $self->to_ymd( $event->timestamp ), | ||
| 22 | ); | ||
| 23 | |||
| 24 | # Send low-priority notify that we've logged this. | ||
| 25 | $self->exobrain->notify( "Logged (iDoneThis): $text", priority => -1 ); | ||
| 26 | } | ||
| 27 | ); | ||
| 28 | } | ||
| 29 | |||
| 30 | 1; | ||
| 31 | |||
| 32 | __END__ |