https://github.com/mrtazz/disrupt
send notifications via multiple providers
https://github.com/mrtazz/disrupt
Last synced: over 1 year ago
JSON representation
send notifications via multiple providers
- Host: GitHub
- URL: https://github.com/mrtazz/disrupt
- Owner: mrtazz
- License: mit
- Created: 2014-08-31T21:58:24.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-12-10T00:13:57.000Z (over 10 years ago)
- Last Synced: 2025-01-25T23:17:21.231Z (over 1 year ago)
- Language: Go
- Size: 1.91 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# disrupt [](https://travis-ci.org/mrtazz/disrupt)
## Overview
Library to enable notifications via multiple providers. Because nothing is
more useful than being interrupted more easily. It's possible to register
multiple notifiers and when the `NotifyAll` call is run, all of them will be
notified.
## Usage
### Library
disrupt can be used as a library from other applications like this:
```
disrupt.RegisterPushoverNotifier(*pushover_token, *pushover_user)
disrupt.RegisterTwilioNotifier(*twilio_sid, *twilio_token, *twilio_from, *twilio_to, *sms_max_char)
disrupt.NotifyAll(title, content)
```
### CLI
disrupt also comes with a simple CLI notifier that takes input via STDIN. The
first line is used as the notification title and all subsequent lines are sent
as the message body. It uses config.ini style parsing for easy scripting and
also allows params to be passed in on the command line:
```
% ./cli-notifier -help
-debug=false: set debug mode
-help=false: show help
-maxchar=160: max number of characters to use for SMS
-pushover=false: send notifications via pushover
-pushover_token="": API token for pushover
-pushover_user="": pushover user key
-twilio=false: send notifications via twilio
-twilio_from="": from address for twilio
-twilio_sid="": twilio sid
-twilio_to="": address to send to via twilio
-twilio_token="": twilio token
% cat ~/.config/cli-notifier/config.ini
pushover_token = 999999999999999999
pushover_user = uuuuuuuuuuuuuuu
pushover = true
twilio_sid = ooooooooooooooooooooooo
twilio_token = 88888888888888888888
twilio_from = +11111111
twilio_to = +2222222
twilio = false
maxchar = 160
```
## Installation
go get it like it's hot.
```
go get github.com/mrtazz/disrupt
```