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)
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
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