From 93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Sun, 27 Oct 2019 23:31:51 -0700 Subject: Minor and incomplete changes to cope with autolog path changes and kraken v3 shutdown --- crystal/name-command.cr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crystal') diff --git a/crystal/name-command.cr b/crystal/name-command.cr index 3d0878f..fa1a0f9 100644 --- a/crystal/name-command.cr +++ b/crystal/name-command.cr @@ -3,6 +3,7 @@ require "json" require "pretty_print" require "xml" require "inotify" +require "time" home = Path["~/"].expand.to_s @@ -71,9 +72,9 @@ def commanderroot_changelog( uid ) end -log = File.open(home + "irclogs/twitch/#" + channel + ".log".to_s) +log = File.open(home + "irclogs/twitch/#" + channel + "/" + Time.local.to_s("%Y-%m-%d") + ".log".to_s) log.seek(log.size) -watcher = Inotify.watch(home + "irclogs/twitch/#" + channel + ".log".to_s) do | event | +watcher = Inotify.watch(home + "irclogs/twitch/#" + channel + "/" + Time.local.to_s("%Y-%m-%d") + ".log".to_s) do | event | if event.type.to_s == "MODIFY" log.read_string( log.size - log.pos ).each_line do | string | # FIXME: support old names? might get confusing with e.g. reverse5612 -- cgit v1.2.3