Changeset 14582 in project


Ignore:
Timestamp:
05/10/09 13:20:52 (11 years ago)
Author:
Alex Shinn
Message:

updating rss for chicken 4

Location:
release/4/rss
Files:
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/4/rss/rss.meta

    r9584 r14582  
    77   "<a href=\"mailto:felix@call-with-current-continuation.org\">felix</a>")
    88 (synopsis "A RSS parser")
    9  (needs ssax)
     9 (needs ssax matchable)
    1010 (category xml))
  • release/4/rss/rss.scm

    r2798 r14582  
    11;;;; rss.scm
    22
    3 (declare
    4   (export rss:item? rss:item-title rss:item-link rss:item-description rss:item-attributes
    5           rss:item-attribute
    6           rss:feed? rss:feed-version rss:feed-channel rss:feed-items
    7           rss:item=?
    8           rss:read))
     3(module rss
     4(rss:item? rss:item-title rss:item-link rss:item-description
     5 rss:item-attributes rss:item-attribute
     6 rss:feed? rss:feed-version rss:feed-channel rss:feed-items
     7 rss:item=? rss:read)
    98
    10 (require-extension ssax srfi-1)
     9(import scheme chicken extras)
     10(require-extension srfi-1 matchable ssax)
    1111
    1212(define namespace-prefixes
     
    1818    (rdf . "http://my.netscape.com/rdf/simple/0.9/") ) )
    1919
    20 (define-record rss:item
    21   title                                 ; string
    22   link                                  ; string
    23   description                           ; string
    24   attributes)                           ; ((symbol . string) ...)
     20(define-record-type rss:item
     21  (make-rss:item title link description attributes)
     22  rss:item?
     23  (title rss:item-title rss:item-title-set!)
     24  (link rss:item-link rss:item-link-set!)
     25  (description rss:item-description rss:item-description-set!)
     26  (attributes rss:item-attributes rss:item-attributes-set!)
     27  )
    2528
    26 (define-record rss:feed
    27   version                               ; string
    28   channel                               ; item
    29   items)                                ; (item ...)
     29(define-record-type rss:feed
     30  (make-rss:feed version channel items)
     31  rss:feed?
     32  (version rss:feed-version rss:feed-version-set!)
     33  (channel rss:feed-channel rss:feed-channel-set!)
     34  (items rss:feed-items rss:feed-items-set!)
     35  )
    3036
    3137(define (rss:item-attribute item attr)
     
    4349
    4450(define (rss:read . port)
    45   (let ([sxml (SSAX:XML->SXML (:optional port (current-input-port)) namespace-prefixes)])
     51  (let ([sxml (ssax:xml->sxml (if (pair? port) (car port) (current-input-port))
     52                              namespace-prefixes)])
    4653    ;;(pp sxml (current-error-port))
    4754    (fluid-let ([feed (make-rss:feed #f #f '())])
     
    139146         (for-each rec more) ) ]
    140147      [_ #f] ) ) )
     148
     149)
  • release/4/rss/rss.setup

    r2798 r14582  
    1 (compile -s -O2 -d1 rss.scm -emit-exports rss.exports)
    2 (install-extension 'rss '("rss.so" "rss.html")
    3                    '((version 1.2)
    4                      (exports "rss.exports")
    5                      (documentation "rss.html")))
     1
     2(compile -s -O2 -d1 -j rss rss.scm)
     3(compile -s -O2 -d1 rss.import.scm)
     4
     5(install-extension
     6 'rss
     7 '("rss.so" "rss.import.so" "rss.html")
     8 '((version 1.3) (documentation "rss.html")))
Note: See TracChangeset for help on using the changeset viewer.