SimplePie
SimplePie
SimplePie
([string $feed_url = null], [string $cache_location = null], [int $cache_duration = null])
void
set_url_replacements
([array $element_attribute = array('a' => 'href', 'area' => 'href', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'img' => array('longdesc', 'src'),'input'=>'src','ins'=>'cite','q'=>'cite')])
The SimplePie class contains feed level data and options
There are two ways that you can create a new SimplePie object. The first is by passing a feed URL as a parameter to the SimplePie constructor (as well as optionally setting the cache location and cache expiry). This will initialise the whole feed with all of the default settings, and you can begin accessing methods and properties immediately.
The second way is to create the SimplePie object with no parameters at all. This will enable you to set configuration options. After setting them, you must initialise the feed using $feed->init(). At that point the object's methods and properties will be available to you. This format is what is used throughout this documentation.
- string $feed_url: This is the URL you want to parse.
- string $cache_location: This is where you want the cache to be stored.
- int $cache_duration: This is the number of seconds that you want to store the cache file for.
Remove items that link back to this before destroying this object
Enables/disables caching in SimplePie.
This option allows you to disable caching all-together in SimplePie. However, disabling the cache can lead to longer load times.
- bool $enable: Enable caching
Determines whether feed items should be sorted into reverse chronological order.
- bool $enable: Sort as reverse chronological order.
Outputs the raw XML content of the feed, after it has gone through SimplePie's filters.
Used only for debugging, this function will output the XML content as text/xml. When SimplePie reads in a feed, it does a bit of cleaning up before trying to parse it. Many parts of the feed are re-written in memory, and in the end, you have a parsable feed. XML dump shows you the actual XML that SimplePie tries to parse, which may or may not be very different from the original feed.
- bool $enable: Enable XML dump
Force the given data/URL to be treated as a feed no matter what it appears like
- bool $enable: Force the given data/URL to be treated as a feed
Forces SimplePie to use fsockopen() instead of the preferred cURL functions.
- bool $enable: Force fsockopen() to be used
Added for parity between the parent-level and the item/entry-level.
Allows you to change which class SimplePie uses for handling author data.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Set the length of time (in seconds) that the autodiscovered feed URL will be cached.
- int $seconds: The autodiscovered feed URL cache duration.
Set how much feed autodiscovery to do
- int $level: Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator)
Allows you to change which class SimplePie uses for caching.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Set the length of time (in seconds) that the contents of a feed will be cached.
- int $seconds: The feed content cache duration.
Set the file system location where the cached files should be stored.
- string $location: The file system location.
Set callback function to create cache filename with
- mixed $function: Callback function
Allows you to change which class SimplePie uses for <media:text> captions Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to change which class SimplePie uses for handling category data.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to change which class SimplePie uses for content-type sniffing.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to change which class SimplePie uses for <media:copyright> Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to change which class SimplePie uses for <media:credit> Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to change which class SimplePie uses for feed enclosures.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Set the handler to enable the display of cached favicons.
- str $page: Web-accessible path to the handler_favicon.php file.
- str $qs: The query string that the value should be passed to.
This is the URL of the feed you want to parse.
This allows you to enter the URL of the feed you want to parse, or the website you want to try to use auto-discovery on. This takes priority over any set raw data.
You can set multiple feeds to mash together by passing an array instead of a string for the $url. Remember that with each additional feed comes additional processing and resources.
- mixed $url: This is the URL (or array of URLs) that you want to parse.
Provides an instance of SimplePie_File to use as a feed
- object &$file: Instance of SimplePie_File (or subclass)
Allows you to change which class SimplePie uses for remote file fetching.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Set the handler to enable the display of cached images.
- str $page: Web-accessible path to the handler_image.php file.
- str $qs: The query string that the value should be passed to.
Allows you to override the character encoding reported by the feed.
- string $encoding: Character encoding.
Allows you to change which class SimplePie uses for handling feed items.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Set the limit for items returned per-feed with multifeeds.
- integer $limit: The maximum number of items to return.
Set javascript query string parameter
- mixed $get: Javascript query string parameter
Allows you to change which class SimplePie uses for auto-discovery.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Set maximum number of feeds to check with autodiscovery
- int $max: Maximum number of feeds to check
Allows you to change which class SimplePie uses for XML parsing.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to change which class SimplePie uses for <media:rating> Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to use a string of RSS/Atom data instead of a remote feed.
If you have a feed available as a string in PHP, you can tell SimplePie to parse that data string instead of a remote feed. Any set feed URL takes precedence.
- string $data: RSS or Atom data as a string.
Allows you to change which class SimplePie uses for <media:restriction> Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to change which class SimplePie uses for data sanitization.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Allows you to change which class SimplePie uses item sources.
Useful when you are overloading or extending SimplePie's default classes.
- string $class: Name of custom class.
Set options to make SP as fast as possible. Forgoes a substantial amount of data sanitization in favor of speed.
- bool $set: Whether to set them or not
Allows you to override the default timeout for fetching remote feeds.
This allows you to change the maximum time the feed's server to respond and send the feed back.
- int $timeout: The maximum number of seconds to spend waiting to retrieve a feed.
Set element/attribute key/value pairs of HTML attributes containing URLs that need to be resolved relative to the feed
- array $element_attribute: Element/attribute key/value pairs
Allows you to override the default user agent string.
- string $ua: New user agent string.
Documentation generated on Sat, 14 Nov 2009 11:20:25 +0000 by phpDocumentor 1.3.1



SimplePie
static