You are here: Documentation » API Reference
This is an old revision of the document!
API Reference
For those who were expecting the documentation for a specific method or function, we recently moved around our docs and this is the closest we could reliably come to keeping you on-track.
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 trunk builds can be found in our automatically generated Hacker Docs.
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_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_fsockopen() — Use fsockopen() instead of the preferred cURL 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_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_category_class() — Set the class to use for categories.
- 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_sanitize_class() — Set the class to use for data sanitisation.
Processing
- 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_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.
- get_items() — Get all the items.
- 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.
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_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.
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. * subscribe_feedfeeds() — URL for subscribing in FeedFeeds. * subscribe_feedlounge — URL for subscribing in FeedLounge. * subscribe_feedster() — URL for subscribing in Feedster. * subscribe_google() — URL for subscribing in Google Reader. * subscribe_gritwire() — URL for subscribing in Gritwire. * 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.
- subscribe_podcast() — The actual feed URL, with a podcast: protocol. * 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. * get_authors() — Get all authors for the post. * get_categories() — Get all categories for the post. * get_category() — Get a single category for the post. * get_content() — Get the content of the post (prefers full-content) * 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. * get_enclosures() — Get all enclosures for the post. * get_feed() — Get a reference to the parent feed object. * 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_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_item_tags() — Get the value of ANY tag in the item. === Bookmarking === * 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_smarking — Add the post to Smarking. * 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 categorisation scheme indentifier. * 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_length() — Get the file size (in bytes) of the enclosure. * get_link() — Get the URL of the enclosure. * get_size() — Get the file size (in Mebibytes) of the enclosure. * get_type() — Get the mime type 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_Cache (Non-Public) ===== * SimplePie_Cache — Learn more about this object. ===== SimplePie_File (Non-Public) ===== * SimplePie_File — Learn more about this object. ===== SimplePie_HTTP_Parser (Non-Public) ===== * SimplePie_HTTP_Parser — Learn more about this object. ===== SimplePie_Locator (Non-Public) ===== * SimplePie_Locator — 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_Sanitize (Non-Public) ===== * SimplePie_Sanitize — Learn more about this object.
reference/start.1180501150.txt.gz · Last modified: 2011/03/06 03:56 (external edit)