2017 © Pedro Peláez
 

library feed-builder

Library for building and validating RSS 2.0 and Atom 1.0 feeds

image

anh/feed-builder

Library for building and validating RSS 2.0 and Atom 1.0 feeds

  • Wednesday, April 9, 2014
  • by hilobok
  • Repository
  • 1 Watchers
  • 1 Stars
  • 65 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Feed builder

Library for building and validating RSS 2.0 and Atom 1.0 feeds. Conforms with RSS 2.0 and Atom 1.0 specifications., (*1)

Note

Validator not fully completed, no tests, pre-release., (*2)

Installation

Install via composer with command:, (*3)

$ php composer.phar require 'anh/feed-builder:~1.0'

Usage

Atom 1.0 example

<?php

require 'vendor/autoload.php';

use Anh\FeedBuilder\FeedBuilder;

$feed = new FeedBuilder();

$feed
    ->setType('atom')
    ->fromArray(array(
        'title' => 'Another feed title',
        'author' => array(
            'name' => 'John Doe',
        ),
        'link' => array(
            'rel' => 'self',
            'href' => 'http://some-host.tld/articles',
        ),
        'id' => 'http://some-host.tld/some/link',
        'updated' => '2014-01-10',
        'category1' => 'Articles',
        'category2' => array(
            'term' => 'Life & stuff',
            'scheme' => 'http://some-host.tld/category/3',
            'label' => 'Life & stuff'
        ),
        'rights' => 'John & Jane (c) 2014',
        'entry-1' => array(
            'title' => 'This is so title',
            'link' => '/articles/1',
            'id' => 'http://some-host.tld/articles/1',
            'published' => 'tomorrow',
            'updated' => '1 min ago',
            'content' => 'Content of article'
        ),
        'entry_2' => array(
            'title' => 'This is a second entry title',
            'link' => '/articles/2',
            'id' => 'http://some-host.tld/articles/2',
            'updated' => '2 min ago',
            'summary' => 'Summary of article'
        ),
        'entry3' => array(
            'title' => 'Let\'s talk about atom',
            'link' => '/articles/3',
            'id' => 'http://some-host.tld/articles/3',
            'updated' => '3 min ago',
            'category' => 'From Jane',
            'content' => array(
                'type' => 'html',
                '

Content with some html markup.
', ), 'author' => array( 'name' => 'Jane Doe', 'email' => 'jane.doe@some-host.tld' ) ) )) ; var_dump($feed->validate()); echo $feed;

RSS 2.0 example

<?php

require 'vendor/autoload.php';

use Anh\FeedBuilder\FeedBuilder;

$feed = new FeedBuilder();

$feed
    ->setType('rss')
    ->fromArray(array(
        'title' => 'Another feed title',
        'link' => '/some/link',
        'pubDate' => 'yesterday',
        'category' => 'Another & category',
        'cloud' => '',
        'copyright' => '(c) 2014',
        'image' => array(
        ),
        'skipDays' => array(
            'day1' => 'Monday',
            'day2' => 'Tuesday'
        ),
        'skipHours' => array(
            'hour1' => 10,
            'hour2' => 11,
            'hour3' => 12
        ),
        'textInput' => array(
        ),
        'ttl' => '60',
        'item' => array(
            'title' => 'Item title',
            'link' => '/item/link',
            'guid' => array(
                '/some/guid',
                'isPermaLink' => 'no'
            ),
            'pubDate' => '2 days ago',
            'description' => 'Item description'
        ),
        'item2' => array(
            'title' => 'This is second item'
        )
    ))
;

var_dump($feed->validate());

echo $feed;

The Versions

09/04 2014

dev-master

9999999-dev

Library for building and validating RSS 2.0 and Atom 1.0 feeds

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Andrew Hilobok

atom feed rss generation rss2

09/04 2014

v1.0.1

1.0.1.0

Library for building and validating RSS 2.0 and Atom 1.0 feeds

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Andrew Hilobok

atom feed rss generation rss2

08/04 2014

v1.0.0

1.0.0.0

Library for building and validating RSS 2.0 and Atom 1.0 feeds

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Andrew Hilobok

atom feed rss generation rss2