Hide symbols trailing the tag and skip #nospoil - bitreich-memestats - Bitreich meme statistics and graphs. HTML git clone git://bitreich.org/bitreich-memestats git://hg6vgqziawt5s4dj.onion/bitreich-memestats DIR Log DIR Files DIR Refs DIR Tags DIR LICENSE --- DIR commit f8c777510e9663561ed292baaef1de5cfb7b4b91 DIR parent d08ff10b40479174b132e313726b406692972e35 HTML Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Fri, 17 Apr 2020 10:02:44 +0200 Hide symbols trailing the tag and skip #nospoil Diffstat: M Makefile | 2 +- M extract_memeuse.awk | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) --- DIR diff --git a/Makefile b/Makefile @@ -1,6 +1,6 @@ log = ~/.irssi/log/Freenode/\#bitreich-en.log -memeuse.tsv: extract_memeuse.awk $(log) +memeuse.tsv: extract_memeuse.awk awk -f extract_memeuse.awk $(log) > $@ clean: DIR diff --git a/extract_memeuse.awk b/extract_memeuse.awk @@ -40,6 +40,7 @@ function extract_tag(s) { match(s, /#.*/); s = substr(s, RSTART, RLENGTH); gsub(/ .*/, "", s); + gsub(/[!?,\.]$/, "", s); return s; } @@ -59,8 +60,11 @@ function extract_time(s) { # find tag in current line / #[A-Za-z0-9]+/ { if (! /< annna>/ && ! /#bitreich-en/) { - printf("%s\t%s\-%s\-%s\t%s\t%s\t%s\n", - n_days, year, month, day, - extract_time($0), extract_user($0), extract_tag($0)); + tag = extract_tag($0); + if (!match(tag, "#nospoil")) { + printf("%s\t%s\-%s\-%s\t%s\t%s\t%s\n", + n_days, year, month, day, + extract_time($0), extract_user($0), tag); + } } }