PHP Classes

PHP RSS Feed Generator: Generate an RSS feed from a list of items

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 68 This week: 1All time: 10,286 This week: 560Up
Version License PHP version Categories
php-rss 1.0.0The PHP License5XML, PHP 5, Web services
Description 

Author

This class can generate an RSS feed from a list of items.

It takes as a parameter an array with the details of a list of items to include in the RSS feed, the path and the file name for the RSS feed.

The class validates the parameters and generates a RSS feed for the items that were passed by creating a RSS file at the specified file path.

Picture of Channaveer Hakari
  Performance   Level  
Name: Channaveer Hakari <contact>
Classes: 8 packages by
Country: India India
Age: 33
All time rank: 2443145 in India India
Week rank: 411 Up26 in India India Up
Innovation award
Innovation award
Nominee: 2x

Documentation

About Simple RSS Generator

Hi with the help of this page you can generate simple RSS 2.0

Working Example

<?php
use Channaveer\RSS\RSS;

require_once './vendor/autoload.php';

$rssItems = [
    [
        'title'         => 'What Is Composer? How Does It Work? Useful Composer Commands And Usage',
        'url'           => 'https://somesite.in/posts/what-is-composer-how-does-it-work',
        'description'   => 'In this article, you will learn: What Is Composer, Using Composer, Installation In Ubuntu/Windows/Mac.',
        'updatedAt'     => '2020-05-07'
    ]
];

$path       = '.'; / Path to generate your rss.xml file */
$filename   = 'rss.xml'; / RSS filename default is rss.xml  */
$rss        = new RSS();

$rss->siteName('SiteName')
    ->siteUrl('https://siteurl.com')
    ->description('Some random description of the site')
    ->language('en-US') / Default is en-Us you can set any of yours */
    ->lastUpdated($feedItems[0]['updatedAt']) / Just pass datetime string or date string */
    ->generate($path, $rssItems, $filename);

RSS Items is array of items which requires following fields.

title
url
description
updatedAt

  Files folder image Files  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files  /  src  
File Role Description
  Plain text file RSS.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:68
This week:1
All time:10,286
This week:560Up