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