<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>contract-lp.ss</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,28 +2,26 @@
 
 (require &quot;time.scm&quot;
          &quot;util.scm&quot;
+         &quot;contract-lp.ss&quot;
          &quot;web-support.scm&quot;
+         &quot;settings.scm&quot;
+         &quot;page.scm&quot;
          (planet &quot;uuid-v4.ss&quot; (&quot;zitterbewegung&quot; &quot;uuid-v4.plt&quot; 1 0)))
 
 (provide  atom-item
-          atom-inc
-          atom-wrapper
+          atom-feed
 
-          rss-inc
-          rss-wrapper
-          rss-item
-          rss-li)
+          rss-feed
+          ;; rss-item (via contract)
+          )
 
-(define (atom-inc feed-url)
-  `(link ((rel &quot;alternate&quot;) (type &quot;application/atom+xml&quot;) (href ,feed-url))))
-
-(define (atom-wrapper feed-title
-                      feed-subtitle
-                      feed-url
-                      url
-                      author-name
-                      author-email
-                      . body)
+(define (atom-feed feed-title
+                   feed-subtitle
+                   feed-url
+                   url
+                   author-name
+                   author-email
+                   . body)
   (list-response #:type #&quot;text/xml&quot;
                  (list (raw-str &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;utf-8\&quot;?&gt;&quot;)
                        `(feed ((xmlns &quot;http://www.w3.org/2005/Atom&quot;))
@@ -44,73 +42,56 @@
     (updated ,(atom-time-str (current-seconds)))
     (summary ,item-summary)
     (content ,item-content)))
+
 ;;
 ;; rss-inc
 ;;
-;; Function to include the browser feed autodiscovery link in your page.
+;; Function to include the browser feed auto-discovery link in your page.
 ;;
 (define (rss-inc feed-url)
   `(link ((href ,feed-url) (rel &quot;alternate&quot;) (type &quot;application/rss+xml&quot;)
           (title &quot;Sitewide RSS Feed&quot;))))
 
 ;;
-;; rss-wrapper
+;; rss-feed
 ;;
-;; Main wrapper function to create an RSS 1.0 feed.
+;; Generate an RSS 1.0 feed.
 ;;
-(define (rss-wrapper about
-                     channel-title
-                     channel-link
-                     channel-description
-                     channel-image
-                     item-list
-                     . body)
+;(provide/contract
+; (rss-feed ))
+;;
+(define (rss-feed rss-feed-page
+                  #:feed-title feed-title
+                  #:feed-description feed-description
+                  #:original-content-link (original-content-link (setting *WEB_APP_URL*))
+                  #:items (rss-items '()))
   (list-response #:type #&quot;text/xml&quot;
-                 (list (raw-str &quot;&lt;?xml version=\&quot;1.0\&quot;?&gt;&quot;)
+                 (list (raw-str &quot;&lt;?xml version=\&quot;1.0\&quot; encoding=\&quot;utf-8\&quot;?&gt;&quot;)
                        `(rdf:RDF
                          ((xmlns &quot;http://purl.org/rss/1.0/&quot;)
                           (xmlns:rdf &quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;))
-                         (channel
-                          ((rdf:about ,about))
-                          (title ,channel-title)
-                          (link ,channel-link)
-                          (description
-                           ,channel-description)
-                          (image ((rdf:resource ,channel-image)))
-                          (items 
-                           (rdf:Seq  
-                            ,@item-list)))
-                         ,@body))))
+                         (channel ((rdf:about ,(page-url rss-feed-page)))
+                                  (title ,feed-title)
+                                  (link ,original-content-link)
+                                  (description ,feed-description)
+                                  (items (rdf:Seq  ,@(map rss-li rss-items))))
+                         ,@(map markup-rss-item rss-items)))))
 
-;;
-;; rss-li
-;;
-;; RSS list element creator.
-;;
-(define (rss-li resource-link)
-  `(rdf:li ((resource ,resource-link))))
+(define (rss-li rss-item)
+  `(rdf:li ((resource ,(rss-item-url rss-item)))))
 
-;;
-;; rss-item
-;;
-;; Creation of RSS items.
-;;
-(define (rss-item rdf-about item-title item-link item-description)
-  `(item
-     ((rdf:about ,rdf-about))
-     (title () ,item-title)
-     (link () ,item-link)
-     (description () ,item-description)))
+(define-struct rss-item (title url description))
 
-;;
-;; rss-textinput
-;;
-;; Creation of RSS textinput items.
-;;
-(define (rss-textinput about text-title text-description text-name text-link)
-  `(textinput
-    ((rdf:about ,about))
-    (title () ,text-title)
-    (description () ,text-description)
-    (name () , text-name)
-    (link () ,text-link)))
+(provide/contract
+ (rename construct-rss-item rss-item (-&gt;* (#:title string? #:url string?)
+                                          (#:description (or/c #f string?))
+                                          rss-item?)))
+(define (construct-rss-item #:title title #:url url #:description (desc #f))
+  (make-rss-item title url desc))
+
+(define (markup-rss-item rss-item)
+  (let ((url (rss-item-url rss-item)))
+    `(item ((rdf:about ,url))
+           (title ,(rss-item-title rss-item))
+           (link ,url)
+           ,@(splice-if (aand (rss-item-description rss-item) `(description ,it))))))</diff>
      <filename>feed.ss</filename>
    </modified>
    <modified>
      <diff>@@ -56,14 +56,11 @@
  form-markup
  grab-user-input
 
- ;;Feeds 
+ ;; feeds 
+ atom-feed
  atom-item
- atom-inc
- atom-wrapper
- rss-inc
- rss-wrapper
+ rss-feed
  rss-item
- rss-li
  
  ;; records and the data repository
  rec-prop
@@ -145,7 +142,6 @@
  **
  page-url
  redirect-to-page
- atom-wrapper
  js-inc
  css-inc
  versioned-file-reference</diff>
      <filename>leftparen.scm</filename>
    </modified>
    <modified>
      <diff>@@ -7,8 +7,7 @@
          &quot;web-support.scm&quot;
          &quot;session.scm&quot;
          &quot;settings.scm&quot;
-         &quot;time.scm&quot;
-         &quot;feed.ss&quot;)
+         &quot;time.scm&quot;)
 
 (provide define-page
          define-session-page
@@ -17,7 +16,6 @@
          **
          page-url
          redirect-to-page
-         atom-wrapper
          js-inc
          css-inc
          versioned-file-reference
@@ -148,6 +146,13 @@
 (define (css-inc css-filename)
   `(link ((rel &quot;stylesheet&quot;) (type &quot;text/css&quot;) (href ,css-filename))))
 
+(define (atom-inc feed-url)
+  `(link ((rel &quot;alternate&quot;) (type &quot;application/atom+xml&quot;) (href ,feed-url))))
+
+(define (rss-inc feed-url #:title (title &quot;RSS feed&quot;))
+  `(link ((href ,feed-url) (rel &quot;alternate&quot;) (type &quot;application/rss+xml&quot;)
+          (title ,title))))
+
 ;; filename should be relative to htdocs directory
 ;; XXX I'm not sure this will actually work (does the # trigger a new file refresh?)
 ;; XXX INDEED IT DOES NOT.  We'll have to change the actual filename and then</diff>
      <filename>page.scm</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,7 @@
          (lib &quot;xml.ss&quot; &quot;xml&quot;)
          net/url
          scheme/serialize
-         (rename-in scheme/contract
-                    (any c:any))
+         &quot;contract-lp.ss&quot;
          (planet &quot;web.scm&quot; (&quot;soegaard&quot; &quot;web.plt&quot; 2 1))
          )
 </diff>
      <filename>web-support.scm</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>372b34e661ac5dab24222e3eef4e07ff58b93155</id>
    </parent>
  </parents>
  <author>
    <name>Rob Hunter</name>
    <email>rob.hunter@gmail.com</email>
  </author>
  <url>http://github.com/vegashacker/leftparen/commit/6d520540d7d26d2b7740c7fa94f56465d5920b52</url>
  <id>6d520540d7d26d2b7740c7fa94f56465d5920b52</id>
  <committed-date>2008-11-24T21:45:24-08:00</committed-date>
  <authored-date>2008-11-24T21:45:24-08:00</authored-date>
  <message>code changes to simplify the RSS feed interface incl. contracts added; keyword arguments and removal of need to enter redundant info; moved atom-inc and rss-inc into page.scm due to a circular dependency where feed.ss needs to call page-url (from page.scm)</message>
  <tree>c5863988e46ccacfc0b7b517d7184bce3350a8b9</tree>
  <committer>
    <name>Rob Hunter</name>
    <email>rob.hunter@gmail.com</email>
  </committer>
</commit>
