+ info = "#{title} : http://us.imdb.com#{sr}\n"
+ info << "Ratings: #{score}/10 (#{votes} voters). Genre: #{genre.join('/')}\n"
+ info << plot if plot
+ return info
+ end
+ return nil
+ end
+
+ def info_name(sr)
+ resp = nil
+ begin
+ resp = @bot.httputil.get_response('http://us.imdb.com' + sr,
+ :max_redir => -1)
+ rescue Exception => e
+ error e.message
+ warning e.backtrace.join("\n")
+ return nil
+ end
+
+ if resp.code == "200"
+ m = /<title>([^<]*)<\/title>/.match(resp.body)
+ return nil if !m
+ name = Utils.decode_html_entities(m[1])
+
+ birth = nil
+ data = grab_info("Date of Birth", resp.body)
+ if data
+ birth = "Birth: #{data.ircify_html.gsub(/\s+more$/,'')}"
+ end
+
+ death = nil
+ data = grab_info("Date of Death", resp.body)
+ if data
+ death = "Death: #{data.ircify_html.gsub(/\s+more$/,'')}"
+ end
+
+ movies = {}
+
+ filmorate = nil
+ begin
+ filmorate = @bot.httputil.get("http://us.imdb.com" + sr + "filmorate")
+ rescue Exception
+ end
+
+ if filmorate
+ filmorate.scan(/<div class="filmo">.*?<a href="\/title.*?<\/div>/m) { |str|
+ what = str.match(/<a name="[^"]+">([^<]+)<\/a>/)[1] rescue nil
+ # next unless what
+ next unless ['Actor', 'Director'].include?(what)
+ movies[what] = str.scan(/<a href="\/title\/[^"]+">([^<]+)<\/a>/)[0..2].map { |tit|
+ Utils.decode_html_entities(tit)
+ }
+ }
+ end
+ debug movies.inspect
+
+ info = "#{name} : http://us.imdb.com#{sr}\n"
+ info << [birth, death].compact.join('. ') << "\n"
+ unless movies.empty?
+ info << "Top Movies:: "
+ ar = []
+ movies.keys.sort.each { |key|
+ ar << key.dup
+ ar.last << ": " + movies[key].join(', ')
+ }
+ info << ar.join('. ')
+ end
+ return info
+