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)

Jared Kushner’s Role Is Tested as Russia Case Grows
Mon, 29 May 2017 01:23:57 GMT nil

It is unclear how Jared Kushner’s high-profile woes will affect his hard-won partnership with his father-in-law, perhaps the most stable in an often unstable White House.


Reported Talks by Jared Kushner With Russia Would Be ‘Good Thing,’ Trump Official Says
Sun, 28 May 2017 16:57:05 GMT nil

John F. Kelly, the homeland security secretary, played down reports of a back channel. The president, meanwhile, resumed using Twitter as a weapon.


News Analysis: Melania Trump, in Supporting Role, Shows Subdued Star Power on Trip
Sun, 28 May 2017 19:22:30 GMT nil

Mrs. Trump’s travels with the president were something of a coming-out party, which may offer clues to what kind of first lady she could become.


Rendered in 577 milliseconds. Used 142 KB of memory, 116 KB for Lisp Cells.