• Stars
    star
    473
  • Rank 92,832 (Top 2 %)
  • Language
    PHP
  • License
    BSD 3-Clause "New...
  • Created almost 15 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Small and easy-to-use library for consuming RSS and Atom feeds

RSS & Atom Feeds for PHP

Downloads this Month Latest Stable Version License

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

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:

composer require dg/rss-php

Support Me

Do you like RSS? Are you looking forward to the new features?

Buy me a coffee

Thank you!

Usage

Download RSS feed from URL:

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

The returned properties are SimpleXMLElement objects. Extracting the information from the channel is easy:

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:

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

You can also enable caching:

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

You can setup a User-Agent if needed:

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

If you like it, please make a donation now. Thank you!

More Repositories

1

ftp-deployment

A tool for automated deployment of web applications to an FTP server.
PHP
601
star
2

twitter-php

Small and easy PHP library for sending messages to Twitter and receiving statuses.
PHP
543
star
3

dibi

Dibi - smart database abstraction layer
PHP
487
star
4

bypass-finals

Removes `final` and `readonly` keywords from source code on-the-fly and allows mocking of final methods and classes. It can be used together with any test tool such as PHPUnit or Mockery.
PHP
474
star
5

ftp-php

FTP Wrapper Class for PHP 5
PHP
205
star
6

MySQL-dump

MySQL Dump Utility
PHP
201
star
7

texy

Texy is a lightweight markup language with plain text formatting syntax engine.
HTML
155
star
8

composer-cleaner

Victor The Cleaner: removes unnecessary files from vendor directory
PHP
133
star
9

adminer

Customizations for Adminer, the best database management tool written in PHP.
PHP
123
star
10

php54-arrays

Command-line script to convert between array() and PHP 5.4's short syntax []
PHP
47
star
11

composer-backslasher

Composer plugin that speeds up your application by adding backslashes to all PHP internal functions and constants.
PHP
40
star
12

php-extensions-finder

Finds PHP extensions required by code.
PHP
39
star
13

composer-frontline

Composer Frontline: updates all the version constraints in the composer.json file to latest version.
PHP
27
star
14

texy-editor

Live editor for Texy
PHP
24
star
15

web-davidgrudl.com

My homepage
PHP
14
star
16

MySQL-check

Checks a MySQL database for invalid foreign keys, i.e., a keys pointing to missing rows.
PHP
14
star
17

dibi-docs

Dibi Documentation
6
star
18

imap

Retrieval, processing, and manipulation of emails within a mailbox via POP3, IMAP and NNTP
PHP
5
star
19

php-console

PHP
4
star
20

texy-docs

Texy Documentation
2
star
21

folksonomy

Collaborative tagging for open-source software. Used for content classification at www.code.dance.
1
star
22

dg

1
star