定制 sgvsv/php-yandex-zen-rss-feed 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sgvsv/php-yandex-zen-rss-feed

最新稳定版本:v1.3

Composer 安装命令:

composer require sgvsv/php-yandex-zen-rss-feed

包简介

Generates RSS feed in Yandex Zen supported format

README 文档

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();

统计信息

  • 总下载量: 32.83k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 2
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-22