Elliott C. Back: Internet & Technology

Movies Tab Added

Posted in My Blog by Elliott Back on December 20th, 2004.

In an attempt to enrich the content of my blog, I’ve added a movies tab to the upper part of my navigation. It uses magpie RSS to pull three of my NetFlix feeds onto that page. You can view my most recent rentals, my rentals to come, and the new releases. I use the following code:

function GetRSS($url, $show_author = false, $limit = 10) {
   
$path = ABSPATH . "wp-content/plugins/magpie/";
   
   require_once(
$path . ‘rss_fetch.inc’);   
   
$rss = fetch_rss($url);
   if (
$rss)
   {
      
$items = array_slice($rss->items, 0, $limit);
      foreach (
$items as $item )
      {
         if(
$show_author){
            echo
‘<li><a href="’.$item['link'].‘">’.$item['title'].‘</a> – ‘.$item['author'].‘</li>’;
         } else{
            echo
‘<li><a href="’.$item['link'].‘">’.$item['title'].‘</a></li>’;
         }
      }
   } else {
      echo
‘<li><strong>Error:</strong> ‘ . magpie_error().‘</li>’;
   }
   
// Restore original error reporting value
   @ini_restore(‘error_reporting’);
}

This entry was posted on Monday, December 20th, 2004 at 11:01 pm and is tagged with magpie rss, nbsp nbsp nbsp nbsp nbsp, netflix, magpie, lt, new releases, array, blog. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.

One Response to “Movies Tab Added”

  1. orangeguru says:

    Very cool! You are one smart & gifted dude dude …

Leave a Reply

Powered by WP Hashcash