skydriver/rss-agent

Package to read the RSS Feeds from URL according RSS v2 standards (https://validator.w3.org/feed/docs/rss2.html)

1.0.0 2015-10-22 00:18 UTC

This package is not auto-updated.

Last update: 2024-09-28 18:47:42 UTC


README

Version 1.0.0

Package to read the RSS Feeds from URL according RSS v2 standards (https://validator.w3.org/feed/docs/rss2.html).

Install

This package can be found on packagist and is best loaded using composer.

Usage

require_once __DIR__ . '/vendor/autoload.php';

use RssAgent\RssAgent;

$url = 'https://packagist.org/feeds/packages.rss';

$rss = new RssAgent( $url );

if( $rss->feeds() ):
	// You can get every feed channel property 
	printf(
		'<h1>Feed from <a href="%s">%s</a></h1>',
		$url,
		$rss->title
	);

	foreach($rss->feeds() as $feed):
		// You can cat every feed property
		printf(
			'<div class="feed-item">
				<a href="%s" target="_blank">%s</a>
				<p>%s</p>
			</div>',
			$feed->link,
			$feed->title,
			$feed->description
		);
	endforeach;
endif;