Created
June 22, 2010 19:13
-
-
Save anonymous/448916 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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