Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (33 sloc) 1.37 KB
(ns foreclojure.feeds
(:require [ :refer [emit-str element]]))
(defn create-feed
"Creates a feed with title, link, description, a link to the location
of the feed itself, and is populated with a collection of items in the
following format:
(element :item
(element :guid \"\")
(element :title \"Title of Item\")
(element :description \"Description of Item\"))"
[feed-title feed-link feed-description resource-link items]
(element :rss {:version "2.0"
:xmlns:atom ""}
(apply element :channel {}
(element :atom:link {:href resource-link
:rel "self"
:type "application/rss+xml"})
(element :title {} feed-title)
(element :link {} feed-link)
(element :descrption {} feed-description)
;; Testing Validity
;; Paste the resulting test.xml file into the w3c validator
;; to verify your feed is valid.
(spit ( "test.xml")
(create-feed "Recent Problems"
"Recent problems at 4clojure"
(problem-feed 20))))
Something went wrong with that request. Please try again.