Giter Club home page Giter Club logo

slack-presence's Introduction

slack-presence

Makes you appear active on Slack, even when you are not😉

Runs in a Docker container, so you can self-host it or host in the cloud.
Uses Pushover notifications to alert you when you start & stop appearing online.

Getting started

You will need Docker installed on your system. For the initial setup follow these steps:

  1. Get the default docker-compose.yml and place it somewhere on your machine. In that folder slack-presence will create chrome folder with internal Chrome user data and options.json with slack-presence settings.

  2. Change TZ=Europe/Kiev in the docke-compose.yml file to your local timezone.

  3. Run the following command in the workfolder where you placed docker-compose.yml

    docker-compopse up -d
  4. Visit http://localhost:9333 and:

    • Enter your Slack workspace URL.
    • Optionally change online appearance schedule, or leave the default 9am to 6pm.
    • Enable Slack-presence
  5. For the first time you will have to manually login to your Slack workspace within internal browser. Wait for the message to appear and then follow instructions.

  6. You are good to go! You now appear as Active on Slack from Monday till Friday by your selected schedule.

  7. Optional. Setup Pushover notifications.

From time to time your Slack login session will expire and you will have to re-login manually.

Pushover notifications

Slack-presence can notify you via Pushover when you start/stop appearing online, when your Slack login session has expired or when something went wrong. I personally also use this feature as a reminder to start/end my workday🙂.

To setup Pushover you have to create an account there and obtain two keys:

  • Your User Key (example: zLkWytJOeiuBFambEOTHCuTYJCbwTJ)
  • Your API Token/Key (example: bfRUJGNjsFxJSlYkDlMYdSFXuewHjT)

Update your docker-compose.json with your keys (I used example keys here):

- PUSHOVER_USER_KEY=zLkWytJOeiuBFambEOTHCuTYJCbwTJ
- PUSHOVER_API_TOKEN=bfRUJGNjsFxJSlYkDlMYdSFXuewHjT

Then restart slack-presence:

docker-compose restart

How does it work

There are several approaches to make Slack believe that you are active:

  1. Actually being active (too hard, boring)
  2. Always open Slack on a smartphone with sleep turned off (requires a separate smartphone)
  3. Mouse jiggler with a desktop app (unreliable, requires a dedicated PC with a GUI)
  4. Slack API (no longer works)
  5. Third-party (usually paid and proprietary) services, like this one.
  6. Selenium (or simiar) tool to drive a Slack web browser tab.

This tool uses approach #6 as the most reliable and consistent one. It's basically like #1, but automated. It uses Puppeteer to start and drive a headless (with no graphical UI but full-featured) Chrome instance which logs in to Slack web app at your provided workspace URL and then periodically refreshes the page to make you appear active. As slack uses two-factor authentication and captcha you have to login to Slack web manually for the first time (and then from time to time when login session expires) but fortunately Chrome DevTools Protocol allows you to remotely connect to a headless Chrome and do all the work in a nice way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.