Path

ez projects / ezfeedparse


eZ Feed Parse

UNIX name Owner Status Version Compatible with
ezfeedparse Damien Pobel stable 0.2 4.x (require eZ Component Feed)
eZ Feed Parse provides a template fetch function that allows access to RSS or ATOM feeds.

eZ Feed Parse provides a template fetch function that allows access to RSS or ATOM feeds. This template fetch function uses the component Feed of eZ Components.

Install

  1. Download eZ Parse Feed extension
  2. Untar it in eZ Publish root
  3. Enable the extension throught the admin interface

Documentation

This extension provides a module called feed where a function parse is defined. This fetch function takes the feed URL in parameter and return an object that gives access to all propertie of ezcFeed* objects.

Example with a simple RSS

{cache-block ignore_content_expiry expiry=7200}
{def $feed = fetch( feed, parse, hash( 'rss_url', 'http://ez.no/rss/feed/communitynews' ) )}
{foreach $feed.item as $item}
    <li>
        <a href={$item.link.0.href|ezurl}>{$item.title.text|wash}</a>
    </li>
{/foreach}
{undef $feed}
{/cache-block}
 

Example with enclosures in RSS

{cache-block expiry=7200}
{def $feed = fetch( feed, parse, hash( 'rss_url', 'http://www.bioutifoul-photos.net/feed/photo' ) )
     $limit = 4}
<ul>
{foreach $feed.item as $item max $limit}
    <li>
        <a href={$item.link.0.href|ezurl}>
        <img src={$item.enclosure.0.url|ezurl} alt="{$item.title.text|wash}" />
        </a>
    </li>
{/foreach}
</ul>
{undef $feed}
{/cache-block}
 

Limitation

The template operator attribute() does not work with object returned by fetch( feed, parse ). You'd better use debug-log template operator or check the Feed component documentation.

This project has no reviews yet. Be the first one to review it!