5 Cent tip for today [ RSS Channel info ]

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 Channel info ]

Post by newdep »

;;
;; version 1.0 RSS Channel info
;; (c) norman 2004
;; fixed for "<!--"

(set 'channel '(
"title" "link" "description" "language"
"copyright" "managingEditor" "webMaster" "pubDate"
"lastBuildDate" "category" "generator" "docs" ))

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

(println "** RSS -> " url )

(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)))

;;
;; Channel info -> Required CHANNEL elements: title link description
;;
(dolist (x channel)
(if (set 'element (lookup (symbol x) rsschannel))
(println "** RSS Channel " x " -> " element )))

(exit)

;; enjoy...
-- (define? (Cornflakes))

Locked