├── README.md └── toslack /README.md: -------------------------------------------------------------------------------- 1 | # toslack 2 | stdin writes to slack 3 | 4 | # setup 5 | 1. Set up a private slack 6 | 2. [Generate a slack webhook url](https://slack.com/help/articles/115005265063-Incoming-WebHooks-for-Slack) 7 | 3. Put it in the toslack file OR save it as a bash variable in your .bashrc 8 | 4. Put the toslack file into your path (such as /usr/bin) 9 | 5. Now you can write to your slack via stdin like this `echo hello worl | toslack` 10 | -------------------------------------------------------------------------------- /toslack: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | message=`cat` 4 | curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$message\"}" $SLACK_WEBHOOK_URL 5 | --------------------------------------------------------------------------------