PHP Classes
elePHPant
Icontem

PHP RSS Generator: Generate a RSS feed with a fluent interface

Recommend this page to a friend!
  Info   View files Example   View files View files (16)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-03-01 (26 days ago) RSS 2.0 feedNot enough user ratingsTotal: 110 This week: 3All time: 8,559 This week: 267Up
Version License PHP version Categories
php-rss-generator 1.0.0Custom (specified...5XML, PHP 5
Description Author

This package can be used to generate a RSS feed with a fluent interface.

It provides several classes to compose several parts of the RSS feed like the feed, channel and items.

Items can be added to a channel and the channel can be added to a feed.

The composed RSS feed XML can be outputted in RSS 2.0 format.

Name: Bhaktaraz Bhatta <contact>
Classes: 1 package by
Country: Nepal Nepal
Age: 26
All time rank: 400810 in Nepal Nepal
Week rank: 276 Up1 in Nepal Nepal Up

Details

\Bhaktaraz\RSSGenerator

\Bhaktaraz\RSSGenerator is RSS generator library for PHP 5.5 or later.

Scrutinizer Code Quality Build Status

Implementation:

<?php
$feed = new Feed();

$channel = new Channel();
$channel
	->title("Programming")
	->description("Programming with php")
	->url('http://bhaktaraz.com.np/?cat=2')
	->appendTo($feed);

// RSS item
$item = new Item();
$item
	->title("CACHING DATA IN SYMFONY2")
	->description("It is not too easy to enhance the performance of your application. In Symfony2 you could get benefit from caching.")
	->url('http://bhaktaraz.com.np/?p=194')
	->enclosure('http://bhaktaraz.com.np/wp-content/uploads/2014/08/bhakta-672x372.jpg', 4889, 'audio/mpeg')
	->appendTo($channel);


echo $feed;

Output:

<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Programming</title>
    <link>http://bhaktaraz.com.np/?cat=2</link>
    <description>Programming with php</description>
    <item>
      <title>CACHING DATA IN SYMFONY2</title>
      <link>http://bhaktaraz.com.np/?p=194</link>
      <description>It is not too easy to enhance the performance of your application. In Symfony2 you could get benefit from caching.</description>
      <enclosure url="http://bhaktaraz.com.np/wp-content/uploads/2014/08/bhakta-672x372.jpg" type="audio/mpeg" length="4889"/>
    </item>
  </channel>
</rss>

Installation

You can install via Composer.

Add in your composer.json file:

{
	"require": {
		"bhaktaraz/php-rss-generator": "dev-master"
	}
}

Run composer to install.

$ composer update

  Files folder image Files  
File Role Description
Files folder imageSource (1 directory)
Files folder imageTests (4 files)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  Source  
File Role Description
Files folder imageBhaktaraz (1 directory)

  Files folder image Files  /  Source  /  Bhaktaraz  
File Role Description
Files folder imageRSSGenerator (7 files)

  Files folder image Files  /  Source  /  Bhaktaraz  /  RSSGenerator  
File Role Description
  Plain text file Channel.php Class Class source
  Plain text file ChannelInterface.php Class Class source
  Plain text file Feed.php Class Class source
  Plain text file FeedInterface.php Class Class source
  Plain text file Item.php Class Class source
  Plain text file ItemInterface.php Class Class source
  Plain text file SimpleXMLElement.php Class Class source

  Files folder image Files  /  Tests  
File Role Description
  Accessible without login Plain text file Bootstrap.php Aux. Auxiliary script
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
  Accessible without login Plain text file README.md Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
 100%
Total:110
This week:3
All time:8,559
This week:267Up