aboutsummaryrefslogtreecommitdiffstats
path: root/tw_hooks/hook_test.pl
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-11-18 16:11:39 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-11-18 16:11:39 +0000
commitd5e13c5a1e6ec2f4b5096a2012eac17ce935b068 (patch)
tree9124570e80c5defc43a975af1a2e0b331dc2c2c3 /tw_hooks/hook_test.pl
initial commit
Diffstat (limited to 'tw_hooks/hook_test.pl')
-rw-r--r--tw_hooks/hook_test.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/tw_hooks/hook_test.pl b/tw_hooks/hook_test.pl
new file mode 100644
index 0000000..d3db593
--- /dev/null
+++ b/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;