   getSketches(SKETCH_DIR).then (sketches) ->
     q(getSketchesByTags(sketches, tag)).then (list) ->
       res.send header + formatList(list) + footer
+
+showSketchesByRange = (req, res) ->
+  start = req.query.start
+  end = req.query.end
+  getSketches(SKETCH_DIR).then (sketches) ->
+    inRange = sketches.filter (x) ->
+      return x >= start && (!end || x <= end)
+    res.send header + formatList(inRange) + footer
 
 serveImagesByDate = (req, res) ->
   getSketches(SKETCH_DIR).then (sketches) ->

fs = require 'fs'
path = require 'path'
q = require 'q'

################################################################################
# Utility functions
getSketches = (dir) ->

app.get '/date/:year/:month?', serveImagesByDate
app.get '/nonjournal', listNonjournalSketches
app.get '/journal', listJournalSketches
app.get '/range', showSketchesByRange
app.get '/', serveRandomImage
app.post '/followup/:filename', followUp
app.listen process.env.PORT || 3000, () ->
  console.log "Listening on " + (process.env.PORT || 3000)
