STIW3 - IMDB's Top 20 Worst Actors
Published 2007-03-29 @ 13:01
Tagged ruby, toys
Episode 3 of the “Stupid Thing I Wrote”, figure out the worst actors on IMDB:
- 194 Paris Hilton (The Hillz, Bottoms Up)
- 183 Jim Varney (Snowboard Academy, 3 Ninjas: High Noon at Mega Mountain)
- 177 Hulk Hogan (Santa with Muscles, 3 Ninjas: High Noon at Mega Mountain)
- 174 Kal Penn (Son of the Mask, Epic Movie, Van Wilder 2: The Rise of Taj)
- 171 Clint Howard (Santa with Muscles, House of the Dead)
- 168 Jack McGee (Chairman of the Board, Cool as Ice)
- 164 Corey Haim (Snowboard Academy, Last Resort)
- 162 Deezer D (In the Mix, Cool as Ice)
- 159 Gary Anthony Sturgis (Daddy’s Little Girls, Pride)
- 157 Myles Fitzgerald (SuperBabies: Baby Geniuses 2, Baby Geniuses) / Gerry Fitzgerald (SuperBabies: Baby Geniuses 2, Baby Geniuses) / Leo Fitzgerald (SuperBabies: Baby Geniuses 2, Baby Geniuses) / Will Sanderson (House of the Dead, Alone in the Dark, BloodRayne)
- 153 Gabrielle Union (Daddy’s Little Girls, The Honeymooners)
- 151 Terrence Howard (Glitter, Pride)
- 150 Valarie Pettiford (Glitter, Stomp the Yard) / Jack Warden (Chairman of the Board, Ed) / Mickey Knox (Ghosts Can’t Do It, Bolero, Ghoulies II)
- 142 Kevin Smith (Bottoms Up, Doogal)
- 138 Jürgen Prochnow (House of the Dead, Primeval)
- 136 Meagan Good (Stomp the Yard, You Got Served)
- 127 Bo Derek (Ghosts Can’t Do It, Bolero)
- 123 Victor Wong (3 Ninjas: High Noon at Mega Mountain, Shanghai Surprise)
- 116 Jon Polito (The Honeymooners, Happily N’Ever After)
- 110 Billy Zane (Going Overboard, BloodRayne)
code after the cut.
It makes me sad that “You Got Served” is no longer the worst movie on IMDB. (I’ll release webcache later, you can get this working just fine without caching–not that you want to)
require 'rubygems'
require 'hpricot'
require 'webcache'
$max = (ARGV.shift || 10).to_i class IMDB < WebCache
def initialize
super ".imdbcache", "ryand-ruby@zenspider.com Ruby/#{RUBY_VERSION}", 999
@base = "http://www.imdb.com"
end
def bottom
c = cache("imdb", "bottom") do
get File.join(@base, "chart/bottom")
end
doc = Hpricot(c)
(doc/"a").select { |a| a.attributes['href'] =~ /title.tt/ }.map { |a|
[a.attributes['href'], a.children.first.content]
}
end
def movie(url)
n = url[/\d+/]
c = cache("movie", n) do
t = get File.join(@base, url)
sleep 1
t
end
fragment = c[/^.*(?:Cast overview|[Cc]redited cast).*fullcredits.*$/]
begin
doc = Hpricot(fragment)
rescue => e
p e.message, fragment
puts c
exit 1
end
(doc/"a").select { |a| a.attributes['href'] =~ /name.nm/ and Hpricot::Text === a.children.first }.map { |a|
[a.attributes['href'], a.children.first.content]
}
end
def worst
movie_names = {}
actor_names = {}
movies = Hash.new { |h,k| h[k] = [] }
scores = Hash.new(0)
bottom.each_with_index do |(movie_url, movie_name), i|
movie_names[movie_url] = movie_name
score = 100 - i
m = movie(movie_url)
m.each do |actor_url, actor_name|
movies[actor_url] << movie_url
actor_names[actor_url] = actor_name unless actor_names.has_key? actor_url
scores[actor_url] += score
end
end
by_scores = Hash.new { |h,k| h[k] = [] }
scores.each do |actor_url, score|
s = "%s (%s)" % [actor_names[actor_url], movies[actor_url].map { |url| movie_names[url]}.join(", ")]
by_scores[score] << s
end
puts "Top #{$max} worst actors"
puts
by_scores.sort_by {|score,x| -score}.first($max).each_with_index do |(score, actors), i|
n = i + 1
puts "%2d) %3d %s" % [n, score, actors.join("\n ")]
end
end
end
imdb = IMDB.new
imdb.worst