Skip to content

Instantly share code, notes, and snippets.

@laod
Created August 5, 2012 04:28
Show Gist options
  • Save laod/3261683 to your computer and use it in GitHub Desktop.
Save laod/3261683 to your computer and use it in GitHub Desktop.
Watch me publicly fail at clojure
(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