• Stars
    star
    130
  • Rank 277,575 (Top 6 %)
  • Language
    Clojure
  • License
    Eclipse Public Li...
  • Created over 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use Slack REST API from Clojure

clj-slack

clj-slack is a Clojure library to talk to the Slack REST API. It supports almost the entire Slack API.

Build Status

Documentation

Slack API methods are described here.

clj-slack documentation is available here.

Usage

This is on Clojars of course. Just add [org.julienxx/clj-slack "0.8.1"] to your :dependencies in your project.clj file.

Get your access token by creating a new app or here. If you create a new Slack app, don't forget to add the relevant scopes to your app.

Your need to create a connection map like {:api-url "https://slack.com/api" :token "YOUR TOKEN"} and pass it as the first argument of every functions in clj-slack. Of course you can change api-url for debugging or testing purposes.

You can pass clj-http options in the connection map if needed.

clj-slack will throw an Exception if the connection map you're trying to use is not valid.

Example:

(require 'clj-slack.users)
(def connection {:api-url "https://slack.com/api" :token "YOUR TOKEN"})
(clj-slack.users/list connection)

You can use optional params described in Slack API by passing them through a map.

(require 'clj-slack.stars)
(def connection {:api-url "https://slack.com/api" :token "YOUR TOKEN"})
(clj-slack.stars/list connection {:count "2" :page "3"})

Uploading a file:

(require 'clj-slack.files)
(def connection {:api-url "https://slack.com/api" :token "YOUR TOKEN"})
(clj-slack.files/upload connection (clojure.java.io/input-stream "/path/to/file/file.ext") {:channels "CHANNEL_ID", :title "This is a file.})

Testing

In order to run the tests, you have to set 3 environment variables:

  • TOKEN a legacy Slack token
  • CLIENT_ID a OAuth client id
  • CLIENT_SECRET a OAuth client secret then run lein test.

License

Copyright (C) 2014-2019 Julien Blanchard

Distributed under the Eclipse Public License, the same as Clojure.

More Repositories

1

terminal-notifier

Send User Notifications on macOS from the command-line.
Objective-C
6,206
star
2

slacker

Erlang Slack REST API wrapper
Erlang
54
star
3

resque-waiting-room

Resque plugin that throttles your jobs
Ruby
34
star
4

dotnet.el

dotnet CLI minor mode for Emacs
Emacs Lisp
29
star
5

ivy-lobsters

Browse lobste.rs stories from emacs with ivy
Emacs Lisp
24
star
6

helm-lobste.rs

An Helm front-end for Lobste.rs
Emacs Lisp
20
star
7

erc-terminal-notifier.el

OSX notifications via the terminal-notifier gem for Emacs ERC.
Emacs Lisp
17
star
8

mocker

Mock an HTTP service
Rust
17
star
9

resque-slack

Post failed Resque jobs notifications in a Slack channel
Ruby
17
star
10

gophsters

Generate a gophermap from lobste.rs recent stories
Rust
14
star
11

Brewery

Graphical interface for homebrew package management in MacRuby
Ruby
13
star
12

GettingStartedWithFSharpAndDotNetCore

Getting Started With F# And .NET Core examples
F#
7
star
13

julienxx.github.com

julienxx.github.com Github page
CSS
6
star
14

GAppsProvisioning

Google Apps Provisioning API v2.0 Ruby client library
Ruby
6
star
15

email-checker

Rust on AWS Lambda example
Rust
4
star
16

dotvim

My .vim
Vim Script
4
star
17

campfire-notifier

Campfire Notifier written in Clojure
Clojure
4
star
18

dotemacs

.emacs.d
Emacs Lisp
4
star
19

Sideburns.eu

My blog
JavaScript
3
star
20

dotfiles

Various dot files
Shell
3
star
21

iShrt.tl

Iphone app for Tigerlily's URL shortener shrt.tl
Objective-C
2
star
22

i3config

Perl
2
star
23

favfetcher

FavIcon fetcher
Clojure
2
star
24

getafe

Getafe Vim Color scheme
Vim Script
2
star
25

elixir_exercices

PragProg Elixir book exercises
Elixir
2
star
26

ChromiumUpdater

Updates Chromium OS X with the latest build
Ruby
2
star
27

fingers

Finger command with Slack as a Backend
Rust
2
star
28

MadRiver

Mad River website
JavaScript
2
star
29

soccer-ocaml

Get soccer results from the command line.
OCaml
2
star
30

ClojureSandbox

My Clojure sandbox
Clojure
2
star
31

rouflaquettes

Twitter favorites to Del.icio.us bookmarks converter
JavaScript
2
star
32

Topfunky.tmTheme

A TextMate theme inspired by @topfunky emacs theme.
2
star
33

Resquell

Do stuff with Resque jobs in Haskell
Haskell
1
star
34

simple-server

A very simple HTTP server.
Rust
1
star
35

vatmess

A simple JSON API to retrieve what VAT rate to apply to an EU customer. #VATMESS
Clojure
1
star
36

yeoman.el

Interact with Yeoman from Emacs.
Emacs Lisp
1
star
37

dlobstergopher

Create a gophermap file from lobste.rs newest entries
D
1
star
38

rust-resque-example

Use Resque from Rust examples.
Rust
1
star
39

gophell

Haskell
1
star
40

clojure-is-love

Slides from my talk at Functional Progammers Paris - Take 1.
JavaScript
1
star