RSS builder for Laravel 4
Switch branches/tags
Clone or download
Latest commit b65908c Dec 22, 2014
Permalink
Failed to load latest commit information.
src/Thujohn/Rss Update Rss.php Apr 7, 2014
tests Initial commit Jul 4, 2013
.gitignore Initial commit Jul 4, 2013
.travis.yml Updated travis config Dec 22, 2014
LICENSE Initial commit Jul 4, 2013
README.md dev-master makes unicorns cry Dec 20, 2014
composer.json Composer fixes Dec 22, 2014
phpunit.xml Initial commit Jul 4, 2013

README.md

RSS

RSS builder for Laravel 4

Build Status

Installation

Add thujohn/rss to composer.json.

"thujohn/rss": "~1.0"

Run composer update to pull down the latest version of RSS.

Now open up app/config/app.php and add the service provider to your providers array.

'providers' => array(
    'Thujohn\Rss\RssServiceProvider',
)

Now add the alias.

'aliases' => array(
    'Rss' => 'Thujohn\Rss\RssFacade',
)

Usage

Returns the feed

Route::get('/', function()
{
	$feed = Rss::feed('2.0', 'UTF-8');
	$feed->channel(array('title' => 'Channel\'s title', 'description' => 'Channel\'s description', 'link' => 'http://www.test.com/'));
	for ($i=1; $i<=5; $i++){
		$feed->item(array('title' => 'Item '.$i, 'description|cdata' => 'Description '.$i, 'link' => 'http://www.test.com/article-'.$i));
	}

	return Response::make($feed, 200, array('Content-Type' => 'text/xml'));
});

Save the feed

Route::get('/', function()
{
	$feed = Rss::feed('2.0', 'UTF-8');
	$feed->channel(array('title' => 'Channel\'s title', 'description' => 'Channel\'s description', 'link' => 'http://www.test.com/'));
	for ($i=1; $i<=5; $i++){
		$feed->item(array('title' => 'Item '.$i, 'description|cdata' => 'Description '.$i, 'link' => 'http://www.test.com/article-'.$i));
	}

	$feed->save('test.xml');
});