forked from dg/rss-php
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreadme.txt
More file actions
54 lines (35 loc) · 1.22 KB
/
readme.txt
File metadata and controls
54 lines (35 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
RSS & Atom Feeds for PHP (c) David Grudl, 2008 (http://davidgrudl.com)
Introduction
------------
RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feed
Project at GoogleCode: http://rss-php.googlecode.com
My PHP blog: http://phpfashion.com
Requirements
------------
- PHP (version 5 or better)
- enabled directive allow_url_fopen or cURL extension
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->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:
$atom = Feed::loadAtom($url);
Files
-----
readme.txt - This file.
license.txt - The license for this software (New BSD License).
feed.class.php - The core RSS feed class source.
load-rss.php - Example loading RSS feed.
load-atom.php - Example loading Atom feed.