Hey everybody,

Once upon a time I wrote bindings for Flickr API for Common Lisp.  Now
that I'm getting into Clojure I've ported and improved them:

  http://github.com/schani/flickr-clojure/tree/master

Right now the high level interface only supports reading calls.  I do
plan to implement writing calls, like adding or removing tags,
organizing photos in sets, etc, but they won't be my main focus.  What
I have planned next is implementing persistent caching of API call
results, so that I can do data analysis without having to re-fetch
everything if I run a new Clojure instance.

Something unrelated to Flickr that might be of interest is a little
macro I've written to map parsed XML data to sane data structures.
For example, flickr_api.clj declares

(defapistruct flickr-group
  (id :id)
  (name (:child :name :body))
  (description (:child :description :body))
  (members (:child :members :body) :integer)
  (privacy (:child :privacy :body)))

which defines a function make-flickr-group which turns this XML

  <group id="123">
    <name>Foo</name>
    <description>Bar</description>
    <members>42</members>
    <privacy>quux</privacy>
  </group>

into this map:

  {:description "Bar", :id "123", :members 42, :name "Foo", :privacy
"quux"}

It doesn't handle everything that can arise in XML.  For example, it
cannot extract more than one child with the same name.  It's also
hidden as a non-public API, but if there's interest, I'll make it a
separate, public API.

Mark

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to