diff options
author | Joe Rayhawk <jrayhawk@action.fairlystable.org> | 2019-10-27 23:31:51 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@action.fairlystable.org> | 2019-10-27 23:31:51 -0700 |
commit | 93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c (patch) | |
tree | 00e7c6af4563b910a715c842baa3c4e8a68e4822 /crystal/name-command.cr | |
parent | c11cd7da47327b423f40c9cd54d2c8f9612cea5a (diff) | |
download | twitchtools-93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c.tar.gz twitchtools-93aebe7498b3f3bf5079e4f218072b0ec5ad9b6c.zip |
Minor and incomplete changes to cope with autolog path changes and kraken v3 shutdown
Diffstat (limited to 'crystal/name-command.cr')
-rw-r--r-- | crystal/name-command.cr | 5 |
1 files changed, 3 insertions, 2 deletions
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 |