Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Wordnik API library for Clojure
Clojure
branch: master

Merge pull request #2 from bitdeli-chef/master

Add a Bitdeli Badge to README
latest commit a24a17f040
@joshrotenberg authored
Failed to load latest commit information.
docs update marginalia docs
resources getting closer to something that, you know, works
src/wordnik fix docstring/param positions
test/wordnik/test
.gitignore first commit, just some basic layout, nothing really works yets
README.md Add a Bitdeli badge to README
project.clj added some docs, bump version to alpha1

README.md

clj-wordnik

A Clojure client for Wordnik's API.

Docs

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.

Usage

in your project.clj

[clj-wordnik "0.1.0-alpha1"]
(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
))

Testing

You'll need to specify your Wordnik API key, username and password in the resources/test.properties file to run the tests.

Examples

For now just see the unit tests.

Status/TODO

  • 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

Credits

Lots of inspiration from Adam Wynne/Stream Science's twitter-api.

Raynes put a clj-wordnik up just after mine, so we decided to work together to fight for wordless people everywhere.

License

Copyright (C) 2011 Josh Rotenberg

Distributed under the Eclipse Public License, the same as Clojure.

Bitdeli Badge

Something went wrong with that request. Please try again.