Giter VIP home page Giter VIP logo

slackin's Introduction

slackin

A little server that enables public access to a Slack server. Like Freenode, but on Slack.

It provides

  • A landing page you can point users to fill in their emails and receive an invite (http://slack.yourdomain.com)
  • An <iframe> badge to embed on any website that shows connected users in realtime with socket.io.
  • A SVG badge that works well from static mediums (like GitHub README pages)

How to use

Server

Deploy

Or install it and launch it on your sever:

$ npm install -g slackin
$ slackin "your-slack-subdomain" "your-slack-token"

You can find your API token at api.slack.com/web.

The available options are:

Usage: slackin [options] <slack-subdomain> <api-token>

Options:

  -h, --help            output usage information
  -V, --version         output the version number
  -p, --port <port>     Port to listen on [$PORT or 3000]
  -c, --channel <chan>  Single channel guest invite [$SLACK_CHANNEL]
  -i, --interval <int>  How frequently (ms) to poll Slack [$SLACK_INTERVAL or 1000]
  -s, --silent          Do not print out warns or errors

Realtime Badge

<script async defer src="http://slackin.yourhost.com/slackin.js"></script>

or for the large version, append ?large:

<script async defer src="http://slackin.yourhost.com/slackin.js?large"></script>

SVG

<img src="http://slackin.yourhost.com/badge.svg">

Landing page

Point to http://slackin.yourhost.com.

Note: the image for the logo of the landing page is retrieved from the Slack API. If your organization doesn't have one configured, it won't be shown.

API

Requiring slackin as a module will return a Function that creates a HTTP.Server instance that you can manipulate.

require('slackin')({
  token: 'yourtoken', // required
  interval: 1000,
  org: 'your-slack-subdomain', // required
  channel: 'channel' // for single channel mode,
  silent: false // suppresses warnings
}).listen(3000);

This will show response times from Slack and how many online users you have on the console.

By default logging is enabled.

Credits

  • The SVG badge generation was taken from the excellent shields project.
  • The button CSS is based on github-buttons.

License

MIT

slackin's People

Contributors

brianloveswords avatar rauchg avatar xeodou avatar

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.