class Film include Cinch::Plugin match /film/ def execute(m) loop do if open("http://www.imdb.com/random/title").read =~ /(.*?) (\(.*?\)) - IMDb<\/title>/ title = $1.gsub(""","\"").split if title.count > 1 #title[title.count - 1] = "Tubia" title[rand(0...title.count)] = "Tubia" m.reply title.join(' ') break end end end end end