diff options
-rw-r--r-- | writing_tools/create_md_links_from_journal_urls.pl | 2 | ||||
-rw-r--r-- | writing_tools/get_journal_tags.pl | 17 |
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"; |