SimplePie 1.5 is now available!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » API Reference » SimplePie

This is an old revision of the document!


SimplePie

Description

class SimplePie {
	SimplePie ([string $feed_url], [string $cache_location], [int $cache_duration])
}

Creates a new SimplePie object, optionally setting various settings (see their specific pages for more detail).

Parameters

feed_url

Set the feed URL(s) (like calling set_feed_url()), and initialise the feed (like init()).

cache_location

Set the cache location (like calling set_cache_location()).

cache_duration

Set the cache duration (like calling set_cache_duration()).

Examples

Create object and initialise separately

This is useful when you have to set additional configuration options.

// Single feed
$feed = new SimplePie();
$feed->set_feed_url('http://simplepie.org/blog/feed/');
$feed->init();
echo $feed->get_title();
// Multiple feeds
$feed = new SimplePie();
$feed->set_feed_url(array(
	'http://simplepie.org/blog/feed/',
	'http://digg.com'
));
$feed->init();
echo $feed->get_title();

Create object and initialise at once

This is handy for just passing in a URL and cache settings.

// Single feed
$feed = new SimplePie('http://simplepie.org/blog/feed/');
echo $feed->get_title();
// Multiple feeds
$feed = new SimplePie(array(
	'http://simplepie.org/blog/feed/',
	'http://digg.com'
));
echo $feed->get_title();

See Also


Index

_

E

F

G

H

I

M

R

S


reference/simplepie/start.1187296283.txt.gz · Last modified: 2011/03/06 03:56 (external edit)