Netflix-X2

Plugin Information Summary
The Wordpress Netflix-X2 plugin allows you to display content from the RSS feeds in your Netflix account into your Wordpress Blog.  Netflix-X2 is based on the original Netflix plugin for Wordpress by Albert Banks.  Enhancements have been made to allow support for the latest RSS feeds that Netflix offers. Most notably, you can use this plugin to show movies from your Netflix queue, to show your movies currently at home, to show any movie reviews you have written, and more!

Download the Plugin: netflix-x2.1.1.zip

Official WP Page: Check out the official page on the Wordpress plugin repository for Netflix-X2.

Example Page: www.ericvb.com/movies to see some real examples

As you will see in the documentation below, the functionality of this plugin is fairly versatile.  The plugin can be used to display cover images, movie titles, and summary text for the movies in your Netflix queue. It can also display your recommendations as well as your movie reviews. It can essentially display content from any of the available Netflix RSS feeds.  (My personal favorite is displaying my movie reviews that I’ve written via Netflix).

Because the plugin is so functional, it can be a bit difficult to use at first.  Take a look at some of these examples, and feel free to contact me with any questions.  Please enjoy using this plugin!

PLEASE NOTE: Wordpress by default does not support execution of PHP code within pages/posts. If you’re planning on using Netflix-X2 content in a page or post like I have done here then you’ll have to use a plugin like RunPHP or ExecPHP. However, this is not necessary if you embed the code within header/sidebar/footer php files.


Version History

Version 1.1 – 11/12/2008

  • - Widgetized the netflix-x2 plugin. No configurable options yet though.
  • - Added new display option “text” to the netflix function. This returns the user’s written review if they have picked the reviews feed; and returns the movie description for any other feed selection.

Version 1.0 – 11/7/2008

  • - Started with version 3.1 of Albert Banks’ original Netflix plugin
  • - Added support for the Reviews RSS feed
  • - Added support for the Watch Instantly Queue RSS feed


Installation Instructions

  1. Download and unzip the plugin (directory and 3 files)
  2. Upload the folder (netflix-x2) to your WordPress wp-content/plugins directory on your webserver.
  3. Log into your Wordpress administrative panel, click on ‘Plugins’ and activate the Netflix-X2 plugin.
  4. Configure the settings by adding your Netflix ID and also the type of content you wish to display.  You can get your Netflix RSS ID by logging into your Netflix account, clicking on RSS link at the bottom of the page, and then simply copy and paste your ID from any of the available RSS feeds listed

General Usage
For simple usage, configure the options from the Netflix-X2 configuration within the Wordpress administration panel, and call the netflix function from within any of your wordpress files, such as sidebar.php.

Example:

<? netflix() ?>


Advanced Options:
For more advanced usage, there are more variables that can be set in the netflix function.

<? netflix($number_movies, $feed, $display_type, $image_size, $before, $after, $netflix_id); ?>


Options breakdown:

$number_movies - number of feed elements displayed (default is 10)

$feed
- Set which Netflix feed to use
home – displays movies you have at home currently (default)
queue – displays movies in your queue in order
instant – displays movies from your watch instantly queue
recommendations – displays the movies Netflix has recommended for you
recent – displays your recent rental activity
reviews – displays the most recent movie reviews you’ve written

$display_type - what to display.
title – shows only the movies title (default)
raw – displays raw text from rss feed
image – display the movie cover image
text – For the reviews feed, displays your review text. For all other feeds, displays the movie summary description

$image_size - if $type is set to ‘image’ this defines the image size
small – small image (64px X 90px) (default)
large – large image (110px X 154px)

$before - html appearing before each rss item (li, td, br tags for example)

$after - html appearing after each rss item

$netflix_id - your netflix id


Advanced Options Usage:

For example, this code would display large images for the next 10 items in your queue in an unordered list:

<ul>
<? netflix(10, “queue”, “image”, “large”, “<li>”, “</li>”, “P9999999999999999999999999999″);
?>
</ul>

And this code would display the images and titles of the next 20 items in your watch instantly queue:

<ul>
<? netflix(10, “instant”, “both”, “large”, “<li>”, “</li>”, “P9999999999999999999999999999″);
?>
</ul>

Additional Functions:

<? netflix_movies($number_movies, $feed, $netflix_id) ?>

This example code of the netflix_movies function will show the last 8 movie reviews you wrote in a nicely formatted unordered list:

<ul>
<? $movies = netflix_movies(8, “reviews”);
foreach ($movies as $movie) {
echo ‘<li>’;
echo ‘<strong>’,$movie->get_title(),’</strong>’;
echo ‘<br />’;
echo $movie->get_description();
echo ‘</li>’;
} ?>

</ul>

One last example of code, this would selects the next 25 movies from your queue, looping through them to display each cover image in a formatted html table.

<? $movies = netflix_movies(25, “queue”);
echo ‘<table><tr>’;
foreach ($movies as $movie) {
echo ‘<td>’;
echo $movie->get_cover_image();
echo ‘</td>’;
}
echo ‘</tr></table>’;  ?>


Movie Functions Breakdown:

get_id()
Displays the Netflix movie ID

get_title()
Get the movie title

get_link()
Get link to movie on the Netflix website

get_description()
Reviews RSS Feed: This function retrieves the review you’ve written.
All other RSS Feeds: This function retrieves the movie summary.

get_cover_image($size)
Displays the movie cover image (linked from Netflix’s site)

get_cover_image_source($size)
Gets the html link address for the cover image.

For any questions, concerns, or suggestions, please feel free to email me: vanberge@gmail.com

22 Responses

Subscribe to comments via RSS

  1. Written by Introducing Netflix-X2 at PalmerForPresident.com
    on November 7, 2008 at 9:26 pm
    Permalink

    [...] Wordpress Netflix Plugin [...]

  2. Written by Nathan’s Thoughts » Site Updates
    on November 11, 2008 at 4:16 am
    Permalink

    [...] know, I would appreciate it. Thanks to Eric VanBergen of PalmerforPresident for helping me with his Netflix-X2 plugin for wordpress, he really steered me in the right [...]

  3. Written by blake
    on June 10, 2009 at 9:48 pm
    Permalink

    Would you mind sharing your Movies page template code? The raw PHP/HTML.

    Thanks!

  4. Written by Vanberge
    on June 11, 2009 at 3:08 am
    Permalink

    Blake; emailed it to you because the comment displays my code as a page. :-/

  5. Written by Russ Turley
    on July 29, 2009 at 11:21 am
    Permalink

    The plugin, which previously worked great, now doesn’t work. I just have the standard tag in my template. Also just upgraded to WP 2.8.2. Anyone else have this break?

  6. Written by Vanberge
    on July 29, 2009 at 11:36 am
    Permalink

    Russ,
    I’m running Worpdress 2.8.2. currently myself and haven’t had any issues.
    What sort of problems are you experiencing?

    Actual PHP errors displayed? or perhaps just a lack of things showing up.

    Sometimes the Netflix feeds go offline or return blank information – I’ve had that happen from time to time on my site with no changes to my code.

    email me if you want with some specifics and I’ll do what I can do help. vanberge@gmail.com

  7. Written by Jason
    on November 13, 2009 at 3:00 pm
    Permalink

    I can’t seem to get this plugin to do anything. It looks great and is exactly what I’m looking for.

    I am using WordPress 2.8.6.
    I create a new page called netflix. Go to the page editor and insert (the example code). Nothing renders on the page. I tried all the various example code and it is not working. I’ve checked my RSS feeds to make sure they are work fine.

    In most of the cases it returns portions of the code or my Netflix ID as rendered HTML. I must be doing something wrong. Any ideas?

  8. Written by Vanberge
    on November 13, 2009 at 3:20 pm
    Permalink

    Jason – you’re actually not doing anything wrong.
    When you put the php code into a page or post – wordpress wont execute it as php.

    I’m sure this is done for security reasons but it really REALLY sucks.

    i use a plugin called “RunPHP” to then allow the php code to run correctly

    give that a try, and it should work for you.

  9. Written by Jason
    on November 14, 2009 at 12:13 am
    Permalink

    Thanks Eric. You were correct I was unable to execute PHP code insides pages and posts. RunPHP does not work with 2.8.6 so I had to use something called Exec-PHP which seems to work although you have to do some role management to get it to work.

  10. Written by KC Lowlife
    on November 17, 2009 at 1:12 pm
    Permalink

    Hi, I’m using your plugin to display movies that are currently checked out to me. When the movies are all returned and netflix hasn’t shipped new ones yet, I get the following error displayed:

    Warning: Invalid argument supplied for foreach() in /home/*OBFUSCATED*/kclowlife.com/wp-content/plugins/netflix-x2/netflix.php on line 59

    Any suggestions on a way to fix this?

  11. Written by Vanberge
    on November 17, 2009 at 4:08 pm
    Permalink

    KC Lowlife,
    I’d have to see the php code you’re using.

    Does it happen if you use the “simpler” way of setting the options and just doing < ? netflix ()?>

  12. Written by KC Lowlife
    on November 17, 2009 at 10:10 pm
    Permalink

    I just installed your plugin and added the RSS feed then dropped the widget in place. Didn’t manipulate any PHP.

    Unfortunately, since this only occurs when I have 0 movies checked out, I can’t reproduce this at the moment. Since I do a fair bit with computers, I thought it would probably just be a test case that you missed. Like, if feed exists but films = 0 don’t error. Appreciate you answering. I’ll try to catch it again when it’s hosed in a few days.

  13. Written by Vanberge
    on November 18, 2009 at 7:09 am
    Permalink

    Hmm… wierd.
    When i have no movies at home, it just outputs nothing. (same thing when netflix’s RSS feeds are down).

    but, i’.l do some looking into it and see what we can find out.

  14. Written by KC Lowlife
    on November 18, 2009 at 6:48 pm
    Permalink

    maybe it was one time thing. perhaps they don’t provision rss feeds until they see them being used. or perhaps their db was hosed. anyhow, I’ll let you know next time I see them all checked out. just got 3 more in, so hopefully in 2 more days.

  15. Written by KC Lowlife
    on November 21, 2009 at 11:00 am
    Permalink

    nope, the issue is back. although it’s for a short period. I got the emails notifying me that it got my 3 movies in. Then I saw the error. Now(10 minutes later) it just shows nothing under the netflix tab, no error.

    sorry, but I’m not having any luck inserting that test php snippet into another section of the blog for testing. tried adding it to a raw html widget(you can see it in the left column) and I tried creating a page and inserting it in there but that didn’t work either(http://www.kclowlife.com/netflix-x2-test/). Sorry, I’m good at some computer stuff, but PHP and wordpress are still confusing me a bit.

  16. Written by Paul Richardson
    on December 21, 2009 at 7:35 pm
    Permalink

    Hi Vanberge,

    I notice you are now on 2.9 and still running Netflix X2. Did you switch from RunPHP to exec-PHP?

    After I installed Exec-PHP, then starting reading how I had to enable/disable bunches of stuff just to get THAT working, at that point I sort of gave up.

    I like your reviews (movies) page, and can’t find anything else like it.

  17. Written by Paul Richardson
    on December 21, 2009 at 10:06 pm
    Permalink

    Ok, I searched and experimented with all kind of other “products” and there is no other pluggin that comes close.

    I need to get your working for me.

    Actions thus far: demo test script here: http://bluesome.net/post/2005/08/18/50/#tests (the bottom one that reads “Handle This!”) works just fine, using Exec-PHP.

    Netflix X2 is printing nothing to the screen at all, using the “reviews” sample code above.

    (note that the other Netflix pluggins did print my Netflix Reviews RSS out fine, but UGLY and via Sidebar only)

  18. Written by Vanberge
    on December 21, 2009 at 10:34 pm
    Permalink

    Paul – I actually still use RunPHP and haven’t had any problems.
    If you like, I can email you the code I use to generate my reviews section.

    Another thing to try with the netflix-x2 plugin would be to set all the options just as a test (your RSS id, queue, number of movies, etc. ) and then just call the netflix function in your sidebar to see if it works there.

    Hope that helps…

  19. Written by Paul Richardson
    on December 21, 2009 at 11:02 pm
    Permalink

    AWESOME! I’ll email you right now

  20. Written by Paul Richardson
    on December 21, 2009 at 11:43 pm
    Permalink

    Hey Vanberge,

    Did you email me the code? I tried it with all options set (both in a standalone page, and via a sidebar widget), using the netflix function, but it still did not work >> it displays nothing at all.

    Again, it seems to work just fine using the ’simple’ (basic) method of just calling the function alone:

  21. Written by pan
    on January 2, 2010 at 2:40 pm
    Permalink

    How can I show the “instant” queue in descending order? Right now the queue picks up the first x number of movies. Can I make it the last x number of movies in the instant list?

    Or is there a way (like one Facebook has) to show the recent “Ratings” (instead of reviews) I give to movies on Netflix?

  22. Written by Vanberge
    on January 4, 2010 at 9:25 am
    Permalink

    Pan,
    Currently there isn’t any way to display the feeds in any other order… They are read in just as they come from Netflix. So, right now the only possible way is ascending order.

    Also, the ratings from Netflix don’t currently exist in a Netflix RSS feed as the queues/reviews do – so unless they start offering an RSS feed for ratings this wont be possible with this plugin.

    Sorry I can’t give you better news!

Subscribe to comments via RSS

Leave a Reply