Flickr redux

I have switched from the native java scriptlet as provided by Flickr’s “badge” and implemented Dave Kellam’s flickrRSS plugin, as suggested by matthew.

The xhtml invalid count has dropped considerably down to a handful, surrounding the lack of correct encoding of the & character. By default xhtml compliant code must ‘encode’ the & symbol as `&`.

This is less a problem with the plugin, and more a general problem with flickr URI formatting semantics. Why flickr chose to use an & rather than something like ? or ! which do not cause URI encoding issues I’ll never now.

On the bright side, the plugin does cache thumbnails of each image, which helps improve performance and cuts down on multiple hits to the RSS feed every time the same browser returns to the page.

Update: the above plugin is very cool. Works well and doesn’t spit out any unnecessary code (and is compliant which rocks).

≡ This is a journal entry relating to the topics of , .

Brendan Borlase is a Systems and Network Administrator living in Adelaide, Australia, having lived, worked and breathed Information Technology for over 12 years. Learn more.

Feedback is encouraged. If you would like to read more, consider subscribing to the regularly updated RSS Feed.


  1. dave

    Thanks for using the plugin. The code should validate, I think you just need to encode the ampersands in he link to your flickr rss feed.

    They probably went with the ampersand because it looks prettier in urls than ?s or !s.

  2. brendan

    I think you just need to encode the ampersands

    Yes, I’ve tried encoding the ampersands in general, as well as your plugin (and the flickr badge) however it still renders as `&` on browser load, which = bad as far as the xhtml validator is concerned.

    It’s a tricky problem to fix as the URL’s appear to get constructed during page load, rather than prior to or on, which makes it very difficult to encode an ampersand (as it’s yet to exist at that point).

    Yes, ‘&’ is often used in URI construction, however some browsers have major problems with an unencoded ampersand which can lead to malformed URLs..

  3. dave

    From the validation results:

    Line 121, column 206: cannot generate system identifier for general entity “format”

    …ds/photos_public.gne?id=71528489@N00&format=rss_200″ title=”flickr RSS feed”>

    That appears to just be the your link to the rss feed, the plugin doesn’t generate that code. I didn’t encode the ampersands that are used to fetch the RSS feed but that shouldn’t matter because it’s php stuff that occurs in the background.

  4. brendan

    Fixed. Looks like I missed an ampersand. Nice spotting. :)