Created
August 4, 2018 09:19
-
-
Save czj/5582dfc51ec86c70402ca5a0470af2b3 to your computer and use it in GitHub Desktop.
Work log output to local file + to Slack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "bundler/inline" | |
gemfile { gem "slack-notifier" } | |
require "slack-notifier" | |
Slack::Notifier.new("https://hooks.slack.com/services/xxxxxxx").ping("• _#{query}_") | |
logs_dir = "~/Documents/work_logs" | |
query = ARGV[0].to_s.delete('\\') | |
logfile = "#{logs_dir}/#{Time.now.strftime('%Y-%m-%d')}.txt" | |
open(logfile, "a") { |f| f.puts query } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment