2017 © Pedro Peláez
 

library syndicator

Parse and serialize syndicated feeds.

image

imnotjames/syndicator

Parse and serialize syndicated feeds.

  • Wednesday, June 18, 2014
  • by imnotjames
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Syndicator

Basic library to parse and compose syndication feeds.

Build Status Coverage Status, (*1)

Currently Supported Standards:, (*2)

  • RSS XML 2.0

For any others feel free to open an issue., (*3)

Installation

The easiest method of installation is with composer, on packagist., (*4)

Usage

Composition of Syndication feeds:, (*5)

use imnotjames\Syndicator\Article;
use imnotjames\Syndicator\Feed;
use imnotjames\Syndicator\Logo;
use imnotjames\Syndicator\Serializers\RSSXML;

$feed = new Feed(
    'My Rad Feed',
    'This feed is the coolest feed out there.',
    'https://github.com/imnotjames/syndicator'
);

$feed->setLogo(new Logo('http://i.imgur.com/haED2k7.jpg'));

$feed->setGenerator('Coolness Generator v95000');

$feed->setCacheTimeToLive(42);

$article = new Article();

$article->setTitle('How to be cool');
$article->setDescription('Step 1.  Be cool.  Step 2.  Don\'t be not cool.');
$article->setURI('http://example.com/blog/how-to-be-cool');

$feed->addArticle($article);

$serializer = new RSSXML();

$xml = $serializer->serialize($feed);

And decomposition:, (*6)

use imnotjames\Syndicator\Parsers\RSSXML;

$parser = new RSSXML();

$feed = $parser->parse(file_get_contents('awesome_feed.xml'));

printf("Title: %s\n\n", $feed->getTitle());

echo "Articles:\n";

foreach ($feed as $article) {
    printf("\tTitle: %s", $article->getTitle());
    echo "\n";
}

License

MIT License, (*7)

The Versions

18/06 2014

dev-master

9999999-dev https://github.com/imnotjames/syndicator

Parse and serialize syndicated feeds.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

xml atom rss feeds podcast