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

dg/rss-php

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

  • Friday, June 22, 2018
  • by david@grudl.com
  • Repository
  • 22 Watchers
  • 221 Stars
  • 68,757 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 80 Forks
  • 1 Open issues
  • 5 Versions
  • 15 % 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., (*2)

It requires PHP 5.3 or newer with CURL extension or enabled allow_url_fopen and is licensed under the New BSD License. You can obtain the latest version from our GitHub repository or install it via Composer:, (*3)

composer require dg/rss-php

Support Me

Do you like RSS? Are you looking forward to the new features?, (*4)

Buy me a coffee, (*5)

Thank you!, (*6)

Usage

Download RSS feed from URL:, (*7)

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

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

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

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

Download Atom feed from URL:, (*9)

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

You can also enable caching:, (*10)

Feed::$cacheDir = __DIR__ . '/tmp';
Feed::$cacheExpire = '5 hours';

You can setup a User-Agent if needed:, (*11)

Feed::$userAgent = "FeedFetcher-Google; (+http://www.google.com/feedfetcher.html)";

If you like it, please make a donation now. Thank you!, (*12)

The Versions

22/06 2018

dev-master

9999999-dev 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
  • ext-simplexml *

 

atom feed rss

22/06 2018

v1.3

1.3.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
  • ext-simplexml *

 

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