Skip to content

Instantly share code, notes, and snippets.

Created June 22, 2010 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/448916 to your computer and use it in GitHub Desktop.
Save anonymous/448916 to your computer and use it in GitHub Desktop.
(ns src.www.controller
"The controller."
(:use
compojure.html,
neo4j))
(defn today
[]
(. (new java.text.SimpleDateFormat "yyyy-MM-dd") format (new java.util.Date))
(defn post
"Writes a post to the database"
[user title text]
(with-tx
(let
[post (new-node {:date today, :title title, :text text})
user-node (lookup "name" user)]
(relate user-node :blogged post)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment