diff --git a/README b/README index 928553f..63de042 100644 --- a/README +++ b/README @@ -15,9 +15,14 @@ as we make any changes to them. The easiest way to use these API bindings is to base your tools off of the example tools under api/examples in this distribution. -If you place your API key in ~/.humbug-api-key the Python API -bindings will automatically read it in. You can obtain your Humbug -API key from the Humbug settings page. +If you place your API key in `~/.humbugrc` the Python API bindings will +automatically read it in. The format of the config file is as follows: + + [api] + key= + email= + +You can obtain your Humbug API key from the Humbug settings page. A typical simple bot sending API messages will look as follows: @@ -48,3 +53,11 @@ send_message() returns a dict guaranteed to contain the following keys: msg, result. For successful calls, result will be "success" and msg will be the empty string. On error, result will be "error" and msg will describe what went wrong. + +#### Sending messages + +You can use the included `api/bin/humbug-send` script to send messages via the +API directly from existing scripts. + + humbug-send hamlet@example.com cordelia@example.com -m \ + "Conscience doth make cowards of us all." diff --git a/examples/humbugrc b/examples/humbugrc new file mode 100644 index 0000000..5e2bd33 --- /dev/null +++ b/examples/humbugrc @@ -0,0 +1,4 @@ +; put this file in ~/.humbugrc +[api] +key= +email=