Skip to content

Instantly share code, notes, and snippets.

@mpcoding
Created October 20, 2013 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpcoding/60a1115238d0b0075c35 to your computer and use it in GitHub Desktop.
Save mpcoding/60a1115238d0b0075c35 to your computer and use it in GitHub Desktop.
namespace :db do
require 'open-uri'
require 'rubygems'
require 'ruby-tmdb3'
task :pull_tmdb_data => :environment do
Tmdb.api_key = "API_KEY"
results = Tmdb.api_call(
"discover/movie",
{
page: 1,
sort_by: 'release_date.asc'
},
"en"
)
results.map!{|m| TmdbMovie.new(m, true)} # `true` tells TmdbMovie.new to expand results
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment