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)

Congress Reaches Deal on Russia Sanctions, Creating Tough Choice for Trump
Sat, 22 Jul 2017 18:42:56 GMT nil

White House officials acknowledge that the president would all but have to sign legislation punishing Russia for its election interference.


Trump Says He Has ‘Complete Power’ to Pardon
Sat, 22 Jul 2017 12:37:34 GMT nil

The president also attacked the media and Hillary Clinton in a series of early-morning tweets.


Can the President Be Indicted? A Long-Hidden Legal Memo Says Yes
Sat, 22 Jul 2017 14:37:28 GMT nil

A document from Kenneth Starr’s investigation into President Bill Clinton rejected the view that sitting presidents are immune from being indicted.


Rendered in 612 milliseconds. Used 138 KB of memory, 112 KB for Lisp Cells.