<?php

/*
Plugin Name: KTGNetflix
Plugin Version: 1.0
Description: This plugin displays information about your NetFlix viewing habits.  Based on MyNetflix by Jimmy Oliver
  A NetFlix account is required.
Author: Keith Garner
Author URI: http://www.kgarner.com/
License: GPL
*/

require_once(ABSPATH WPINC '/rss-functions.php');

/* The url is assumed to be the url of your netflix rss feed. Login to
   your netflix account and go to your queue. At the bottom of the
   page is a RSS link. Copy the RSS link under Most Recent Rental
   Activity or Queue.  The limit is how many of your queue to show
   (defaults to 20.)
*/

function ktgnetflix($url=""$limit 20) {
if ( 
$url ) {
    
$rss fetch_rss$url );
    echo 
wptexturize("<ul>\n");
    
$urlcount 0;
        foreach (
$rss->items as $item) {
            
$urlcount++;
            if (
$urlcount $limit)
                break;
            
$href $item['link'];
            echo 
wptexturize("<li><a href=\"$href\">".$item['title']."</a></li>\n");
        }
    echo 
wptexturize("</ul>\n");
    }
}

?>