today | current | recent | random ... categories | search ... who ... syndication

The so-called “w5” API

I've spent the last couple days creating a little wxPython application that periodically polls the Mirror Project for a random image and displays it in a window.

  The Mirror Project Random Image Widget 1.0b1

Whether this particular application, or the service it talks to, are made public remains to be decided.

Either way, I'd like to spin the idea into something more generalized that would allow me to display random images from Out There. So, I am thinking of adding hooks to store a list of servers that expose a w5.RandomImage() method and return a hash-like data structure containing six pairs:

  • image (base64, as in the actual binary data for an image)
  • who (string)
  • what (string)
  • where (string)
  • when ( string )
  • why (string)

Currently the widget only does this via XML-RPC but, depending on things like requirements for unencrypted authentication, it could be taught something like Atom.

The idea here is that people will build, or have built, the server-side widget that figures out how, and to whom, to return a random image. The method itself currently doesn't pass any arguments and if did it would be a single hash-like data structure like this:

  • login (string)

    As in a traditional username:password string, or a key consisting of random gibberish or even a nonce if I ever get around to understanding them.

  • exclude (base64)

    As in, something LOAF -ish in nature that the client passes the server indicating which images have already been seen . If the server has been taught to handle Bloom Filters it could use this data to check a return value before sending an image the user. This has the advantage of sparing the photographer wasted bandwidth and the viewer the annoyance of seeing the same image twice.

    Careful readers will note that this means the server needs to return a seventh pair (a unique ID for the image) not listed above — cookies and a glass of milk for you!

None of these parameters are required. They are included as a way to provide some baseline of control and convenience for people on both ends of the connection but, really, nothing more.

After all, this is just a dumb client for displaying chance images that live out there on the Network because it's the kind of thing that makes the day a little richer. If you feel like you're going to need to be able to blog something as it travels across your desktop, take a screenshot or something.

Anyway, the next step is to figure out how to make the widget in hand into a stand-alone binary on the various platforms. Then I will work on adding the required fu for talking to muliple servers.

meta

 
Norman Walsh : Not in RDF ←  → I fell in love with these things staring at the ceiling of Toronto's Bar Italia.