Scratchy - an online scratch pad

Scratchy Screenshot

Client: In house project
Date completed: Ongoing (April 2007, v0.1)
Platform: Ruby, Camping microframework, SQLite3
License: MIT; Open Source
Source: Available
Technologies: ActiveRecord, CodeRay syntax highlighting, Rubilicious (del.icio.us Ruby API)

The Solution:

This project was primarily for fun, and to learn a little about the Camping microframework - it also allowed me to play with Ruby outside of the confines of Rails. The requirement was simple - I use multiple machines in the course of development, and frequently want to transfer links, source code snippets and other data between them.

Scratchy was modelled after a number of existing pastebin-style applications, primarily pastie (pastie.caboo.se), which is how I learned of the CodeRay syntax highlighter. Scratchy includes a simplified tagging capability, modelled from Rails’ acts_as_taggable plugin. Tags are also used to specify the type of syntax highlighting to apply, e.g. ‘code:ruby’ indicates that the entry should be formatted as Ruby, ‘code:c’ for C code, etc.

I also implemented a simple tag cloud feature, where the relative size and colour of the tag text is determined by the frequency at which the tag appears in the corpus of tags.

When I needed to test the tag cloud, I wanted to import a large amount of data, so I wrote a ‘bare bones’ del.icio.us importer which imported my del.icio.us bookmarks into the Scratchy database.

In the future, I plan to provide an API through which I can paste data, which would allow me to create a Firefox extension or Javascript bookmarklet to interface with Scratchy.