How to export Netflix ratings?


Hello there,

For a while, I have Amazon Instant Video (with Amazon Prime) and Netflix. If you look at the available titles in AIV, they are covering most of the Netflix titles. Therefore, I decided to cancel my Netflix subscription. But wait, I do not want to lose my movie ratings at Netflix, how can I save them? Sadly, Netflix does not provide any export functionality built-in.

Here is my quick and dirty (~15 min coding) developer solution to export all the ratings in a Netflix account.

0. Open up a modern web browser (I used Safari)
1. Login to your Netflix account
2. Right click on the page and choose "Inspect Element" from the context menu
3. Click on "Console" tab
4. Paste the following code and hit enter to run *

$ = jQuery;
var pages = parseInt($('.pageNumber:last').text(), 10);

var printRatings = function(pageNo) {
  $.ajax({
    url: "http://www.netflix.com/MoviesYouveSeen?pn=" + pageNo + "&st=rt&so=1",
    success: function( data ) {
      var $rows = $(data).find(".agMovieSet.agMovieTable tr:not(:first)");
      $.each($rows, function(i,v){
        var name = $(v).find('.mdpLink').text().trim();
        var url = $(v).find('.mdpLink').attr('href');
        var rating = $(v).find('.stbrMaskFg.sbmfrt').text().split(':')[1].trim();
        console.log('\t' + rating + '\t' + name + '\t' + url);
      });
    },
    async: false
  });
};

for (var i=1; i <= pages; i++) printRatings(i);

5. After couple of seconds(depending on how many ratings you have), you will see all the movies and their ratings are displayed on your console in sorter order!
6. Copy and paste the tab separated results into a spreadsheet. (I use Google Docs)

Here is the 1 minute video to demo this snippet





That's it! You have your ratings, now you can go and cancel your subscription :)

* Use this script at your own risk.

Comments

TQuizzle said…
I keep getting the following error:

function (e, t) {return new it.fn.init(e,t);}
Anonymous said…
Netflix keeps things moving, so none of these ever last very long. Since you just asked days ago, though, maybe you'll see this. Before you run it, log in and go to www.netflix.com/MoviesYouveSeen, and scroll all the way to the bottom of 'infinite page', so that it can scrape all of your ratings.

The directions are basically the same as Sarp's, just run it a browser console, and you should get tab-separated output that you can paste in a spreadsheet.


// netflix export script
var film = '';
var rate_date = '';
var title = '';
var rating = '';

$('div#ratingHistorySection').find('li').each(function(){

film = $(this);
rate_date = $(film).find('.date').html();
title = $(film).find('.title a').html();
rating = $(film).find('.starbar').data('your-rating');

if (rating != '-3') { // exclude 'not interesteds'
console.log('\t' + title + '\t' + rating + '\t' + rate_date);
}

});
Anonymous said…
Thanks for this script. I ran into a problem in that it won't scrape all of ratings. It seems to skip to the bottom 25% and just ignore the first few hundred (or so) ratings.
Anonymous said…
Awesome script. I was curious if an import script to netflix could work similarly?
Anonymous said…
In the console, the following error appears for the first 5 lines. The script stops running.
[Report Only] Refused to execute a script for an inline event handler because 'unsafe-inline' does not appear in the script-src directive of the Content Security Policy.

Popular posts from this blog

Space Character Problem on IE 6, 7, and 8

Configure hosts File in Android

Does Netflix work on iOS 5 Beta 4?