sgvsv / php-yandex-zen-rss-feed
Generates RSS feed in Yandex Zen supported format
Installs: 28 542
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 5
Open Issues: 0
Requires
- php: >=7.1
- ext-fileinfo: *
- ext-libxml: *
- ext-simplexml: *
Requires (Dev)
- phpunit/phpunit: ^7.5
This package is auto-updated.
Last update: 2025-04-29 01:24:54 UTC
README
Simple PHP class for making RSS feed in Yandex zen format
Requirements
For providing modern PHP features such as setting types in method's signatures PHP7.1 or higher is required. Also you need to have some extensions:
- ext-fileinfo
- ext-libxml
- ext-simplexml
If you want to run tests you will need phpunit higher than 7.5
Installation
Best way to use this library is install it via composer:
composer require sgvsv/php-yandex-zen-rss-feed
Usage example
After installing you can create feed:
require_once __DIR__.'/vendor/autoload.php'; //New feed with global parameters in constructor $feed = new \sgvsv\Yandex\Zen\Feed('My feeds title', 'Description text here', 'https://mysite.com', 'https:/mysite.com/rss.xml'); //News 1 item $item = $feed->newItem(); $item->title = "News 1"; $item->link = "https://mysite.com/news/1"; $item->pubDate = "Fri, 12 Aug 2013 15:52:01 +0000"; $item->author = 'editor@mysite.com (my site)'; $item->category = 'software'; $item->description = "Description's text"; $item->content = "Content of my news"; $item->addImage("https://mysite.com/images/news1.jpg", "Image's description", "1234"); //Set HTTP header $feed->setHTTPHeader(); //Output Feed echo $feed->getXML();