Click to expand.

Registration form. Users must identify the animals displayed in both groups.

Click to expand.

The editing view from foo(book)

Click to expand.

A typical "scrap" of code hosted on foo(book).

Click to expand.

The front page of the site, used for news and announcements.

Click to expand.

Comments displayed on a typical announcement

Click to expand.

The user's panel of tools on a scrap. Icons from left to right are 'Edit,' 'Add to favorites,' and 'Delete.' The latter two use AJAX.

Click to expand.

View of a user's index, featuring titles, descriptions and tags.

Click to expand.

Another view of the index. Features additional metadata. A visitor to the page can change by what criteria the rows are sorted. Logged-in users can edit or delete their own scraps, while others can favorite them.

Click to expand.

A typical scrap of code. This one is my alpha implimentation of the Convio REST API.

foo(book):

foobook.org

foo(book) is a web app I built and maintain. I've found that most coders have a folder on their computer called /scripts/, or something similarly poorly organized, which contains little pieces of code they might someday like to reuse. For example, a few weeks before this writing I wrote about two dozen lines of python to find and replace redirected links on csicop.org.

In the future, I will almost certainly need to search a database, or extract links, or find and replace something else, so I keep the script around as a future jumping-off point.

I created foo(book) to help me to save, tag and organize "scraps" of code. They're easy to download, export, embed, subscribe to and all that. Backup versions are preserved and are retrievable with a user-friendly AJAX widget in the edit view of a scrap.

I created foo(book) over the course of two or three months as an exercise in applying some of Django's more interesting features. foo(book) relies on Django for:

  • Caching and compression
  • Custom signals
  • The admin interface
  • Sessions and authentication
  • Syndication
  • Lots of other stuff

Syntax highlighting is handled with the Python library Pygments.

Site search relies on a customized view in Haystack, using Xapian as a backend. On launch, there was a problem with searches that resemble broken regular expressions (e.g. "i++") causing errors. This required a tweak to Haystack's highlighting function, my patch for which was later accepted by the project.

My favorite feature is the home-brew CAPTCHA alternative I cooked up for the app. When new users register, they're prompted to identify the animals in two sets of photos. These images are pulled from flickr pools of specific animals using Python's lxml.etree. The result is a constantly-refreshing set of randomized images of specific species of readily identifiable animals.

This test has the advantage of a minimal cultural bias. Additionally, it's very difficult for computers, but easy and sort of fun for humans. I have not yet gotten around to developing an alternative for visually impaired users.