From 5ebd929ff960dfb9edd9c846a76917b592d812c0 Mon Sep 17 00:00:00 2001 From: Takanori Suzuki Date: Tue, 18 Apr 2017 12:06:10 +0900 Subject: [PATCH] refs #6 add slack_reminder.py --- jobs/slack_reminder.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 jobs/slack_reminder.py diff --git a/jobs/slack_reminder.py b/jobs/slack_reminder.py new file mode 100644 index 0000000..caed963 --- /dev/null +++ b/jobs/slack_reminder.py @@ -0,0 +1,27 @@ +import logging +from datetime import datetime + +from utils import user, slack, holiday, google_sheets + +logger = logging.getLogger(__name__) + +# スプレッドシートのID +SHEET_ID = '1u-F1Ixh2s-FBMULHv8w4JrSkQnHsTCG5BjjMQFkWRMU' + +def job(): + """ + slack-reminderシートに書いてある通知をSlackに送る + """ + + logger.info('Start slack-reminder job') + + # 休みの日ならなにもしない + if holiday.is_holiday(): + return + + now = datetime.now() + # 全データを取得 + values = google_sheets.get_all_values(SHEET_ID, 'reminder') + for value in values[:3]: + print(value) +