2017 © Pedro Peláez
 

library pop-feed

Pop Feed Component for Pop PHP Framework

image

popphp/pop-feed

Pop Feed Component for Pop PHP Framework

  • Thursday, March 2, 2017
  • by nicksagona
  • Repository
  • 1 Watchers
  • 2 Stars
  • 570 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

pop-feed

END OF LIFE

The pop-feed component v2.1.0 is now end-of-life and will no longer be maintained., (*1)

Build Status Coverage Status, (*2)

OVERVIEW

pop-feed is a component for generating and parsing web feeds while trying to normalize the common nodes and items contained within a feed., (*3)

pop-feedis a component of the Pop PHP Framework., (*4)

INSTALL

Install pop-feed using Composer., (*5)

composer require popphp/pop-feed

BASIC USAGE

Generating a feed

use Pop\Feed\Writer;

$headers = [
    'published' => date('Y-m-d H:i:s'),
    'author'    => 'Test Author'
];

$items = [
    [
        'title'       => 'Some Item #1',
        'link'        => 'http://www.popphp.org/',
        'description' => 'This is the description of item #1',
        'published'   => date('Y-m-d H:i:s')
    ],
    [
        'title'       => 'Some Item #2',
        'link'        => 'http://popcorn.popphp.org/',
        'description' => 'This is the description of item #2',
        'published'   => date('Y-m-d H:i:s')
    ]
];

$feed = new Writer($headers, $items);
$feed->render();

Rendered as an RSS feed:, (*6)

<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/">
    <channel>
        <published>Tue, 21 Jul 2015 18:09:08 -0500</published>
        <author>Test Author</author>
        <item>
            <title>Some Item #1</title>
            <link>http://www.popphp.org/</link>
            <description>This is the description of item #1</description>
            <published>Tue, 21 Jul 2015 18:09:08 -0500</published>
        </item>
        <item>
            <title>Some Item #2</title>
            <link>http://popcorn.popphp.org/</link>
            <description>This is the description of item #2</description>
            <published>Tue, 21 Jul 2015 18:09:08 -0500</published>
        </item>
    </channel>
</rss>

Or, rendered as an Atom feed:, (*7)

$feed = new Writer($headers, $items);
$feed->setAtom();
$feed->render();
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <published>Tue, 21 Jul 2015 18:10:39 -0500</published>
    <author>
        <name>Test Author</name>
    </author>
    <entry>
        <title>Some Item #1</title>
        <link href="http://www.popphp.org/" />
        <description>This is the description of item #1</description>
        <published>Tue, 21 Jul 2015 18:10:39 -0500</published>
    </entry>
    <entry>
        <title>Some Item #2</title>
        <link href="http://popcorn.popphp.org/" />
        <description>This is the description of item #2</description>
        <published>Tue, 21 Jul 2015 18:10:39 -0500</published>
    </entry>
</feed>

Parsing a feed

If the feed is an RSS feed:, (*8)

use Pop\Feed\Reader;
use Pop\Feed\Format\Rss;

$feed = new Reader(new Rss('http://www.domain.com/rss'));

foreach ($feed->items as $item) {
    print_r($item);
}

If the feed is an Atom feed:, (*9)

use Pop\Feed\Reader;
use Pop\Feed\Format\Atom;

$feed = new Reader(new Atom('http://www.domain.com/feed'));

foreach ($feed->entries as $entry) {
    print_r($entry);
}

The Versions

02/03 2017

dev-master

9999999-dev http://www.popphp.org/

Pop Feed Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php pop pop php feed reader feed writer rss feeds atom feeds

02/03 2017

2.1.0p1

2.1.0.0-patch1 http://www.popphp.org/

Pop Feed Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php pop pop php feed reader feed writer rss feeds atom feeds

01/07 2016

2.1.0

2.1.0.0 http://www.popphp.org/

Pop Feed Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php pop pop php feed reader feed writer rss feeds atom feeds

10/05 2016

2.0.0p2

2.0.0.0-patch2 http://www.popphp.org/

Pop Feed Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php pop pop php feed reader feed writer rss feeds atom feeds

19/02 2016

2.0.0p1

2.0.0.0-patch1 http://www.popphp.org/

Pop Feed Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php pop pop php feed reader feed writer rss feeds atom feeds

22/07 2015

2.0.0

2.0.0.0 http://www.popphp.org/

Pop Feed Component for Pop PHP Framework

  Sources   Download

New BSD

The Requires

  • php >=5.4.0

 

The Development Requires

php pop pop php feed reader feed writer rss feeds atom feeds