====== API Reference ======
:!: **This documentation is for 1.2 only. 1.3 documentation can be found in the [[http://simplepie.org/api/|API Docs]] section of the site.**
These are all of the public functions for SimplePie. Our goal is to not break any of these constructors and methods for all 1.x releases. If there are methods or constructors not mentioned here, or are marked "Non-Public", then they are not considered public and may change tomorrow and the "no-breaking" rule does not apply to them. The next API breakage will be in SimplePie 2.0, but that's still quite a while off. :)
Documentation for the latest in-development build can be found in our automatically generated [[http://dev.simplepie.org/api/|API documentation]].
===== SimplePie =====
==== Constructor ====
* [[reference:SimplePie:start]] — construct a new SimplePie object.
==== Constants ====
* [[reference:SimplePie:SIMPLEPIE_BUILD]] — Defines SimplePie's build ID.
* [[reference:SimplePie:SIMPLEPIE_LINKBACK]] — Defines the URL for linking back to SimplePie's website.
* [[reference:SimplePie:SIMPLEPIE_NAME]] — Defines SimplePie's name.
* [[reference:SimplePie:SIMPLEPIE_URL]] — Defines SimplePie's home page URL.
* [[reference:SimplePie:SIMPLEPIE_USERAGENT]] — Defines SimplePie's default user agent string.
* [[reference:SimplePie:SIMPLEPIE_VERSION]] — Defines SimplePie's version.
==== Methods ====
=== Configuration (Required) ===
* [[reference:SimplePie:set_feed_url]] — URL of the feed you want to parse.
=== Configuration (Basic) ===
* [[reference:SimplePie:enable_cache]] — Enable/disable caching in SimplePie.
* [[reference:SimplePie:enable_order_by_date]] — Enable/disable the reordering of items into reverse chronological order.
* [[reference:SimplePie:set_cache_duration]] — Set the minimum time for which a feed will be cached.
* [[reference:SimplePie:set_cache_location]] — Set the folder where the cache files should be written.
* [[reference:SimplePie:set_favicon_handler]] — Set the handler to enable the display of cached favicons.
* [[reference:SimplePie:set_image_handler]] — Set the handler to enable the display of cached images.
* [[reference:SimplePie:set_item_limit]] — Set a limit on how many items are returned per feed with Multifeeds.
* [[reference:SimplePie:set_javascript]] — Set the query string used for the JavaScript for [[reference:SimplePie_Enclosure:embed]].
* [[reference:SimplePie:strip_attributes]] — HTML attributes to strip.
* [[reference:SimplePie:strip_comments]] — Strip HTML comments.
* [[reference:SimplePie:strip_htmltags]] — HTML tags to strip.
=== Configuration (Advanced) ===
* [[reference:SimplePie:enable_xml_dump]] — Output the raw XML feed, after it has gone through SimplePie's filters.
* [[reference:SimplePie:encode_instead_of_strip]] — Encode the HTML tags instead of stripping them.
* [[reference:SimplePie:force_feed]] — Force SimplePie to parse the content, even if it doesn't believe it's a feed.
* [[reference:SimplePie:force_fsockopen]] — Use instead of the preferred extension for fetching remote files.
* [[reference:SimplePie:remove_div]] — Remove the surrounding
from XHTML content in Atom feeds.
* [[reference:SimplePie:set_autodiscovery_cache_duration]] — Set the maximum time for which an autodiscovered feed URL will be cached.
* [[reference:SimplePie:set_autodiscovery_level]] — Set what types of autodiscovery to use.
* [[reference:SimplePie:set_cache_name_function]] — Set the callback function used to create cache filenames.
* [[reference:SimplePie:set_file]] — Set an instance of [[reference:SimplePie_File:start]] to use as a feed.
* [[reference:SimplePie:set_input_encoding]] — Override the character set within the feed.
* [[reference:SimplePie:set_max_checked_feeds]] — Maximum number of URLs to check whether they are feeds before giving up.
* [[reference:SimplePie:set_output_encoding]] — Set the output character set.
* [[reference:SimplePie:set_raw_data]] — String of Atom/RSS data to use as a feed.
* [[reference:SimplePie:set_stupidly_fast]] — Set the configurations to make SimplePie as fast as possible (if you don't do your own data sanitisation this can be a security hole).
* [[reference:SimplePie:set_timeout]] — Timeout for fetching remote files.
* [[reference:SimplePie:set_url_replacements]] — Set HTML attributes containing URLs that need to be resolved relative to the feed.
* [[reference:SimplePie:set_useragent]] — Set the useragent SimplePie should use for fetching remote files.
=== Extending Classes (Advanced) ===
* [[reference:SimplePie:Extending the SimplePie class]] -- Notes on how to extend the [[reference:SimplePie:start]] class like the others below.
* [[reference:SimplePie:set_author_class]] -- Set the class to use for authors.
* [[reference:SimplePie:set_cache_class]] -- Set the class to use for caching.
* [[reference:SimplePie:set_caption_class]] -- Set the class to use for Media RSS caption data.
* [[reference:SimplePie:set_category_class]] -- Set the class to use for categories.
* [[reference:SimplePie:set_content_type_sniffer_class]] -- Set the class to use for content-type sniffing.
* [[reference:SimplePie:set_copyright_class]] -- Set the class to use for Media RSS copyright data.
* [[reference:SimplePie:set_credit_class]] -- Set the class to use for Media RSS credit data.
* [[reference:SimplePie:set_enclosure_class]] -- Set the class to use for enclosures.
* [[reference:SimplePie:set_file_class]] -- Set the class to use for reading files (both local and remote).
* [[reference:SimplePie:set_item_class]] -- Set the class to use for items.
* [[reference:SimplePie:set_locator_class]] -- Set the class to use for auto-discovery.
* [[reference:SimplePie:set_parser_class]] -- Set the class to use for XML parsing.
* [[reference:SimplePie:set_rating_class]] -- Set the class to use for Media RSS rating data.
* [[reference:SimplePie:set_restriction_class]] -- Set the class to use for Media RSS restriction data.
* [[reference:SimplePie:set_sanitize_class]] -- Set the class to use for data sanitization.
* [[reference:SimplePie:set_source_class]] -- Set the class to use for handling ''atom:source''.
=== Processing ===
* [[reference:SimplePie:__destruct]] -- Used for avoiding memory leaks when processing lots of feeds.
* [[reference:SimplePie:error]] — Return the error message for the occured error.
* [[reference:SimplePie:handle_content_type]] — Sets the proper HTTP headers for the page, setting the character set to match the output encoding.
* [[reference:SimplePie:init]] — Initialise the feed, parsing it, etc.
=== Feed-Level Data (Basic) ===
* [[reference:SimplePie:get_author]] — Get a single author for the feed. Returns a reference to [[reference:SimplePie_Author:start]].
* [[reference:SimplePie:get_authors]] — Get all authors for the feed. Returns references to [[reference:SimplePie_Author:start]].
* [[reference:SimplePie:get_contributor]] — Get a single contributor for the feed. Returns a reference to [[reference:SimplePie_Author:start]].
* [[reference:SimplePie:get_contributors]] — Get all contributors for the feed. Returns references to [[reference:SimplePie_Author:start]].
* [[reference:SimplePie:get_copyright]] — Get the feed copyright information.
* [[reference:SimplePie:get_description]] — Get the feed description.
* [[reference:SimplePie:get_encoding]] — Get the character set for the returned values.
* [[reference:SimplePie:get_favicon]] — Get the URL for the favicon of the feed's website.
* [[reference:SimplePie:get_item]] — Get a single item. Returns a reference to [[reference:SimplePie_Item:start]].
* [[reference:SimplePie:get_items]] — Get all the items. Returns references to [[reference:SimplePie_Item:start]].
* [[reference:SimplePie:get_item_quantity]] — Get the number of items in the feed.
* [[reference:SimplePie:get_language]] — Get the feed language.
* [[reference:SimplePie:get_link]] — Get a single link.
* [[reference:SimplePie:get_links]] — Get all the links of a specific relation.
* [[reference:SimplePie:get_permalink]] — Get the first feed link (i.e. the permalink).
* [[reference:SimplePie:get_title]] — Get the feed title.
* [[reference:SimplePie:get_type]] — Get the type of feed.
=== Feed-Level GeoData ===
* [[reference:SimplePie:get_latitude]] — Get the feed latitude.
* [[reference:SimplePie:get_longitude]] — Get the feed longitude.
=== Feed Logo ===
* [[reference:SimplePie:get_image_height]] — Get the logo/image height.
* [[reference:SimplePie:get_image_link]] — Get the logo/image linkback URL.
* [[reference:SimplePie:get_image_title]] — Get the logo/image title.
* [[reference:SimplePie:get_image_url]] — Get the logo/image URL.
* [[reference:SimplePie:get_image_width]] — Get the logo/image width.
=== Feed-Level Data Hacking (Advanced) ===
* [[reference:SimplePie:get_all_discovered_feeds]] — Get all feeds discovered during the autodiscovery process.
* [[reference:SimplePie:get_base]] -- Get the ''xml:base'' value of a given element.
* [[reference:SimplePie:get_channel_tags]] — Get the value of ANY tag in the "channel" section of the feed.
* [[reference:SimplePie:get_feed_tags]] — Get the value of ANY tag in the "feed" section of the feed.
* [[reference:SimplePie:get_image_tags]] — Get the value of ANY tag in the "image" section of the feed.
* [[reference:SimplePie:merge_items]] — Merge the items of multiple feeds together.
* [[reference:SimplePie:sanitize]] -- Sanitizes data based on the type of data it is expected to be.
* [[reference:SimplePie:sort_items]] -- An over-ridable method that handles the sorting of items by some criteria.
=== One-Click Subscriptions ===
* [[reference:SimplePie:subscribe_aol]] — URL for subscribing in My AOL.
* [[reference:SimplePie:subscribe_bloglines]] — URL for subscribing in Bloglines.
* [[reference:SimplePie:subscribe_eskobo]] — URL for subscribing in Eskobo.
* [[reference:SimplePie:subscribe_feed]] — The actual feed URL, with a ''feed://'' protocol for subscribing in a desktop aggregator.
* [[reference:SimplePie:subscribe_feedfeeds]] — URL for subscribing in FeedFeeds.
* [[reference:SimplePie:subscribe_feedster]] — URL for subscribing in Feedster.
* [[reference:SimplePie:subscribe_google]] — URL for subscribing in Google Reader.
* [[reference:SimplePie:subscribe_gritwire]] — URL for subscribing in Gritwire.
* [[reference:SimplePie:subscribe_itunes]] — The actual feed URL, with an ''itpc://'' protocol for subscribing in iTunes.
* [[reference:SimplePie:subscribe_msn]] — URL for subscribing in My MSN.
* [[reference:SimplePie:subscribe_netvibes]] — URL for subscribing in Netvibes.
* [[reference:SimplePie:subscribe_newsburst]] — URL for subscribing in Newsburst.
* [[reference:SimplePie:subscribe_newsgator]] — URL for subscribing in Newsgator.
* [[reference:SimplePie:subscribe_odeo]] — URL for subscribing in Odeo.
* [[reference:SimplePie:subscribe_outlook]] — The actual feed URL, with an ''outlook://'' protocol for subscribing in Microsoft Outlook 2007.
* [[reference:SimplePie:subscribe_podcast]] — The actual feed URL, with a ''podcast://'' protocol for subscribing in a desktop podcast player.
* [[reference:SimplePie:subscribe_podnova]] — URL for subscribing in Podnova.
* [[reference:SimplePie:subscribe_rojo]] — URL for subscribing in Rojo.
* [[reference:SimplePie:subscribe_url]] — The actual feed URL.
* [[reference:SimplePie:subscribe_yahoo]] — URL for subscribing in My Yahoo!
===== SimplePie_Item =====
* [[reference:SimplePie_Item:start]] — Learn more about this object.
==== Methods ====
=== Item-Level Data (Basic) ===
* [[reference:SimplePie_Item:get_author]] — Get a single author for the post. Returns a reference to [[reference:SimplePie_Author:start]].
* [[reference:SimplePie_Item:get_authors]] — Get all authors for the post. Returns references to [[reference:SimplePie_Author:start]].
* [[reference:SimplePie_Item:get_categories]] — Get all categories for the post. Returns a reference to [[reference:SimplePie_Category:start]].
* [[reference:SimplePie_Item:get_category]] — Get a single category for the post. Returns references to [[reference:SimplePie_Category:start]].
* [[reference:SimplePie_Item:get_content]] — Get the content of the post (prefers full-content)
* [[reference:SimplePie_Item:get_contributor]] — Get a single contributor for the post. Returns a reference to [[reference:SimplePie_Author:start]].
* [[reference:SimplePie_Item:get_contributors]] — Get all contributors for the post. Returns references to [[reference:SimplePie_Author:start]].
* [[reference:SimplePie_Item:get_copyright]] — Get the copyright information for the post.
* [[reference:SimplePie_Item:get_date]] — Get the date for the post.
* [[reference:SimplePie_Item:get_description]] — Get the content of the post (prefers summaries)
* [[reference:SimplePie_Item:get_enclosure]] — Get a single enclosure for the post. Returns a reference to [[reference:SimplePie_Enclosure:start]].
* [[reference:SimplePie_Item:get_enclosures]] — Get all enclosures for the post. Returns references to [[reference:SimplePie_Enclosure:start]].
* [[reference:SimplePie_Item:get_feed]] — Get a reference to the parent feed object. Returns a reference to [[reference:SimplePie:start]].
* [[reference:SimplePie_Item:get_id]] — Get the unique identifier for the post.
* [[reference:SimplePie_Item:get_link]] — Get a single link for the post.
* [[reference:SimplePie_Item:get_links]] — Get all links for the post of a specific relation.
* [[reference:SimplePie_Item:get_local_date]] — Get the localized date for the post.
* [[reference:SimplePie_Item:get_permalink]] — Get the first link for the post (i.e. the permalink).
* [[reference:SimplePie_Item:get_source]] — Get a reference to the feed referenced in ''atom:source''. Returns a reference to [[reference:SimplePie_Source:start]].
* [[reference:SimplePie_Item:get_title]] — Get the title for the post.
=== Item-Level GeoData ===
* [[reference:SimplePie_Item:get_latitude]] — Get the post latitude.
* [[reference:SimplePie_Item:get_longitude]] — Get the post longitude.
=== Item-Level Data Hacking (Advanced) ===
* [[reference:SimplePie:get_base]] -- Get the ''xml:base'' value of a given element.
* [[reference:SimplePie_Item:get_item_tags]] — Get the value of ANY tag in the item.
* [[reference:SimplePie:sanitize]] -- Sanitizes data based on the type of data it is expected to be.
=== Bookmarking ===
* [[reference:SimplePie_Item:add_to_service]] — Generic method for adding more "add to" services.
* [[reference:SimplePie_Item:add_to_blinklist]] — Add the post to Blinklist.
* [[reference:SimplePie_Item:add_to_blogmarks]] — Add the post to Blogmarks.
* [[reference:SimplePie_Item:add_to_delicious]] — Add the post to Del.icio.us.
* [[reference:SimplePie_Item:add_to_digg]] — Add the post to Digg.
* [[reference:SimplePie_Item:add_to_furl]] — Add the post to Furl.
* [[reference:SimplePie_Item:add_to_magnolia]] — Add the post to Ma.gnolia.
* [[reference:SimplePie_Item:add_to_myweb20]] — Add the post to My Web 2.0.
* [[reference:SimplePie_Item:add_to_newsvine]] — Add the post to Newsvine.
* [[reference:SimplePie_Item:add_to_reddit]] — Add the post to Reddit.
* [[reference:SimplePie_Item:add_to_segnalo]] — Add the post to Segnalo.
* [[reference:SimplePie_Item:add_to_simpy]] — Add the post to Simpy.
* [[reference:SimplePie_Item:add_to_spurl]] — Add the post to Spurl.
* [[reference:SimplePie_Item:add_to_wists]] — Add the post to Wists.
* [[reference:SimplePie_Item:search_technorati]] — Search for discussions about the post.
===== SimplePie_Author =====
* [[reference:SimplePie_Author:start]] — Learn more about this object.
==== Methods ====
=== Author-Level Data ===
* [[reference:SimplePie_Author:get_email]] — Get the author's email address.
* [[reference:SimplePie_Author:get_link]] — Get the author's link.
* [[reference:SimplePie_Author:get_name]] — Get the author's name.
===== SimplePie_Category =====
* [[reference:SimplePie_Category:start]] — Learn more about this object.
==== Methods ====
=== Category-Level Data ===
* [[reference:SimplePie_Category:get_term]] — Get the category's identifier.
* [[reference:SimplePie_Category:get_scheme]] — Get the category's categorization scheme identifier.
* [[reference:SimplePie_Category:get_label]] — Get the category's human-readable label.
===== SimplePie_Enclosure =====
* [[reference:SimplePie_Enclosure:start]] — Learn more about this object.
==== Methods ====
=== Enclosure-Level Data ===
* [[reference:SimplePie_Enclosure:get_extension]] -- Get the file extension of the enclosure.
* [[reference:SimplePie_Enclosure:get_handler]] -- Get the preferred plugin handler for this content.
* [[reference:SimplePie_Enclosure:get_length]] -- Get the file size (in bytes) of the enclosure.
* [[reference:SimplePie_Enclosure:get_link]] -- Get the URL of the enclosure.
* [[reference:SimplePie_Enclosure:get_real_type]] -- Get the mime type that the enclosure likely is (despite the [[reference:SimplePie_Enclosure:get_type]] setting)
* [[reference:SimplePie_Enclosure:get_size]] -- Get the file size (in Mebibytes) of the enclosure.
* [[reference:SimplePie_Enclosure:get_type]] -- Get the mime type of the enclosure.
=== Extended Enclosure-Level Data (Media RSS, iTunes RSS) ===
* [[reference:SimplePie_Enclosure:get_bitrate]] -- Get the bitrate of the enclosure.
* [[reference:SimplePie_Enclosure:get_caption]] -- Get a single caption for the enclosure. Returns a reference to [[reference:SimplePie_Caption:start]].
* [[reference:SimplePie_Enclosure:get_captions]] -- Get all captions for the enclosure. Returns references to [[reference:SimplePie_Caption:start]].
* [[reference:SimplePie_Enclosure:get_category]] -- Get a single category for the enclosure. Returns a reference to [[reference:SimplePie_Category:start]].
* [[reference:SimplePie_Enclosure:get_categories]] -- Get all categories for the enclosure. Returns references to [[reference:SimplePie_Category:start]].
* [[reference:SimplePie_Enclosure:get_channels]] -- Get the number of audio channels for the enclosure.
* [[reference:SimplePie_Enclosure:get_copyright]] -- Get the copyright info for the enclosure. Returns a reference to [[reference:SimplePie_Copyright:start]].
* [[reference:SimplePie_Enclosure:get_credit]] -- Get a single credit for the enclosure. Returns a reference to [[reference:SimplePie_Credit:start]].
* [[reference:SimplePie_Enclosure:get_credits]] -- Get all credits for the enclosure. Returns references to [[reference:SimplePie_Credit:start]].
* [[reference:SimplePie_Enclosure:get_description]] -- Get the description of the enclosure.
* [[reference:SimplePie_Enclosure:get_duration]] -- Get the duration (in seconds) of the enclosure.
* [[reference:SimplePie_Enclosure:get_expression]] -- Get the expression of the enclosure.
* [[reference:SimplePie_Enclosure:get_framerate]] -- Get the framerate of the enclosure.
* [[reference:SimplePie_Enclosure:get_hash]] -- Get a single hash for the enclosure.
* [[reference:SimplePie_Enclosure:get_hashes]] -- Get all hashes for the enclosure.
* [[reference:SimplePie_Enclosure:get_height]] -- Get the height of the enclosure.
* [[reference:SimplePie_Enclosure:get_keyword]] -- Get a single keyword for the enclosure.
* [[reference:SimplePie_Enclosure:get_keywords]] -- Get all keywords for the enclosure.
* [[reference:SimplePie_Enclosure:get_language]] -- Get the language of the enclosure.
* [[reference:SimplePie_Enclosure:get_medium]] -- Get the medium of the enclosure.
* [[reference:SimplePie_Enclosure:get_player]] -- Get the player page for the enclosure.
* [[reference:SimplePie_Enclosure:get_rating]] -- Get a single rating for the enclosure. Returns a reference to [[reference:SimplePie_Rating:start]].
* [[reference:SimplePie_Enclosure:get_ratings]] -- Get all ratings for the enclosure. Returns references to [[reference:SimplePie_Rating:start]].
* [[reference:SimplePie_Enclosure:get_restriction]] -- Get a single restriction for the enclosure. Returns a reference to [[reference:SimplePie_Restriction:start]].
* [[reference:SimplePie_Enclosure:get_restrictions]] -- Get all restrictions for the enclosure. Returns references to [[reference:SimplePie_Restriction:start]].
* [[reference:SimplePie_Enclosure:get_sampling_rate]] -- Get the sampling rate of the enclosure.
* [[reference:SimplePie_Enclosure:get_thumbnail]] -- Get a single thumbnail for the enclosure.
* [[reference:SimplePie_Enclosure:get_thumbnails]] -- Get all thumbnails for the enclosure.
* [[reference:SimplePie_Enclosure:get_title]] -- Get the title of the enclosure.
* [[reference:SimplePie_Enclosure:get_width]] -- Get the width of the enclosure.
=== Embedding ===
* [[reference:SimplePie_Enclosure:embed]] — Automatically embed the enclosure in the page using JavaScript.
* [[reference:SimplePie_Enclosure:native_embed]] — Automatically embed the enclosure in the page using the