Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/a-sync/slackr

Simple shell command to send or pipe content to slack via webhooks. (To upload snippets or files use: www.github.com/a-sync/slackfu)
https://github.com/a-sync/slackr

shell shell-script slack slack-api slack-bot slack-messages slack-webhook slackbot webhook-api

Last synced: about 2 months ago
JSON representation

Simple shell command to send or pipe content to slack via webhooks. (To upload snippets or files use: www.github.com/a-sync/slackfu)

Awesome Lists containing this project

README

        

# slackr

## Requirements
* bash compatible shell
* sane install of python
* sane install of curl

## Installation
1. download and unpack the [archive](https://github.com/a-sync/slackr/archive/master.tar.gz)
2. enter the unpacked directory and make [slackr](slackr) executable
3. set [your webhook](https://my.slack.com/services/new/incoming-webhook/) URL in the WEBHOOK_URL variable of [slackr](slackr#L3)
4. create a global symbolic link
```bash
curl -sL https://github.com/a-sync/slackr/archive/master.tar.gz | tar xz
cd slackr-master && chmod +x slackr
read -p "Enter webhook URL: " WHURL && sed -i "3s|.*|WEBHOOK_URL=\"$WHURL\"|" slackr
sudo ln -s "$(readlink -f slackr)" /usr/local/bin
```

## Usage
```
Usage: slackr [options]

Options:
-r
-i
-n
-c
-a
-t
-l
-f
-w

Examples:
slackr some text
slackr -c good -n friendlybot -i :cat: hello
slackr -r general < logfile.txt
ls -la /etc/ | slackr -r D024BE91L -f "$(history 1)"
tail /var/log/syslog | slackr -a "$(id -un) $(hostname -f)"
```

## :warning: Important
[@username format as a recipient (-r) is deprecated!
Slack API support was removed on 2018-09-12.](https://github.com/a-sync/slackr/wiki#important)