From 63edb54f04e19d98625366807e3c482bef44f836 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Fri, 6 Mar 2009 21:46:25 +0100 Subject: Show feed entries using JavaScript if possible. --- cljssss-g.clj | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'cljssss-g.clj') diff --git a/cljssss-g.clj b/cljssss-g.clj index 02c5eeb..79ff25a 100644 --- a/cljssss-g.clj +++ b/cljssss-g.clj @@ -272,6 +272,21 @@ to merely being replaced with a div element)?" "xhtml_content_p" (not (nil? xhtml-content)) "xhtml_content" xhtml-content})))))) +(defn show-entry-xml [entry] + (with-db + (sql/with-query-results + [{link :link, title :title}] + [(str "SELECT entry.link, entry.title, entry.id" + " FROM entry, feed_entry_link, user_feed_link" + " WHERE entry.id = ?") + entry] + (str "" + "" + "" link "" + "" title "" + "" (escape-xml (entry-xhtml-content entry)) "" + "")))) + (defmacro with-session "Rebind Compojure's magic lexical variables as vars." [& body] @@ -313,6 +328,8 @@ to merely being replaced with a div element)?" (and (params :feed) (Integer/parseInt (params :feed))) (Integer/parseInt entry-id-string))))) + (GET "/entry-xml" + (with-session (show-entry-xml (params :id)))) (GET "*" (serve-file path)) (ANY "*" -- cgit v1.2.3