powered by text files


Bitly API via Clojure

While playing with links in Clojure for Photozeit, I wanted to shorten them via and to also lookup click counts per link.

The API is quite straightforward, so I wrote a small library, clojure-bitly, to allow access to it from Clojure.

The Github page includes some example code, and the library can be downloaded from Clojars using either Lein or Maven.

Here is how to shorten a url:

user> (bitly/with-auth *bitly-user* *bitly-apikey*
        (bitly/shorten ""))

The Bitly API docs have more details on which methods are available, or check out the source.