Skip to content

Latest commit

 

History

History
129 lines (81 loc) · 2.9 KB

README.md

File metadata and controls

129 lines (81 loc) · 2.9 KB

slackbot-jobcan-report

Unofficial Slackbot for JobCan.


Features

  • Report of daily/weekly/monthly work time

Get Started

You can quick deploy to Heroku with using following button.

Deploy

After the quick deployment completed, please to finish the "3. Make a Schedule for Auto Post" step.


Deployment

1. Deploy to Heroku

$ heroku apps:create
$ git push heroku master

2. Make a Configuration

Firstly, please make an configuration on Slack Incoming Webhooks Integration page. You can also get the Webhook URL from that page.

Nextly, set the Environment Variables to Your heroku app using following commands.

  • SLACK_WEBHOOK_URL - Incoming Webhook URL of Slack
    • e.g. https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYY/zzzzzzzzzzzzzzzzzzzzzzzz
  • SLACK_CHANEL - Channel name of Slack
    • e.g. #general
  • JC_COMPANY_ID - Company ID of JobCan
  • JC_GROUP_MANAGER_ID - Group Manager ID of JobCan
  • JC_PASSWORD - Group Manager Password of JobCan
$ heroku config:set SLACK_WEBHOOK_URL=YOUR-WEBHOOK-URL
$ heroku config:set SLACK_CHANEL=#general
$ heroku config:set JC_COMPANY_ID=YOUR-JOBCAN-COMPANY-ID
$ heroku config:set JC_GROUP_MANAGER_ID=YOUR-JOBCAN-GROUP-MANAGER-ID
$ heroku config:set JC_PASSWORD=YOUR-JOBCAN-PASSWORD

After that, you can test run as follows.

$ heroku run "npm run post -- postWorkTimeSummaryWeekly"

Firstly, please install the "Heroku Schedule" to Your heroku app.

$ heroku addons:add scheduler:standard

Then, open the configuration page of Herou Schedule.

$ heroku addons:open scheduler

Then, fill the form in the page as following. Please replace YOUR-TASK-NAME with chosen task name (e.g. postWorkTimeSummaryWeekly) from available tasks. You should also check the available options.

  • Script - Command to run
    • Format: $ npm run post -- YOUR-TASK-NAME [YOUR-OPTIONS]
    • Example: $ npm run post -- postWorkTimeSummaryWeekly --weekday-only
  • Dyno Size - Choose the Free
  • Frequency - As you want
  • Next Due - As you want

Done!


Post of Work Time Summary

  • Today: postWorkTimeSummaryToday
  • Daily (Yesterday): postWorkTimeSummaryDaily
  • Weekly: postWorkTimeSummaryWeekly
  • Monthly: postWorkTimeSummaryMonthly

These options can be appended when the task running.

Limitation of Day of the Week

It will run the task only on the specific days.

Example - Run on Sunday and Saturday:

--enable-days=0,6

Weekday Only (Deprecated)

It will run the task only on weekdays.

--weekday-only


License

The MIT License (MIT)
Copyright (c) 2016 denLabo LLC