sarumont/py-trello — pull request #29 by naiyt (2013-08-27 01:27:20+00:00)
Title: WebHook functionality for listing, creating, and deleting hooks

Added basic WebHook functionality (see issue #27).

Return a list of all your WebHooks by auth token:

`my_hooks = my_client.list_hooks() # Optionally pass in an auth token for hooks other than your TrelloClient's`

You can then view the `id_model`, `callback_url`, etc on each of those hooks. You can also call `.delete()` on any of those hooks to delete the hook.

Creating a new hook:

`new_hook = my_client.create_hook(callback_url, id_model[, description[, token]]) # Token defaults to your TrelloClient's`

That'll send a request to Trello to create a new WebHook for your callback url and the id model specified.

There's an issue with using httplib2 in creating WebHooks it seems. Dunno, why, [and the Trello guys don't seem to be sure either](https://trello.com/c/IMVYmVG1/1458-webhooks). That's why I threw in urllib2, as it works fine with that. If someone can figure out how to get it to work with httplib2 instead, that would probably good for the sake of consistency. If this request gets merged, I'll open an issue about it.