aboutsummaryrefslogtreecommitdiffstats
path: root/tw/tw_hooks/hook_test.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tw/tw_hooks/hook_test.pl')
-rw-r--r--tw/tw_hooks/hook_test.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/tw/tw_hooks/hook_test.pl b/tw/tw_hooks/hook_test.pl
new file mode 100644
index 0000000..d3db593
--- /dev/null
+++ b/tw/tw_hooks/hook_test.pl
@@ -0,0 +1,31 @@
+use strict;
+use warnings;
+use JSON;
+use Data::Dumper;
+
+# a test hook in Perl for taskwarrior
+
+# this must be JSON - this gets passed in my taskwarrior
+my $added_task = <STDIN>;
+
+my $hashref = decode_json $added_task;
+
+my $original_description = $hashref->{description};
+
+my $tags = $hashref->{tags};
+print $tags->[1];
+print "\n";
+
+print Dumper($hashref);
+
+$hashref->{description} =~ s/LEMON/BOLLOCKS/g;
+
+my $output = encode_json $hashref;
+
+# print $hashref->{"status"};
+# print "\n";
+# print $hashref->{scheduled};
+
+print $output;
+
+exit 0;