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 stable version: netflix-x2.1.3.1.zip
Download the dev version: netflix-x2.dev.zip (may not be stable or work correctly)
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. I have received a fair amount of email asking for the code I used to create my example movies page, so I’ve made that available via text file download here: http://www.ericvb.com/misc/Misc/netflixpage.txt
As you will see in the documentation below, the functionality of this plugin is fairly versatile. It can be as simple as setting your options and dropping the widget into your sidebar, but you can also take it much further. 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, the more in-depth uses can be a bit difficult 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.
Installation Instructions
- Download and unzip the plugin (directory and 3 files)
- Upload the folder (netflix-x2) to your WordPress wp-content/plugins directory on your webserver.
- Log into your Wordpress administrative panel, click on ‘Plugins’ and activate the Netflix-X2 plugin.
- 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
- Add the Netflix-X2 widget to your sidebar! Or, see the General/Advanced usage options below
General Usage
For simplest usage, configure the options from the Netflix-X2 configuration within the Wordpress administration panel, and then just put the Netflix-X2 widget into your widget-ready theme. Or, you can 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(20, “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
Version History
Version 1.3.1 – 3/11/2010
- - No need to include the rss.php any longer since we use SimplePie. Changed the require statments to call wp-includes/feed.php instead.
- - Added a cache timer to counter the SimplePie 12 hour feed cache. Feeds are cached for 30 minutes now vs the 12 hour default.
Version 1.3 – 2/24/2010
- - Configured REAL widget functionality instead of the hacky wanna-be widget. Works much nicer with user being able to pick title.
- - Moved the options page to be loc1ated under “Settings” vs under the plugins page. Seems to be the standard now.
- - Added a settings link on the plugins page for less clicks to get to configure the plugin.
Version 1.2.2 – 2/23/2010
- - Switched fetch_rss functions from MagpieRSS to now use SimplePie function fetch_feed. This change done due to Magpie depreciation and non-active product.
- - Removed ^M characters that had become present through Windows/Linux file editing.
Version 1.2.1 – 2/22/2010
- - Minor change, updated include statements to call rss.php file from wp-includes instead of rss-functions.php.
Version 1.2 – 6/18/2009
- - Adding “text only” options for feed display. This can be set in the plugin options screen, and can also be called directly by using the get_textonly() function. * Thanks to David McDonald – http://www.watchingred.com
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
on November 7, 2008 at 9:26 pm
Permalink
[...] Wordpress Netflix Plugin [...]
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 [...]
on June 10, 2009 at 9:48 pm
Permalink
Would you mind sharing your Movies page template code? The raw PHP/HTML.
Thanks!
on June 11, 2009 at 3:08 am
Permalink
Blake; emailed it to you because the comment displays my code as a page. :-/
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?
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
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?
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.
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.
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?
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 ()?>
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.
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.
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.
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.
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.
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)
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…
on December 21, 2009 at 11:02 pm
Permalink
AWESOME! I’ll email you right now
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:
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?
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!
on February 12, 2010 at 2:02 am
Permalink
Thought I would post a diff for the version of netflix-x2 on the wordpress site (listed as 1.2). It uses the old magpie rss, which seems to not like either Wordpress 2.9, or PHP 5.3 (not sure). It makes the plugin throw strpos errors, even though it seems to work. It’s odd.
Anyway, easy fix is:
58,59c58,59
< $rss = fetch_rss($url);
items as $item) {
—
> $rss = fetch_feed($url);
> foreach ($rss->get_items() as $item) {
65c65
$raw_title = $item->get_title();
68,69c68,69
< $link = $item['link'];
$link = $item->get_link();
> $description = $item->get_description();
129c129
$rss = fetch_feed($url);
on February 15, 2010 at 8:33 pm
Permalink
Interesting…
RS, can I ask what led you to believe there are issues?
I’ve not had any problems since upgrading to wordpress 2.9
on February 21, 2010 at 3:15 pm
Permalink
I am running Wordpress 2.9.2, uploaded plugin, went to activate it and received the following message: Plugin could not be activated because it triggered a fatal error.
Is there any kind of plugin that might interfere with this one, or one maybe I do not have activated that I should? or any ideas at all…I tried installing this on earlier versions of Wordpress 2.9 or 8 and it gave me same error.
on February 21, 2010 at 6:33 pm
Permalink
christy,
I have never heard of that – and I’m running the plugin on wordpress 2.9.2.
as long as you’ve activated the netflix plugin you should be good to go…
Is there any other error text of any kind? or is that all we get?
just for testing’s sake you could de-activate all other plugins temporarily and see if that changes anything. Let me know if that produces anything but at this point I don’t have any other ideas besides that.
on February 22, 2010 at 11:32 am
Permalink
Christy and RS,
Wanted to let you both know that I’ve updated the plugin as follows:
instead of my include statements calling the depreciated file rss-functions.php, I am having it call the newer rss.php file for those rss parsing functions.
I am thinking that solves issues on both accounts – but please let me know if there’s anything else I can do.
RS, I considered putting your changes into the stable version of the plugin but the rss.php file included with wordpress does maintain the magpie rss functionality. So, at this point I think I’ll keep it as is.
Thanks to you both, I hope you enjoy the plugin.