nonz250/simple-rss-maker-php

This package allows you to create RSS easily.

1.1.0 2022-07-22 15:44 UTC

This package is auto-updated.

Last update: 2024-03-22 19:42:40 UTC


README

Contributing

Feel free to submit a Pull Request. However, please run the make prod command and check the test content before submitting your Pull Request.

Development

We recommend using Docker for this project.

Make Commands

Initial Setup

make setup

Development Test

Testing under development.

make test

Code Fixer

make fix

Production Test

Test before you Pull Request.

make prod

How to use

For Example.

$simpleRssMaker = new SimpleRssMaker();

$xml = $simpleRssMaker
    // Channel settings.
    ->setChannel('title', 'link', 'description', 'language', 'copyright', 'category', 'pubDate')
    // Image settings.
    ->setImage('title', 'link', 'url')
    // Item settings.
    ->addItem('title', 'link', 'description', 'author', 'category', 'datetime')
    ->addItem('title', 'link')
    // Generate RSS2.0 string.
    ->rss2();

// If you have more than one article.
$simpleRssMaker = $simpleRssMaker
    // Channel settings.
    ->setChannel('title', 'link', 'description', 'language', 'copyright', 'category', 'pubDate')
    // Image settings.
    ->setImage('title', 'link', 'url');

foreach($items as $item) {
    $simpleRssMaker = $simpleRssMaker
        ->addItem('title', 'link', 'description', 'author', 'category', 'datetime');
}

// Generate RSS2.0 string.
$xml = $simpleRssMaker->rss2();