Scheme API for Flickr

_Scheme API for Flickr_

David Van Horn

This collection provides a Scheme wrapping to the Flickr web service:

To import the library:

   (require (planet "" ("dvanhorn" "flickr.plt" 1 0)))

See for a example program that logs in a user and makes
authenticated calls to the API.

Procedures are named exactly as in the Flickr API.  Arguments are
specified with keywords spelled exactly as in the API, their values
must always be strings.  

Here is an example call to the echo method (the value of the api_key
should be changed to your own key, assigned by Flickr):

   (flickr.test.echo #:api_key "123"
                     #:foo "bar")

Calling a procedure returns a list of Xexprs constituting the
[xml-payload-here] portion of the response (see the Flickr
documentation on example responses).  In this example, the return
values is:

   '((method () "flickr.test.echo") 
     (api_key () "123") 
     (foo () "bar"))

If the Flickr service responds with an error response, an exception is


The api_key argument is required of every method in the Flickr API.
If ommitted from a Scheme procedure call, the value defaults to the
value of the `current-api-key' parameter.  So the above could be
written as:

   (current-api-key "123")
   (flickr.test.echo #:foo "bar")

Methods may have required arguments and an error will be raised if


Signed methods rely on the current-sec-key parameter for the Flickr
API secret key.


For methods that must be signed (according to inspection of the method
information using reflection) will automatically be signed.  The
signing of other methods is sensitive to the sign-all? parameter: when
true, all methods are signed; when false, they are not.


The parameter `non-text-tags' controls the handling of whitespace in
the XML to Xexpr conversion.  The value is passed to the
`eliminate-whitespace' procedure defined in the net collection.

For example:


Evaluates to:

      (method () "flickr.activity.userComments")
      (method () "flickr.activity.userPhotos")


   (parameterize ((non-text-tags (cons 'methods (non-text-tags))))

Evaluates to:

      (method () "flickr.activity.userComments")
      (method () "flickr.activity.userPhotos")