From b3e67d2ac466fba0056f01534d17330eaf01d799 Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Wed, 12 Dec 2012 15:04:12 -0500 Subject: [PATCH] Document humbug-send and humbugrc in README for API users (imported from commit 9ca282d4d768f2d2a474da1209621f03147954fe) --- README | 19 ++++++++++++++++--- examples/humbugrc | 4 ++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 examples/humbugrc 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=