5 Cent tip for today [ RSS Title Slurper ]

Featuring the Dragonfly web framework
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

5 Cent tip for today [ RSS Title Slurper ]

Post by newdep »

;;
;; RSS Title Slurp - (c) Norman 2004
;; version 1.1 stripped version
;; fixed for "!--"
;;

; http://rss.news.yahoo.com/rss/linux
; http://rss.news.yahoo.com/rss/cellphones
; http://newlisp.org/rss.cgi?News

(set 'url "http://rss.news.yahoo.com/rss/science" )

(println "** RSS Feed -> " url )

;;
;; DE-XML
;;
(xml-type-tags nil 'cdata '!-- nil)
(set 'url (xml-parse (get-url url) (+ 1 2 8 16) ))

;; pop until rss
(until (= (first (nth 0 url)) 'rss ) (pop url))

(set 'rsschannel (nth 2 (nth 0 url)))
(set 'rsschannellen (length rsschannel))

;;
;; Seeking for ITEMS in CHANNEL
;;
(dotimes (y rsschannellen)
(if (list? (nth y rsschannel))
(if (= (nth 0 (nth y rsschannel)) 'item )
(println "** RSS Item -> " (lookup 'title (nth y rsschannel))))))

(exit)

;; enjoy...
Last edited by newdep on Fri Jul 16, 2004 10:14 pm, edited 2 times in total.
-- (define? (Cornflakes))

Locked