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)

How Trump Has Reshaped the Presidency, and How It’s Changed Him, Too
Sat, 29 Apr 2017 16:09:21 GMT nil

As Washington evaluates the first 100 days of Mr. Trump tenure, the one consensus is that, for better or worse, the capital has headed deep into uncharted territory.


Trump Invites Rodrigo Duterte to the White House
Sun, 30 Apr 2017 04:41:22 GMT nil

The two leaders spoke late on Saturday and addressed the Philippines’ violent campaign against drugs, which has been condemned by human rights groups and many Western governments.


U.S. Confirms It Will Pay for Antimissile System, South Korea Says
Sun, 30 Apr 2017 06:55:08 GMT nil

President Trump said last week that South Korea should pay for the so-called Thaad system, but officials said Sunday that the original agreement would not change.


Rendered in 473 milliseconds. Used 134 KB of memory, 108 KB for Lisp Cells.