Auto Slack Check-in
auto-slack-checkin is a command line interface (CLI) that sends check-in or check-out message for you while you are sleeping 🛌.
Usage:
auto-slack-checkin [command]
Available Commands:
config Show all configs
cron Run a cron job that automatically sends a message at a specified time.
config set Set configs.
Flags:
--help Get helo about any command (work with all commands)
Use "auto-slack-checkin [command] -h" for more information about a command.
auto-slack-checkin
Installing Downloading a Release from GitHub
Visit the Releases page for the auto-slack-checkin
GitHub project, and find the appropriate archive for your operating system and architecture. Download the archive from from your browser or copy its URL and retrieve it to your home directory with wget
or curl
.
For example, with wget
:
cd ~
wget https://github.com/mhughdo/auto-slack-checkin/releases/download/v<version>/auto-slack-checkin_<version>_linux_amd64.tar.gz
Or with curl
:
cd ~
curl -OL https://github.com/mhughdo/auto-slack-checkin/releases/download/v<version>/auto-slack-checkin_<version>_linux_amd64.tar.gz
Extract the binary:
tar xf ~/auto-slack-checkin_<version>_linux_amd64.tar.gz
where <version>
is the full semantic version, e.g., 1.1.2
.
Window version is not supported yet.
Configuring Values
The auto-slack-checkin
configuration file is stored at $HOME/.auto-slack-checkin.json
Note: You need to run any command, e.g. ./auto-slack-checkin config to init config file.
You can directly change the config file but make sure file format stays the same.
Save and close the file. The next time you use auto-slack-checkin
, the new values you set will be in effect.
You need to set token
, cookie
, message
, channel-id
for CLI to work. cron-expr
is set to "0 8 * * *" by default which is everyday at 8AM. Full command:
./auto-slack-checkin config set --cron-expr '0 8 * * *' --token xoxc-3058611573620-3056323014531-3086306920976-dacaa15d71a468bae5380db258aae5dbb08d2996f119d665a7c73bd7fb19550c --cookie d=WjrniNOtYeO7vSHo%2BDvBzV2iKRhz%2FbnvEDLB7Nf%2BQk15FHNpcZjVsa0ZGqoFnQcLrLklTB9EvxtkhPRs5vJbWso9%2F6cHyVUqKD%2Biuytj9g7W2eDD7d4vUzspyX9ABroxqin4Qbab7qAi4%2BEF3YtYhWfvU6%2FaNEmgK00EadzfGxz7EB92DV2ZEkPtKw%3D%3D --message "Helloooo" --channel-id C032C1GC1Q8
https://crontab.guru/
How to generate cron expression:How to get token, cookie, channel-id
- Open workspace in the browser.
- Open DevTools by pressing Control+Shift+J or Command+Option+J (Mac). The Console panel opens.
Token & Cookie
- Open a channel that you can freely send anything.
- Send a random message.
- Click the Network tab in the DevTools.
- Find the request that contains
chat.postMessage
- Click on the request
- Click the Payload tab, scroll down a bit and you will see token:
- Click the Headers tab, scroll down a bit. At the Request Headers section, cookie being sent by request should be there. Copying only the cookie whose key is
d
is enough.
Channel id
You can easily find the channel id by clicking on the channel you want to take id and looking at the URL. The channel-id
should be the last path parameter.
Examples
Below are a few common usage examples.
- Run the CLI
./auto-slack-checkin cron
- Run the CLI in the background
nohup ./auto-slack-checkin cron &
- Show all configs
./auto-slack-checkin config
- Set config
./auto-slack-checkin config set --token <value> --cookie <value>