GithubHelp home page GithubHelp logo

isabella232 / slackin-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atom/slackin

1.0 0.0 0.0 226 KB

Public Slack organizations made easy

Home Page: http://rauchg.com/slackin/

License: MIT License

Makefile 0.57% JavaScript 95.31% CSS 4.12%

slackin-1'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 (https://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)

Read more about the motivations and history behind Slackin.

How to use

Server

Heroku

Deploy

OpenShift

Follow these instructions.

Custom

Install it and launch it on your server:

$ npm install -g slackin
$ slackin "your-team-id" "your-slack-token"

Your team id is what you use to access your login page on Slack (eg: https://{this}.slack.com).

You can find your API token at api.slack.com/web โ€“ note that the user you use to generate the token must be an admin. You need to create a dedicated @slackin-inviter user (or similar), mark that user an admin, and use a token from that dedicated admin user.

The available options are:

Usage: slackin [options] <team-id> <api-token>

Options:

  -h, --help                 output usage information
  -V, --version              output the version number
  -p, --port <port>          Port to listen on [$PORT or 3000]
  -h, --hostname <hostname>  Hostname to listen on [$HOSTNAME or 0.0.0.0]
  -c, --channels [<chan>]    One or more comma-separated channel names to allow single-channel guests [$SLACK_CHANNELS]
  -c, --channel <chan>       Single channel guest invite (deprecated) [$SLACK_CHANNEL]
  -i, --interval <int>       How frequently (ms) to poll Slack [$SLACK_INTERVAL or 5000]
  -P, --path                 Path to serve slackin under
  -s, --silent               Do not print out warns or errors
  -c, --css <file>           Full URL to a custom CSS file to use on the main page

Important: if you use Slackin in single-channel mode, you'll only be able to invite as many external accounts as paying members you have times 5. If you are not getting invite emails, this might be the reason. Workaround: sign up for a free org, and set up Slackin to point to it (all channels will be visible).

Realtime Badge

<script async defer src="https://slack.yourdomain.com/slackin.js"></script>

or for the large version, append ?large:

<script async defer src="https://slack.yourdomain.com/slackin.js?large"></script>

SVG

<img src="https://slack.yourdomain.com/badge.svg">

Done in Markdown this looks like:

[![Slack Status](https://slack.yourdomain.com/badge.svg)](https://yourdomain.com)

Landing page

Point to https://slack.yourdomain.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
  path: '/some/path/you/host/slackin/under/', // defaults to '/'
  channels: '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.

Developing

Slackin's server side code is written in ES6. It uses babel to transpile the ES6 code to a format node understands. After cloning Slackin, you should install the prerequisite node libraries with npm:

$ npm install

After the libraries install, the postinstall script will run make to invoke babel on the source. It is important to run make manually after updating any files in lib/ to update the versions in node/.

Credits

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

License

MIT

slackin-1's People

Contributors

rauchg avatar afeld avatar balupton avatar jomo avatar jtatum avatar elliottsj avatar darron avatar limulus avatar lvnilesh avatar ssandler avatar heyjohnford avatar alansouzati avatar bnjmnt4n avatar brianloveswords avatar imbstack avatar esteinborn avatar frabrunelle avatar graham42 avatar designorant avatar mlissner avatar rymohr avatar sc0ttkclark avatar toolmantim avatar vluzrmos avatar viljoviitanen avatar dijonkitchen avatar kishikawakatsumi avatar martypenner avatar yamadapc avatar

Stargazers

 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.