doc.txt

Scheme API for Flickr

_Scheme API for Flickr_
_flickr_

David Van Horn
<[email protected]>

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

   http://www.flickr.com/services/api/

To import the library:

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

See example.ss 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
raised.

_current-api-key_

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
ommitted.

_current-sec-key_

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

_sign-all?_

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.

_non-text-tags_

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:

   (flickr.reflection.getMethods)

Evaluates to:

   '((methods
      ()
      "\n\t"
      (method () "flickr.activity.userComments")
      "\n\t"
      (method () "flickr.activity.userPhotos")
      "\n\t"
      ...))

Whereas:

   (parameterize ((non-text-tags (cons 'methods (non-text-tags))))
     (flickr.reflection.getMethods))

Evaluates to:

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