5 Cent tip for today [ RSS Title Slurper ]

Started by newdep, July 16, 2004, 10:28:19 AM

Previous topic - Next topic

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/linux

; http://rss.news.yahoo.com/rss/cellphones">http://rss.news.yahoo.com/rss/cellphones

; http://newlisp.org/rss.cgi?News">http://newlisp.org/rss.cgi?News



(set 'url "http://rss.news.yahoo.com/rss/science">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...
-- (define? (Cornflakes))