PHP code example of skydriver / rss-agent

1. Go to this page and download the library: Download skydriver/rss-agent library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

skydriver / rss-agent example snippets




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;