diff options
-rw-r--r-- | remind.sh | 31 | ||||
-rw-r--r-- | task_capture_completed.pl | 37 | ||||
-rwxr-xr-x | tw_hooks/on-add_scheduled_work_task.pl | 2 |
3 files changed, 69 insertions, 1 deletions
diff --git a/remind.sh b/remind.sh new file mode 100644 index 0000000..4d478f0 --- /dev/null +++ b/remind.sh @@ -0,0 +1,31 @@ +#!/bin/sh -e + +# to echo from stdin +#stdin=$(cat) + +# if [ -z $stdin ] ; then +# echo "No stdin set" +# fi + +# echo $stdin + +# DESCRIPTION=$1 +# echo $DESCRIPTION + +if [[ "$#" < 3 ]] ; then + echo "You need to give me more parameters" +fi + +PARAMS=$@ +echo $@ + +if [[ -z "${TW_HOOK_REMIND_REMOTE_HOST}" ]] ; then + echo "There is not TW_HOOK_REMIND_REMOTE_HOST variable set." + exit 1; +else + echo "TW_HOOK_REMIND_REMOTE_HOST set" +fi + +ssh $TW_HOOK_REMIND_REMOTE_HOST ' +cat ~/.reminders/work.rem +' diff --git a/task_capture_completed.pl b/task_capture_completed.pl new file mode 100644 index 0000000..a61145a --- /dev/null +++ b/task_capture_completed.pl @@ -0,0 +1,37 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use autodie; +use feature qw(say); + +my $project = $ARGV[0]; + +my $stuff = `task status:completed project:$project all`; + +my @x = split(/\n/, $stuff); + +# print "$_\n" foreach @x; + +my @taskids; +my $id; + +foreach my $line (@x) { + my @data = split / /, $line; + if (defined($data[4])) { + if ($data[4] =~ /\S{8}/) { + push @taskids, ($data[4]) + } + } +} + +foreach (@taskids) { + my $desc = `task _get $_.description`; + chomp $desc; + my $end = `task _get $_.end`; + $end = substr($end, 0, -1); + $end =~ s/T/ /; + printf "%s: %-50s\t%s\n", ($_, $desc, $end) +} + +say "Found " . scalar @taskids . " tasks."; diff --git a/tw_hooks/on-add_scheduled_work_task.pl b/tw_hooks/on-add_scheduled_work_task.pl index 1c837b2..1ac836c 100755 --- a/tw_hooks/on-add_scheduled_work_task.pl +++ b/tw_hooks/on-add_scheduled_work_task.pl @@ -9,7 +9,7 @@ use DateTime::Format::ISO8601; use Net::OpenSSH; -my @short_months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); +my @short_months = qw(January February March April May June July August September October November December); # subs sub parse_scheduled |