Created
August 5, 2012 04:28
-
-
Save laod/3261683 to your computer and use it in GitHub Desktop.
Watch me publicly fail at clojure
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 headspace.core | |
(:use noir.core | |
korma.db | |
korma.core | |
clojure.pprint) | |
(:require [noir.server :as server] | |
[noir.response :as response] | |
[clojure.string :as string] | |
[net.cgrand.enlive-html :as h]) | |
(:import java.net.URL)) | |
(defdb db (mysql { | |
;remember to start ssh tunnel | |
:db "loophole" | |
:user "loophole" | |
:delimiters "" | |
:password ""})) | |
(defentity entries) | |
(defpage "/doi" {} | |
(h/emit* (h/at* | |
(h/html-resource (URL. "http://loophole.morpheus.net/hs/page.html")) | |
(for [e (select entries (where {:date "062804"}))] | |
`([~(keyword(str "div." (:category e)))] ~(h/html-content (:data e))))))) | |
(server/start 8080) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment