+
+ plot = nil
+ data = grab_info(/Plot (?:Outline|Summary)/, resp.body)
+ if data
+ plot = "Plot: " + data.ircify_html.gsub(/\s+more$/,'')
+ end
+
+ info << ["Ratings: " << ratings, "Genre: " << genre.join('/') , plot].compact.join(". ")
+
+ return info
+ end
+ return nil
+ end
+
+ def info_name(sr)
+ resp = nil
+ begin
+ resp = @bot.httputil.get_response(IMDB + sr, :max_redir => -1)
+ rescue Exception => e
+ error e.message
+ warning e.backtrace.join("\n")
+ return nil
+ end
+
+ info = []
+
+ if resp.code == "200"
+ m = /<title>([^<]*)<\/title>/.match(resp.body)
+ return nil if !m
+ name = m[1]
+
+ info << "#{name} : http://us.imdb.com#{sr}"
+
+ 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
+
+ info << [birth, death].compact.join('. ') if birth or death
+
+ movies = {}
+
+ filmorate = nil
+ begin
+ filmorate = @bot.httputil.get(IMDB + 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
+ movies[what] = str.scan(TITLE_MATCH)[0..2].map { |url, tit|
+ tit
+ }
+ }
+ end
+
+ preferred = ['Actor', 'Director']
+ if resp.body.match(/Jump to filmography as: (.*?)<\/div>/)
+ txt = $1
+ preferred = txt.scan(/<a[^>]+>([^<]+)<\/a>/)[0..2].map { |pref|
+ pref.first
+ }
+ end
+
+ unless movies.empty?
+ all_keys = movies.keys.sort
+ debug all_keys.inspect
+ keys = []
+ preferred.each { |key|
+ keys << key if all_keys.include? key
+ }
+ keys = all_keys if keys.empty?
+ ar = []
+ keys.each { |key|
+ ar << key.dup
+ ar.last << ": " + movies[key].join('; ')
+ }
+ info << ar.join('. ')
+ end
+ return info
+