Skip to content
This repository has been archived by the owner on Oct 9, 2022. It is now read-only.

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sorens committed Dec 21, 2011
0 parents commit eb498f1
Show file tree
Hide file tree
Showing 103 changed files with 2,540 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.bundle
db/*.sqlite3
db/*.sqlite3-journal
log/*.log
tmp/**/*
tmp/*
.DS_Store
.idea
local/*
.rvmrc*
.redcar/*
.dropbox
Icon*
.powrc
.powenv
config/overrides/*
40 changes: 40 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
source 'http://rubygems.org'

gem 'rails', '3.1.0'
gem "rack-timeout"
gem 'pg'
gem 'rake'
gem 'jquery-rails'
gem 'rest-client'
gem 'nokogiri'
gem 'oauth'
gem 'delayed_job_active_record'
gem 'activeadmin'
gem 'meta_search', '>= 1.1.0.pre'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', " ~> 3.1.0"
gem 'coffee-rails', "~> 3.1.0"
gem 'uglifier'
gem 'less-rails-bootstrap', "~> 1.4.0"
end

group :test do
# Pretty printed test output
gem 'turn', :require => false
end

group :production do
gem 'workless'
end
212 changes: 212 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.0)
actionpack (= 3.1.0)
mail (~> 2.3.0)
actionpack (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.0.3)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.0)
activeadmin (0.3.4)
devise (>= 1.1.2)
fastercsv
formtastic (< 2.0.0)
inherited_resources (< 1.3.0)
kaminari (>= 0.12.4)
meta_search (>= 0.9.2)
rails (>= 3.0.0)
sass (>= 3.1.0)
activemodel (3.1.0)
activesupport (= 3.1.0)
bcrypt-ruby (~> 3.0.0)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
activesupport (3.1.0)
multi_json (~> 1.0)
addressable (2.2.6)
ansi (1.4.1)
arel (2.2.1)
bcrypt-ruby (3.0.1)
builder (3.0.0)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.3)
commonjs (0.2.0)
therubyracer (~> 0.9.9)
daemons (1.0.10)
delayed_job (3.0.0.pre4)
activesupport (~> 3.0)
daemons (= 1.0.10)
delayed_job_active_record (0.2.1)
activerecord (> 2.1.0)
delayed_job (~> 3.0.0.pre)
devise (1.5.2)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
warden (~> 1.1)
erubis (2.7.0)
execjs (1.2.12)
multi_json (~> 1.0)
fastercsv (1.5.4)
fattr (2.2.0)
formtastic (1.2.4)
actionpack (>= 2.3.7)
activesupport (>= 2.3.7)
i18n (~> 0.4)
has_scope (0.5.1)
heroku (2.17.0)
launchy (>= 0.3.2)
rest-client (~> 1.6.1)
rubyzip
term-ansicolor (~> 1.0.5)
hike (1.2.1)
i18n (0.6.0)
inherited_resources (1.2.2)
has_scope (~> 0.5.0)
responders (~> 0.6.0)
jquery-rails (1.0.19)
railties (~> 3.0)
thor (~> 0.14)
json (1.6.3)
kaminari (0.12.4)
rails (>= 3.0.0)
launchy (2.0.5)
addressable (~> 2.2.6)
less (2.0.8)
commonjs (~> 0.2.0)
therubyracer (~> 0.9.9)
less-rails (2.0.1)
actionpack (~> 3.1.0)
less (~> 2.0.7)
railties (~> 3.1.0)
less-rails-bootstrap (1.4)
less-rails (~> 2.0.0)
libv8 (3.3.10.4)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
meta_search (1.1.1)
actionpack (~> 3.1.0)
activerecord (~> 3.1.0)
activesupport (~> 3.1.0)
polyamorous (~> 0.5.0)
mime-types (1.17.2)
multi_json (1.0.4)
nokogiri (1.5.0)
oauth (0.4.5)
orm_adapter (0.0.5)
pg (0.12.0)
rake-compiler (~> 0.7)
polyamorous (0.5.0)
activerecord (~> 3.0)
polyglot (0.3.3)
rack (1.3.5)
rack-cache (1.0.3)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rack-timeout (0.0.3)
rails (3.1.0)
actionmailer (= 3.1.0)
actionpack (= 3.1.0)
activerecord (= 3.1.0)
activeresource (= 3.1.0)
activesupport (= 3.1.0)
bundler (~> 1.0)
railties (= 3.1.0)
railties (3.1.0)
actionpack (= 3.1.0)
activesupport (= 3.1.0)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rake-compiler (0.7.9)
rake
rdoc (3.12)
json (~> 1.4)
responders (0.6.4)
rest-client (1.6.7)
mime-types (>= 1.16)
rubyzip (0.9.5)
rush (0.6.7)
session
sass (3.1.12)
sass-rails (3.1.5)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (~> 3.1.10)
tilt (~> 1.3.2)
session (3.1.0)
fattr
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
term-ansicolor (1.0.7)
therubyracer (0.9.9)
libv8 (~> 3.3.10)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
turn (0.8.3)
ansi
tzinfo (0.3.31)
uglifier (1.2.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
warden (1.1.0)
rack (>= 1.0)
workless (0.0.1)
heroku
rush

PLATFORMS
ruby

DEPENDENCIES
activeadmin
coffee-rails (~> 3.1.0)
delayed_job_active_record
jquery-rails
less-rails-bootstrap (~> 1.4.0)
meta_search (>= 1.1.0.pre)
nokogiri
oauth
pg
rack-timeout
rails (= 3.1.0)
rake
rest-client
sass-rails (~> 3.1.0)
turn
uglifier
workless
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
ratings exporter for Netflix
============================

What
----

This service was born of my desire to quit Netflix but without having to lose all that info on what I've watched and what I've rated. To that end, I started investigating the [Netflix API](http://developer.netflix.com). While the API doesn't have exactly what I wanted (e.g. fetch all my rated movies), it was able supply enough functionality for me to fetch ratings for all the movies I had rented/streamed. Good enough, I suppose. Since collecting that information from Netflix takes time, I created a web service which would spawn <code>delayed_jobs</code> to do the work.

To get started with your own export, click the <em>Authorize</em> button above, fill in your Netflix credential (note: we use Netflix's OAuth API. See the next section for more details), and this service will be begin exporting your Netflix DVD and Instant rental queue data for you. Once all of the records have been exported, you'll be able to download the data as a blob of <code>json</code>.

Thanks to [Christopher Cotton](http://blog.christophercotton.com/) for answering my [Netflix OAuth question on Stack Overflow](http://stackoverflow.com/a/8516022/349423)!

<p>If you would like to help keep this service running, please donate!</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<fieldset>
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="HMZ2WP3MK36QN">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" class="btn large" style="width: 74px;">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</fieldset>
</form>


Secure
------

Our service is never given your Netflix credentials. We are using the [Netflix OAuth API](http://developer.netflix.com/docs/read/Security), which means you are only authorizing this web app to make requests on your behalf.

We do store a few pieces of Netflix OAuth data in your cookies, including your Netflix <code>user_id</code> so that you do not have to keep re-authorizing the web app if you want to use it more than once. When you are done using this service, you can click the sign out link in the toolbar and we'll flush that information from your cookies.

Your exported rating information is stored in our database for short, indeterminate amount of time, after which it is permanently expunged during recurring, routine maintenance.

This data is available to only you.

Good news, Bad news
-------------------

<p>The bad news is that this service is only using one web dyno and one worker process. So, it is going to be slow. The good news is, this service is free!</p>
<p>Even more good news, the code for this service is available on [Github](https://github.com/sorens/ratings_exporter). Feel free to inspect it to ensure that we're not doing anything untoward with your data.</p>
<p>Netflix does limit the number of requests to 5,000 per user per day. I figured this out after I had architected the service to make a single request per title to fetch your ratings. There is a way to request several ratings in a batch, but I haven't got back and retrofitted the service to do that yet. If you have more than 5,000 movies in your rental history, then it will take you a few days to export your entire history. If you hit the 5,000 limit, you can come back to this service tomorrow and there will be a <em>Continue</em> button which will allow you to continue processing your export where you left off. If you want to skip the remaining exports, you can click the <em>Ignore</em> button instead. At which point, you will be able to download your data.


Format of the JSON
------------------
<pre>
{
"60010377": {
"id": "60010377",
"title": "Funny Girl",
"year": "1968",
"url": "http://api.netflix.com/catalog/titles/movies/60010377",
"rating": "4.0",
"type": "streamed",
"viewed_date": "2011-12-05T09:03:48Z"
},
"70102614": {
"id": "70102614",
"title": "Dead Like Me: Season 1: \"Reaping Havoc\"",
"year": "2003",
"url": "http://api.netflix.com/catalog/titles/programs/70102614",
"rating": "5.0",
"type": "streamed",
"viewed_date": "2009-04-03T17:20:30Z"
}
}
</pre>
<em>note: if we were unable to export a rating for a title due to an error, rating will be set to null. If you never set a rating on a particular title, we set the rating to 0.0.</em>
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)

RatingsExporter::Application.load_tasks
Loading

0 comments on commit eb498f1

Please sign in to comment.