A Clojure client for Wordnik's API.
See the uberdoc in docs, generated by Marginalia.
For the most part API calls follow the methods found on Wordnik's API documentation, with a few exceptions. Most calls are simply the call name and then the params as keywords:
(examples "vinculum" :include-duplicates false :api-key "<your api key>")
All call parameters can use the more lispy '-' separated style and they will be converted to camel case automatically, for example the word-examples call has a 'useCanonical' param, but in clj-wordnik this can be specified as 'use-canonical'.
You can specify the api-key as a parameter directly, or use the with-api-key call to group multiple calls together without having to specify it for each one. You can also do the same with with-auth-token for calls that require it.
in your project.clj
(ns your.app (:use wordnik.core [wordnik.api word]) ) ;; get your api key from somewhere (def my-api-key "<your wordnik api key here>") ;; look up the word discombobulated (with-api-key my-api-key (let [discombobulated (word "discombobulated")] ;; do stuff with discombobulated ))
You'll need to specify your Wordnik API key, username and password in the resources/test.properties file to run the tests.
For now just see the unit tests.
- all api calls are supported
- nuke obvious args like :word in favor of a required first position arg or something
- write more docs
- write more tests
Raynes put a clj-wordnik up just after mine, so we decided to work together to fight for wordless people everywhere.
Copyright (C) 2011 Josh Rotenberg
Distributed under the Eclipse Public License, the same as Clojure.