19 рядки
445 Б
Ruby
19 рядки
445 Б
Ruby
class Film
|
|
include Cinch::Plugin
|
|
|
|
match /film/
|
|
|
|
def execute(m)
|
|
loop do
|
|
if open("http://www.imdb.com/random/title").read =~ /<title>(.*?) (\(.*?\)) - 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
|