Giter Club home page Giter Club logo

slacko's Introduction

Slacko

Slacko logo A neat interface for Slack

Build Status

Your company got you Slack and you're all like "yeah, and now I am forced to use a browser or what?". Fear no more, because as it turns out Slack has a REST API that can be accessed.

Yeah, scripting Slack via curl sucks, so let's do something that sucks less. Maybe a bit? How about using an existing integration? They are incomplete or for sucky languages? Glad you asked, because I have just the right thing for you: a neat interface to Slack via OCaml!

What do you need? OCaml, OPAM and a Slack token. All for free, no asterisks, no hidden clauses. Life can be so easy.

Install that cow!

Huzzah, I got you interested? Lucky you, Slacko can easily be installed via OCaml Package Manager (OPAM), so you just write

$ opam install slacko

Now wasn't this easy? Bet your ass it was! And you know what? It even gets better: it also installed you a nifty little executable called slack-notify which you can use to post directly to Slack from your shell, no programming required at all. Actually, once compiled, not even OCaml is required anymore, everything is self-contained.

In case you want to manually install it, you can, too. There's a number of dependencies that you have to take care of yourself:

Then you can build Slacko by yourself:

$ ocaml setup.ml -configure
$ ocaml setup.ml -build
$ ocaml setup.ml -install

How do I even use this thing?

The workflow is always very simple: you get a token from Slack either manually or my querying the OAuth API. Then you can instantly use any API method that Slacko supports. If you want, you can look at snapshot of the Slacko docs to see what functions are available (hint: all of them).

Ready, set, go!

Not convinced yet? Check out this neat documentation from slack-notify to help you out.

NAME
       slack-notify - Writes messages to slack

SYNOPSIS
       slack-notify [OPTION]... CHANNEL MSG

ARGUMENTS
       CHANNEL
           Name of the channel to post to

       MSG Message to send

OPTIONS
       --help[=FMT] (default=pager)
           Show this help in format FMT (pager, plain or groff).

       --icon-emoji=EMOJI
           emoji to use as the icon for this message. Overrides icon-url

       --icon-url=URL
           URL to an image to use as the icon for this message

       -t TOKEN, --token=TOKEN
           The Slack API access token

       -u USERNAME, --username=USERNAME
           Name of the bot in the chat

So what is this token thing? Once you signed up for Slack, you can get a token for every team you are in from the Slack API docs. Click on the "get token" link and you're all set.

But I do want to code my own stuff!

You know, Slacko is a nice gal/guy. So you can just plug together whatever you want with it, since it currently implements 100% of the Slack API! Well, except for the Real-Time-Messaging part, which is on our TODO! How neat is this? And you can use it in your own code without worrying about the license one bit, since the LGPL 3.0 is liberal for re-use, coupled with the OCaml linking exception. For realz!

Something's amiss?

I know, I know, it is hardly believable that something could possibly be missing from this library. But wonders happen, and if you run into one of these cases, just shoot me a pull request.

Credit where credit's due

Thanks go to all the people who wrote CoHTTP, a real-world HTTP library that doesn't suck and Lwt, an oddball library that subconsciously makes sense. Also, the fine folks in #ocaml on freenode.

slacko's People

Contributors

leonidas-from-xiv avatar dsheets avatar

Watchers

James Cloos avatar Louis avatar  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.