diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2009-03-06 21:46:25 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2009-03-06 22:33:44 +0100 |
commit | 63edb54f04e19d98625366807e3c482bef44f836 (patch) | |
tree | 5d16d5f393ab0eff4a2f0f2b80993ab58039b0c4 /cljssss-g.clj | |
parent | 2a57624dd5c54110cf328a8bac079d36dbcae0ec (diff) |
Show feed entries using JavaScript if possible.
Diffstat (limited to 'cljssss-g.clj')
-rw-r--r-- | cljssss-g.clj | 17 |
1 files changed, 17 insertions, 0 deletions
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 "<?xml version='1.0'?>" + "<response>" + "<uri>" link "</uri>" + "<title>" title "</title>" + "<content>" (escape-xml (entry-xhtml-content entry)) "</content>" + "</response>")))) + (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 "*" |