FlickrScrapr - A PDF album generator from flickr

front coverSample page

This XSL stylesheet takes as parameters a flickr user name (and optionally the name of a photoset of that user) and generates a photo album of the user's pictures.


danbri's pictures (3MB), maxf's pictures (4.5MB), koalie's "My art" photoset (1.1MB)


You will need an XSL processor (XSLT and XSLFO). I have used RenderX's XEP to generate the examples. FOP is an open source one but doesn't currently format pages exactly as they should.

You'll need to download the stylesheet, and the parameter file. The parameter file should be customised:

  <UserName>maxf</UserName> flickr nickname of the person to get pictures of
  <photoSet>berlin</photoSet> the name of a photoset (optional)
  <APIKey>6ca7853542bf3d2be6b08173406fb211</APIKey> don't change this!
  <nbPhotos>20</nbPhotos> grab the 20 last pictures. Put a large number to 
                          get all the pictures (flicker won't allow more than
                          500). This parameter is used only when fetching among
                          a user's entire collection (i.e. not a particular

Then run as your xsl engine requires it. I do:

xsltproc fs.xsl params.xml >
xep -fo fs.pdf

How it works

The flickr web services API is very simple. The stylesheet uses the REST interface: the request URLs are generated from the parameter files, the response is queried through XSLT's document() function and then parsed. In order:

Of course, flickr stores a lot of extra info, and many improvements can be envisaged.


Many already. If your nick has spaces, it won't work. If you have markup in descriptions, it'll be displayed as is (blame flickr on that one).

I'm not planning to do much more work on the stylesheet, though.


Format albums for tags or groups.

Handle better many cases: description too long, picture size too small, etc.

Allow for more customisation of the layout, without having to go through the XSL.

Add options to add more info from flickr: annotations, user info, contacts, comments, etc.


Copyright (c) Max froumentin

This software is provided under the W3C Software Licence, i.e. do what you want with it except blame me.

Max Froumentin (