2017 © Pedro Peláez
 

library rss-php

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed

image

dansup/rss-php

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed

  • Sunday, September 17, 2017
  • by dansup
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 81 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

RSS & Atom Feeds for PHP

Downloads this Month Latest Stable Version License, (*1)

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feeds. This project is a forked of David Grudl's rs-php https://github.com/dg/rss-php, (*2)

It requires PHP 5.5 and Guzzle 6.1 and is licensed under the New BSD License. You can obtain the latest version from our GitHub repository or install it via Composer:, (*3)

php composer.phar require dansup/rss-php

Usage

Download RSS feed from URL:, (*4)

$rss = Feed::loadRss($url);

The returned properties are SimpleXMLElement objects. Extracting the information from the channel is easy:, (*5)

echo 'Title: ', $rss->title;
echo 'Description: ', $rss->description;
echo 'Link: ', $rss->link;

foreach ($rss->item as $item) {
    echo 'Title: ', $item->title;
    echo 'Link: ', $item->link;
    echo 'Timestamp: ', $item->timestamp;
    echo 'Description ', $item->description;
    echo 'HTML encoded content: ', $item->{'content:encoded'};
}

Download Atom feed from URL:, (*6)

$atom = Feed::loadAtom($url);

You can set your own Guzzle instance to the static client property, (*7)

Feed::$client = new GuzzleHttp\Client(['headers' => ['User-Agent' => 'FeedPHP/1.0']]);

and it will be reused., (*8)

You can pass Guzzle request options (including auth user/password) on each call, (*9)

$atom = Feed::loadAtom($url, ['auth' => ['peter', 'secret']);

You can also enable caching using https://github.com/Kevinrob/guzzle-cache-middleware, (*10)

//  Simple volatile memory cache example check docs for more options 
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use Kevinrob\GuzzleCache\CacheMiddleware;

// Create default HandlerStack
$stack = HandlerStack::create();

// Add this middleware to the top with `push`
$stack->push(new CacheMiddleware(), 'cache');

// Initialize the client with the handler option
Feed::$client = new Client(['handler' => $stack]);

(c) David Grudl, 2008 (http://davidgrudl.com) (c) grunjol, 2017 (https://github.com/grunjol) (c) dansup, 2017 (https://github.com/dansup), (*11)

The Versions

17/09 2017

dev-master

9999999-dev http://github.com/dansup/rss-php

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed

  Sources   Download

BSD-3-Clause

The Requires

 

atom feed rss

17/09 2017

1.3.0

1.3.0.0 http://github.com/dansup/rss-php

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed

  Sources   Download

BSD-3-Clause

The Requires

 

atom feed rss

06/03 2017

1.2.9

1.2.9.0 http://github.com/grunjol/rss-php

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed

  Sources   Download

BSD-3-Clause

The Requires

 

atom feed rss

02/07 2015

v1.2

1.2.0.0 https://github.com/dg/rss-php

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.2

 

atom feed rss

17/01 2014

v1.1

1.1.0.0 https://github.com/dg/rss-php

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed.

  Sources   Download

BSD-3

atom feed rss

31/08 2012

v1.0

1.0.0.0 https://github.com/dg/rss-php

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed.

  Sources   Download

BSD-3

atom feed rss