force_fsockopen(true); // Make sure that page is getting passed a URL if (isset($_GET['feed']) && $_GET['feed'] !== '') { // Strip slashes if magic quotes is enabled (which automatically escapes certain characters) if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { $_GET['feed'] = stripslashes($_GET['feed']); } // Use the URL that was passed to the page in SimplePie $feed->set_feed_url($_GET['feed']); // XML dump $feed->enable_xml_dump(isset($_GET['xmldump']) ? true : false); } // Allow us to change the input encoding from the URL string if we want to. (optional) if (!empty($_GET['input'])) { $feed->set_input_encoding($_GET['input']); } // Allow us to choose to not re-order the items by date. (optional) if (!empty($_GET['orderbydate']) && $_GET['orderbydate'] == 'false') { $feed->enable_order_by_date(false); } // Allow us to cache images in feeds. This will also bypass any hotlink blocking put in place by the website. if (!empty($_GET['image']) && $_GET['image'] == 'true') { $feed->set_image_handler('./handler_image.php'); } // We'll enable the discovering and caching of favicons. $feed->set_favicon_handler('./handler_image.php'); // Initialize the whole SimplePie object. Read the feed, process it, parse it, cache it, and // all that other good stuff. The feed's information will not be available to SimplePie before // this is called. $success = $feed->init(); // We'll make sure that the right content type and character encoding gets set automatically. // This function will grab the proper character encoding, as well as set the content type to text/html. $feed->handle_content_type(); // When we end our PHP block, we want to make sure our DOCTYPE is on the top line to make // sure that the browser snaps into Standards Mode. ?> SimplePie: Demo

 

error()) { // If so, start a
element with a classname so we can style it. echo '

get_link()) echo ''; echo $feed->get_title(); if ($feed->get_link()) echo ''; ?>

get_description(); ?>
get_items() as $item): ?>
get_favicon()) { $favicon = './for_the_demo/favicons/alternate.png'; } ?>

Faviconget_permalink()) echo ''; echo $item->get_title(); if ($item->get_permalink()) echo ''; ?> get_date('j M Y, g:i a'); ?>

get_content(); ?> get_enclosure(0)) { // Use the embed() method to embed the enclosure into the page inline. echo '
'; echo '

' . $enclosure->embed(array( 'audio' => './for_the_demo/place_audio.png', 'video' => './for_the_demo/place_video.png', 'mediaplayer' => './for_the_demo/mediaplayer.swf', 'altclass' => 'download' )) . '

'; if ($enclosure->get_link() && $enclosure->get_type()) { echo '

(' . $enclosure->get_type(); if ($enclosure->get_size()) { echo '; ' . $enclosure->get_size() . ' MB'; } echo ')

'; } if ($enclosure->get_thumbnail()) { echo '
'; } echo '
'; } ?>

Blinklist Blogmarks del.icio.us Digg Ma.gnolia My Web 2.0 Newsvine Reddit Segnalo Simpy Spurl Wists Technorati

Page processed in seconds.

Powered by . Run the SimplePie Compatibility Test. SimplePie is © 2004–, Ryan Parman and Geoffrey Sneddon, and licensed under the BSD License.