end
def grab_info(info, body)
- /<div class="info">\s+<h5>#{info}:<\/h5>\s+(.*?)<\/div>/mi.match(body)[1] rescue nil
+ /<div (?:id="\S+-info" )?class="info">\s+<h5>#{info}:<\/h5>\s+(.*?)<\/div>/mi.match(body)[1] rescue nil
end
def fix_article(org_tit)
country = data.ircify_html.gsub(' / ','/')
end
- info << [title, "(#{country}, #{date})", extra, dir ? "[#{dir}]" : nil, opts[:nourl] ? nil : ": http://us.imdb.com#{sr}"].compact.join(" ")
+ info << [title, "(#{country}, #{date})", extra, dir ? "[#{dir}]" : nil, opts[:nourl] ? nil : ": http://www.imdb.com#{sr}"].compact.join(" ")
return info if opts[:title_only]
end
ratings = "no votes"
- m = /<b>([0-9.]+)\/10<\/b>\n?\r?\s+<small>\(<a href="ratings">([0-9,]+) votes?<\/a>\)<\/small>/.match(resp.body)
+ m = /<b>([0-9.]+)\/10<\/b>\n?\r?\s+[^<]+<a href="ratings"[^>]+>([0-9,]+) votes?<\/a>/.match(resp.body)
if m
ratings = "#{m[1]}/10 (#{m[2]} voters)"
end
name = m[1]
info << "#{name}"
- info << " : http://us.imdb.com#{sr}" unless opts[:nourl]
+ info.last << " : http://www.imdb.com#{sr}" unless opts[:nourl]
return info if opts[:name_only]
end
# Find the movies with a participation of :who in the year :year
- # TODO: allow year to be either a year or a decade ('[in the] 1960s')
+ # TODO: allow year to be either a year or a decade ('[in the] 1960s')
#
def movies(m, params)
who = params[:who].to_s