SimplePie
[ class tree: SimplePie ] [ index: SimplePie ] [ all elements ]

Class: SimplePie

Source Location: /simplepie.inc

Class Overview


SimplePie


Methods



Class Details

[line 396]
SimplePie



[ Top ]


Class Methods


static method merge_items [line 3042]

static void merge_items( $urls, [ $start = 0], [ $end = 0], [ $limit = 0])



Parameters:

   $urls  
   $start  
   $end  
   $limit  

[ Top ]

static method sort_items [line 3034]

static void sort_items( $a, $b)



Parameters:

   $a  
   $b  

[ Top ]

constructor SimplePie [line 728]

SimplePie SimplePie( [string $feed_url = null], [string $cache_location = null], [int $cache_duration = null])

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.




Tags:

since:  1.0 Preview Release
access:  public


Parameters:

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.

[ Top ]

destructor __destruct [line 763]

void __destruct( )

Remove items that link back to this before destroying this object



[ Top ]

method enable_cache [line 921]

void enable_cache( [bool $enable = true])

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.




Tags:

since:  1.0 Preview Release
access:  public


Parameters:

bool   $enable   Enable caching

[ Top ]

method enable_order_by_date [line 967]

void enable_order_by_date( [bool $enable = true])

Determines whether feed items should be sorted into reverse chronological order.



Tags:

access:  public


Parameters:

bool   $enable   Sort as reverse chronological order.

[ Top ]

method enable_xml_dump [line 906]

void enable_xml_dump( [bool $enable = false])

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.




Tags:

since:  1.0 Preview Release
access:  public


Parameters:

bool   $enable   Enable XML dump

[ Top ]

method encode_instead_of_strip [line 1405]

void encode_instead_of_strip( [ $enable = true])



Parameters:

   $enable  

[ Top ]

method error [line 1836]

string error( )

Return the error message for the occured error



Tags:

return:  Error message
access:  public


[ Top ]

method force_feed [line 791]

void force_feed( [bool $enable = false])

Force the given data/URL to be treated as a feed no matter what it appears like



Tags:

since:  1.1
access:  public


Parameters:

bool   $enable   Force the given data/URL to be treated as a feed

[ Top ]

method force_fsockopen [line 886]

void force_fsockopen( [bool $enable = false])

Forces SimplePie to use fsockopen() instead of the preferred cURL functions.



Tags:

since:  1.0 Beta 3
access:  public


Parameters:

bool   $enable   Force fsockopen() to be used

[ Top ]

method get_author [line 2399]

void get_author( [ $key = 0])



Parameters:

   $key  

[ Top ]

method get_authors [line 2412]

void get_authors( )



[ Top ]

method get_base [line 2283]

void get_base( [ $element = array()])



Parameters:

   $element  

[ Top ]

method get_categories [line 2353]

void get_categories( )



[ Top ]

method get_category [line 2340]

void get_category( [ $key = 0])



Parameters:

   $key  

[ Top ]

method get_channel_tags [line 2204]

void get_channel_tags( $namespace, $tag)



Parameters:

   $namespace  
   $tag  

[ Top ]

method get_contributor [line 2482]

void get_contributor( [ $key = 0])



Parameters:

   $key  

[ Top ]

method get_contributors [line 2495]

void get_contributors( )



[ Top ]

method get_copyright [line 2692]

void get_copyright( )



[ Top ]

method get_description [line 2648]

void get_description( )



[ Top ]

method get_encoding [line 1841]

void get_encoding( )



[ Top ]

method get_favicon [line 1950]

void get_favicon( )

Returns the URL for the favicon of the feed's website.



Tags:

since:  1.0
access:  public
todo:  Cache atom:icon


[ Top ]

method get_feed_tags [line 2170]

void get_feed_tags( $namespace, $tag)



Parameters:

   $namespace  
   $tag  

[ Top ]

method get_image_height [line 2888]

void get_image_height( )



[ Top ]

method get_image_link [line 2852]

void get_image_link( )



[ Top ]

method get_image_tags [line 2247]

void get_image_tags( $namespace, $tag)



Parameters:

   $namespace  
   $tag  

[ Top ]

method get_image_title [line 2792]

void get_image_title( )



[ Top ]

method get_image_url [line 2820]

void get_image_url( )



[ Top ]

method get_image_width [line 2872]

void get_image_width( )



[ Top ]

method get_item [line 2918]

void get_item( [ $key = 0])



Parameters:

   $key  

[ Top ]

method get_items [line 2931]

void get_items( [ $start = 0], [ $end = 0])



Parameters:

   $start  
   $end  

[ Top ]

method get_item_quantity [line 2904]

void get_item_quantity( [ $max = 0])



Parameters:

   $max  

[ Top ]

method get_language [line 2720]

void get_language( )



[ Top ]

method get_latitude [line 2756]

void get_latitude( )



[ Top ]

method get_link [line 2553]

void get_link( [ $key = 0], [ $rel = 'alternate'])



Parameters:

   $key  
   $rel  

[ Top ]

method get_links [line 2574]

void get_links( [ $rel = 'alternate'])



Parameters:

   $rel  

[ Top ]

method get_longitude [line 2772]

void get_longitude( )



[ Top ]

method get_permalink [line 2569]

void get_permalink( )

Added for parity between the parent-level and the item/entry-level.



[ Top ]

method get_title [line 2304]

void get_title( )



[ Top ]

method get_type [line 1863]

void get_type( )



[ Top ]

method handle_content_type [line 1846]

void handle_content_type( [ $mime = 'text/html'])



Parameters:

   $mime  

[ Top ]

method init [line 1491]

void init( )



[ Top ]

method remove_div [line 1387]

void remove_div( [ $enable = true])



Parameters:

   $enable  

[ Top ]

method sanitize [line 2299]

void sanitize( $data, $type, [ $base = ''])



Parameters:

   $data  
   $type  
   $base  

[ Top ]

method set_author_class [line 1132]

void set_author_class( [string $class = 'SimplePie_Author'])

Allows you to change which class SimplePie uses for handling author data.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_autodiscovery_cache_duration [line 945]

void set_autodiscovery_cache_duration( [int $seconds = 604800])

Set the length of time (in seconds) that the autodiscovered feed URL will be cached.



Tags:

access:  public


Parameters:

int   $seconds   The autodiscovered feed URL cache duration.

[ Top ]

method set_autodiscovery_level [line 1004]

void set_autodiscovery_level( [int $level = SIMPLEPIE_LOCATOR_ALL])

Set how much feed autodiscovery to do



Tags:



Parameters:

int   $level   Feed Autodiscovery Level (level can be a combination of the above constants, see bitwise OR operator)

[ Top ]

method set_cache_class [line 1018]

void set_cache_class( [string $class = 'SimplePie_Cache'])

Allows you to change which class SimplePie uses for caching.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_cache_duration [line 933]

void set_cache_duration( [int $seconds = 3600])

Set the length of time (in seconds) that the contents of a feed will be cached.



Tags:

access:  public


Parameters:

int   $seconds   The feed content cache duration.

[ Top ]

method set_cache_location [line 956]

void set_cache_location( [string $location = './cache'])

Set the file system location where the cached files should be stored.



Tags:

access:  public


Parameters:

string   $location   The file system location.

[ Top ]

method set_cache_name_function [line 1330]

void set_cache_name_function( [mixed $function = 'md5'])

Set callback function to create cache filename with



Tags:

access:  public


Parameters:

mixed   $function   Callback function

[ Top ]

method set_caption_class [line 1189]

void set_caption_class( [string $class = 'SimplePie_Caption'])

Allows you to change which class SimplePie uses for <media:text> captions Useful when you are overloading or extending SimplePie's default classes.



Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_category_class [line 1151]

void set_category_class( [string $class = 'SimplePie_Category'])

Allows you to change which class SimplePie uses for handling category data.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_content_type_sniffer_class [line 1284]

void set_content_type_sniffer_class( [string $class = 'SimplePie_Content_Type_Sniffer'])

Allows you to change which class SimplePie uses for content-type sniffing.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_copyright_class [line 1208]

void set_copyright_class( [string $class = 'SimplePie_Copyright'])

Allows you to change which class SimplePie uses for <media:copyright> Useful when you are overloading or extending SimplePie's default classes.



Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_credit_class [line 1227]

void set_credit_class( [string $class = 'SimplePie_Credit'])

Allows you to change which class SimplePie uses for <media:credit> Useful when you are overloading or extending SimplePie's default classes.



Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_enclosure_class [line 1170]

void set_enclosure_class( [string $class = 'SimplePie_Enclosure'])

Allows you to change which class SimplePie uses for feed enclosures.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_favicon_handler [line 1449]

void set_favicon_handler( [str $page = false], [str $qs = 'i'])

Set the handler to enable the display of cached favicons.



Tags:

access:  public


Parameters:

str   $page   Web-accessible path to the handler_favicon.php file.
str   $qs   The query string that the value should be passed to.

[ Top ]

method set_feed_url [line 812]

void set_feed_url( mixed $url)

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.




Tags:

see:  SimplePie::set_raw_data()
since:  1.0 Preview Release
access:  public


Parameters:

mixed   $url   This is the URL (or array of URLs) that you want to parse.

[ Top ]

method set_file [line 835]

bool set_file( object &$file)

Provides an instance of SimplePie_File to use as a feed



Tags:

return:  True on success, false on failure
access:  public


Parameters:

object   &$file   Instance of SimplePie_File (or subclass)

[ Top ]

method set_file_class [line 1075]

void set_file_class( [string $class = 'SimplePie_File'])

Allows you to change which class SimplePie uses for remote file fetching.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_image_handler [line 1468]

void set_image_handler( [str $page = false], [str $qs = 'i'])

Set the handler to enable the display of cached images.



Tags:

access:  public


Parameters:

str   $page   Web-accessible path to the handler_image.php file.
str   $qs   The query string that the value should be passed to.

[ Top ]

method set_input_encoding [line 978]

void set_input_encoding( [string $encoding = false])

Allows you to override the character encoding reported by the feed.



Tags:

access:  public


Parameters:

string   $encoding   Character encoding.

[ Top ]

method set_item_class [line 1113]

void set_item_class( [string $class = 'SimplePie_Item'])

Allows you to change which class SimplePie uses for handling feed items.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_item_limit [line 1486]

void set_item_limit( [integer $limit = 0])

Set the limit for items returned per-feed with multifeeds.



Tags:

access:  public


Parameters:

integer   $limit   The maximum number of items to return.

[ Top ]

method set_javascript [line 1344]

void set_javascript( [mixed $get = 'js'])

Set javascript query string parameter



Tags:

access:  public


Parameters:

mixed   $get   Javascript query string parameter

[ Top ]

method set_locator_class [line 1037]

void set_locator_class( [string $class = 'SimplePie_Locator'])

Allows you to change which class SimplePie uses for auto-discovery.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_max_checked_feeds [line 1382]

void set_max_checked_feeds( [int $max = 10])

Set maximum number of feeds to check with autodiscovery



Tags:

access:  public


Parameters:

int   $max   Maximum number of feeds to check

[ Top ]

method set_output_encoding [line 1419]

void set_output_encoding( [ $encoding = 'UTF-8'])



Parameters:

   $encoding  

[ Top ]

method set_parser_class [line 1056]

void set_parser_class( [string $class = 'SimplePie_Parser'])

Allows you to change which class SimplePie uses for XML parsing.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_rating_class [line 1246]

void set_rating_class( [string $class = 'SimplePie_Rating'])

Allows you to change which class SimplePie uses for <media:rating> Useful when you are overloading or extending SimplePie's default classes.



Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_raw_data [line 858]

void set_raw_data( string $data)

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.




Tags:

see:  SimplePie::set_feed_url()
since:  1.0 Beta 3
access:  public


Parameters:

string   $data   RSS or Atom data as a string.

[ Top ]

method set_restriction_class [line 1265]

void set_restriction_class( [string $class = 'SimplePie_Restriction'])

Allows you to change which class SimplePie uses for <media:restriction> Useful when you are overloading or extending SimplePie's default classes.



Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_sanitize_class [line 1094]

void set_sanitize_class( [string $class = 'SimplePie_Sanitize'])

Allows you to change which class SimplePie uses for data sanitization.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_source_class [line 1303]

void set_source_class( [string $class = 'SimplePie_Source'])

Allows you to change which class SimplePie uses item sources.

Useful when you are overloading or extending SimplePie's default classes.




Tags:

link:  PHP5 extends documentation
link:  PHP4 extends documentation
access:  public


Parameters:

string   $class   Name of custom class.

[ Top ]

method set_stupidly_fast [line 1363]

void set_stupidly_fast( [bool $set = false])

Set options to make SP as fast as possible. Forgoes a substantial amount of data sanitization in favor of speed.



Tags:

access:  public


Parameters:

bool   $set   Whether to set them or not

[ Top ]

method set_timeout [line 873]

void set_timeout( [int $timeout = 10])

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.




Tags:

since:  1.0 Beta 3
access:  public


Parameters:

int   $timeout   The maximum number of seconds to spend waiting to retrieve a feed.

[ Top ]

method set_url_replacements [line 1437]

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')])

Set element/attribute key/value pairs of HTML attributes containing URLs that need to be resolved relative to the feed



Tags:

since:  1.0
access:  public


Parameters:

array   $element_attribute   Element/attribute key/value pairs

[ Top ]

method set_useragent [line 1319]

void set_useragent( [string $ua = SIMPLEPIE_USERAGENT])

Allows you to override the default user agent string.



Tags:

access:  public


Parameters:

string   $ua   New user agent string.

[ Top ]

method strip_attributes [line 1410]

void strip_attributes( [ $attribs = ''])



Parameters:

   $attribs  

[ Top ]

method strip_comments [line 1424]

void strip_comments( [ $strip = false])



Parameters:

   $strip  

[ Top ]

method strip_htmltags [line 1392]

void strip_htmltags( [ $tags = ''], [ $encode = null])



Parameters:

   $tags  
   $encode  

[ Top ]

method subscribe_aol [line 2095]

void subscribe_aol( )



[ Top ]

method subscribe_bloglines [line 2100]

void subscribe_bloglines( )



[ Top ]

method subscribe_eskobo [line 2105]

void subscribe_eskobo( )



[ Top ]

method subscribe_feed [line 2021]

void subscribe_feed( )



[ Top ]

method subscribe_feedfeeds [line 2110]

void subscribe_feedfeeds( )



[ Top ]

method subscribe_feedster [line 2115]

void subscribe_feedster( )



[ Top ]

method subscribe_google [line 2120]

void subscribe_google( )



[ Top ]

method subscribe_gritwire [line 2125]

void subscribe_gritwire( )



[ Top ]

method subscribe_itunes [line 2057]

void subscribe_itunes( )



[ Top ]

method subscribe_msn [line 2130]

void subscribe_msn( )



[ Top ]

method subscribe_netvibes [line 2135]

void subscribe_netvibes( )



[ Top ]

method subscribe_newsburst [line 2140]

void subscribe_newsburst( )



[ Top ]

method subscribe_newsgator [line 2145]

void subscribe_newsgator( )



[ Top ]

method subscribe_odeo [line 2150]

void subscribe_odeo( )



[ Top ]

method subscribe_outlook [line 2033]

void subscribe_outlook( )



[ Top ]

method subscribe_podcast [line 2045]

void subscribe_podcast( )



[ Top ]

method subscribe_podnova [line 2155]

void subscribe_podnova( )



[ Top ]

method subscribe_rojo [line 2160]

void subscribe_rojo( )



[ Top ]

method subscribe_url [line 2009]

void subscribe_url( )



Tags:

todo:  If we have a perm redirect we should return the new URL
todo:  When we make the above change, let's support <itunes:new-feed-url> as well
todo:  Also, |atom:link|@rel=self


[ Top ]

method subscribe_yahoo [line 2165]

void subscribe_yahoo( )



[ Top ]

method __toString [line 755]

void __toString( )

Used for converting object to a string



[ Top ]


Documentation generated on Sat, 16 Aug 2008 07:54:05 -0700 by phpDocumentor 1.3.1