Dragonfly feeds | Dragonfly web framework
Reading feeds from other websites
Dragonfly provides some simple functions for reading atom feeds (RSS will follow). The name Atom applies to a pair of related standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (AtomPub or APP) is a simple HTTP-based protocol for creating and updating web resources. (source: wikipedia.org)
There are two functions in plugins-active/dragonfly_basic.lsp for reading feeds: read-atom-feed and read-rss-feed. They can be used to read feeds server-side. If you want to load a feed on the client's side, use AJAX and Javascript instead for faster page loads and to offload work from the server.
Example: displaying an atom feed
The following will display all of the entries from the atom feed as HTML:
<% (read-atom-feed "http://website.com/atomfeed.xml") %>
If you'd like to limit the number of entries shown:
<% (read-atom-feed "http://website.com/atomfeed.xml" 3) %>
If you want to see the raw XML without limiting the number of entries:
<% (read-atom-feed "http://website.com/atomfeed.xml" nil true) %>
The read-rss-feed function works in the same manner. These functions are used to display the feed below:
NYTimes.com (RSS)
Resentment Simmers in Western Chinese Region
Sun, 05 Sep 2010 05:50:23 GMT By ANDREW JACOBS
Since riots between the Han and Uighur groups in 2009, the Chinese authorities have arrested hundreds and tried to soothe frayed nerves. But the push has done little to repair distrust.
Diplomatic Memo: In Middle East Peace Talks, Clinton Faces a Crucial Test
Sun, 05 Sep 2010 05:40:37 GMT By MARK LANDLER
The talks could cement the legacy of Secretary of State Hillary Rodham Clinton as a diplomat, or pose risks to any political ambitions she may harbor.
After Bargains of Recession, Air Fares Soar
Sun, 05 Sep 2010 05:40:02 GMT By JAD MOUAWAD
Air fares have marched steadily upward in recent months and are now close to pre-recession levels — and that’s not even counting all the new fees that airlines have introduced lately.