Giter Site home page Giter Site logo

php-yandex-zen-rss-feed's Introduction

YandexZenFeed

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 = '[email protected] (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();

php-yandex-zen-rss-feed's People

Contributors

fortuneteller avatar sgvsv avatar

Watchers

 avatar  avatar

Forkers

ajur-media

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.