Coder Social home page Coder Social logo

slacker's Introduction

slacker

Erlang Slack REST API wrapper.

To use slacker, you need a team token that you can grab here.

Installation

To build the application simply run 'make all'. This should build .beam, .app files and documentation.

To run tests run 'make test'. To generate doc, run 'make doc'.

Or add it to your rebar config

{deps, [
    ....
    {slacker, ".*", {git, "git://github.com/julienXX/slacker.git", {branch, "master"}}}
]}.

Quick start

λ rebar shell
Eshell V6.2  (abort with ^G)
1> hackney:start().
2> slacker:start().
3> Token = "your team token".
4> Options = [].
5> {ok, Status, Headers, Body} = slacker_user:list(Token, Options).

Message formatting

Slack messages are JSON structures that follow a specific formatting. After creating a message you pass it to slacker_chat:post_rich_message/5 as an attachment parameter.

Simple message with a bot icon and a colored left border:

Msg = slacker_rich_messages:format(<<"Hello">>, <<"Hello World!">>, <<"#df4f18">>).

Simple message with a table, a bot icon and a colored left border:

Fields = [[{title, "Col"}, {value, 1}]].
Msg = slacker_rich_messages:format_table(<<"Hello">>, <<"Hello World!">>, Fields, <<"#df4f18">>).

TODO

  • files.upload API endpoint is not implemented
  • RTM endpoint is not implemented

Contribute

  • Fork slacker
  • Write some new features or fix bug
  • Test it
  • Pull request

LICENSE

License in LICENSE file

More info

More info at [email protected]

slacker's People

Contributors

bitdeli-chef avatar ipinak avatar julienxx avatar tgrk 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.