aboutsummaryrefslogtreecommitdiffstats
path: root/writing_tools
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-09-14 06:55:21 +0100
committerMatthew Lemon <matt@matthewlemon.com>2022-09-14 06:55:21 +0100
commit5d18cea379f962f5d2fad7a0b3183d531b7d295f (patch)
tree4bc96323128ffdc367788f5a1bead19c52822c4c /writing_tools
parent2e18bc6a11af1865192c1c4651928ed461c33437 (diff)
update
Diffstat (limited to 'writing_tools')
-rw-r--r--writing_tools/create_md_links_from_journal_urls.pl2
-rw-r--r--writing_tools/get_journal_tags.pl17
2 files changed, 18 insertions, 1 deletions
diff --git a/writing_tools/create_md_links_from_journal_urls.pl b/writing_tools/create_md_links_from_journal_urls.pl
index a03aa23..82f5830 100644
--- a/writing_tools/create_md_links_from_journal_urls.pl
+++ b/writing_tools/create_md_links_from_journal_urls.pl
@@ -7,7 +7,7 @@ use HTML::TreeBuilder 5 -weak;
use HTML::HeadParser;
use feature qw(say);
-$| = 1; # turn on autoflush for stdout (https://stackoverflow.com/questions/40608986/print-doesnt-work-while-iterations-are-going-inside-foreach-loop)
+# $| = 1; # turn on autoflush for stdout (https://stackoverflow.com/questions/40608986/print-doesnt-work-while-iterations-are-going-inside-foreach-loop)
# How to read each file in a directory $dir
diff --git a/writing_tools/get_journal_tags.pl b/writing_tools/get_journal_tags.pl
new file mode 100644
index 0000000..2dbd2e7
--- /dev/null
+++ b/writing_tools/get_journal_tags.pl
@@ -0,0 +1,17 @@
+use strict;
+use warnings;
+
+my @tags;
+
+foreach my $fn (glob "~/Notes/journal/*.md") {
+ open my $FH, "<", $fn or die "Cannot open $fn";
+ while (<$FH>) {
+ if (/(\s:[A-Z]\w+)/) {
+ push @tags, $1;
+ }
+
+ }
+}
+my %truetags = map { $_, 1 } @tags;
+my @trutags = keys %truetags;
+print @trutags, "\n";