Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-02-12 15:40:12

abutcher
Plugin Author
Registered: 2023-06-29
Posts: 5

ais_feed - Feed syndication for RSS/Atom feeds

Summary

ais_feed is a simple feed syndication plugin for feeds that requires no external libraries, making it very easy to install.

Download

Features

  • Support for Atom and RSS feeds
  • Allow querying any field in the feed with XPath queries
  • Feed data can be formatted as needed
  • No dependencies – no need for libraries, making installation simple
  • Caching of feeds (file based)

This plugin may be a functional replacement for older plugins that did the same that can no longer be found – aks_rss, bit_rss, and tcm_rss, however the syntax is different.

Example

The following example shows how the feed can iterate over a feed, returning at most 5 items, output a custom field, and perform simple logic based on an XPath query.

<txp:ais_feed feed="http://example.com/feed.xml" limit="5">
   <article class="article feed">
      <h2>
         <txp:ais_feed_item_link>
            <txp:ais_feed_item_title />
         </txp:ais_feed_item_link>
      </h2>
      <p>Posted: <txp:ais_feed_item_posted format="%B %Y" /></p>
      <p><txp:ais_feed_item_xpath xpath="./custom:field" /></p>
      <txp:ais_feed_item_if_xpath xpath="./custom:something[@foo='1']">
         <p>Something happens when XPath query is true</p>
      <txp:else />
         <p>Something different happens when not true</p>
      </txp:ais_feed_item_if_xpath>
   </article>
</txp:ais_feed>

Help is included with the plugin, including tag instructions and practical examples.

History

Version 0.1: * Initial release.

Offline

#2 2024-02-12 15:41:58

abutcher
Plugin Author
Registered: 2023-06-29
Posts: 5

Re: ais_feed - Feed syndication for RSS/Atom feeds

A little bit of backstory as to why this is so basic:

A client needed to pull data from a feed from an external system (a customised Atom feed) for output on their site. With the old feed syndication plugins no longer being available (mentioned above), and a need for being able to access custom fields in the field, this plugin was whipped up fairly quickly to fit the client’s needs. It’s a bit “quick & dirty” as a result – sorry.

Since the older plugins are no longer available, I felt it could benefit others looking for this functionality by releasing it publicly, and with the repository on GitHub, at least there’s a chance this plugin won’t disappear in the future!

Offline

#3 2024-02-12 15:57:52

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,254
GitHub

Re: ais_feed - Feed syndication for RSS/Atom feeds

[Moved to Plugin Support — thanks, abutcher!]

Offline

Board footer

Powered by FluxBB