Giter VIP home page Giter VIP logo

hci-slack's Introduction

HCI-Slack

HCI-Slack is a set of Django Slack apps used by our HCI research sub-group at ECS (http://www.ecs.soton.ac.uk/). They're all bundled into one project here, but you can easily separate them out if you wish.

Deploy

General Requirements

HCI-Slack uses Redis for help entries, so you'll need Redis To Go or similar if you're on Heroku. It also requires a few environmental variables, shown below.

  • SLACK_WEBHOOK_URL - ingoing webhook URL
  • SLACK_GENERAL_CHAT - where work-related messages should go (i.e. help responses)
  • SLACK_RANDOM_CHAT - where non-work-related messages should go (i.e. added a track to jukebox)

Help Entries

Uses a Redis backend to store/retrieve useful information for the group (e.g. links to pages, conference details, etc).

#### Usage

  • /h <key> <value> - creates an entry in the help database (e.g. /h wiki This is our fantastic wiki: )
  • /h <key> - retrieves an entry from the help database (e.g. /h wiki)
  • /h list - lists all entry keys
  • /h rm <key> - removes an entry from the help database (e.g. /h rm wiki)

#### Required Environmental Variables

  • HELP_SLACK_TOKEN: Set this to the value provided by Slack when you create your slash command.

### Jukebox

Uses the Spotify API to add tracks to a shared playlist. This is based on the NodeJS project (https://github.com/benchmarkstudios/slackbox/) but ported over to Django. It requires much the same setup as slackbox: you need create an application on Spotify (https://developer.spotify.com/my-applications).

Once set up, you first need to head to http://yourapp.com/jukebox/authorise. This will store the token in /tmp/jukebox.json, which it'll try to reuse when you add tracks.

#### Usage

  • /jukebox <search> - e.g. /jukebox Creep. Adds the first search result to the playlist.

#### Required Environmental Variables

  • HELP_SLACK_TOKEN: Set this to the value provided by Slack when you create your slash command.
  • SPOTIFY_KEY: The Spotify app's client ID
  • SPOTIFY_SECRET: The Spotify app's secret
  • SPOTIFY_USERNAME: The user who owns the playlist
  • SPOTIFY_PLAYLIST_ID: The ID of the playlist that you're sharing
  • SPOTIFY_REDIRECT_URI: Should be http://yoursite.com/jukebox/callback

Miscellanous

slack.utils has a utility function, send_message, which uses the incoming web hook to send a message as any bot, to any channel. The only required parameter is 'text', with username, icon_emoji, icon_url, channel, attachements, and unfurl_links all being optional.

hci-slack's People

Contributors

mikejewell avatar

Watchers

 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.