Skip to content

Instantly share code, notes, and snippets.

@ysr23
Created November 4, 2011 18:50
Show Gist options
  • Save ysr23/1340146 to your computer and use it in GitHub Desktop.
Save ysr23/1340146 to your computer and use it in GitHub Desktop.
@film = Film.find(:all).each do |f|
#if Film_imdb.exists?(['title = ?', (f.title)]) then
imdb_search = Imdb::Search.new(f.title)
link = imdb_search.movies.first.url
poster = imdb_search.movies.first.poster
length = imdb_search.movies.first.length
rating = imdb_search.movies.first.rating
plot = imdb_search.movies.first.plot
year = imdb_search.movies.first.year
imdb_title = imdb_search.movies.first.title
tagline = imdb_search.movies.first.tagline
f.update_attributes :IMDBurl => link, :poster => poster, :length => length, :rating => rating, :plot => plot, :year => year, :imdb_title => imdb_title, :tagline => tagline
#end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment