RSS feeds are useful and great, but the XML structure they come in is rather unwieldy to read through and parse. newLISP has a great function called (parse-xml) that converts an XML tree into a list, but now you just have an unwieldy list. It's helpful to be able to extract only the data we want and put it in a simple nested list.
I've written a new function in Rockets that lets you do just that.
First, get the data from the RSS feed URL that you want:
(set 'feed-url " http://penny-arcade.com/feed"))
(set 'rss-result (xml-parse (get-url feed-url)))
Now, we want to extract the fields "title", "author", and "link" from that feed.
(set 'field-result (get-fields-from-rss rss-result '("title" "author" "link")))
(("News Post: The Book Of Divine Wisdom" "tycho@penny-arcade.com (Tycho)" " http://penny-arcade.com/2013/01/25/the-book-of-divine-wisdom1")
("News Post: So many games!" "gabe@penny-arcade.com (Gabe)" " http://penny-arcade.com/2013/01/25/so-many-games")
...etc ... )
Views: 6140