|
@@ -1,6 +1,7 @@
|
|
|
# coding: utf-8
|
|
|
require 'cinch'
|
|
|
require 'marky_markov'
|
|
|
+require 'open-uri'
|
|
|
|
|
|
class ToniNegri
|
|
|
include Cinch::Plugin
|
|
@@ -91,6 +92,46 @@ class Vergogna
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+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
|
|
|
+
|
|
|
+class Thegamer
|
|
|
+ include Cinch::Plugin
|
|
|
+
|
|
|
+ match /thegamer/
|
|
|
+
|
|
|
+ def execute(m)
|
|
|
+ m.reply ["ahahahahahaha", "sistemistahahahahah"].sample
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+class Roll
|
|
|
+ include Cinch::Plugin
|
|
|
+
|
|
|
+ match /roll/
|
|
|
+
|
|
|
+ def execute(m)
|
|
|
+ m.reply rand(1..6)
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
logger = File.open("./logs.txt", 'a+')
|
|
|
markov = MarkyMarkov::TemporaryDictionary.new
|
|
|
markov.parse_file './logs.txt'
|
|
@@ -100,7 +141,7 @@ bot = Cinch::Bot.new do
|
|
|
c.server = "irc.mufhd0.net"
|
|
|
c.nick = "TubiaBot"
|
|
|
c.channels = ["#indivia"]
|
|
|
- c.plugins.plugins = [Caffe, ToniNegri, Amici, JS, Salvino, Jops, Qup, Vergogna]
|
|
|
+ c.plugins.plugins = [Caffe, ToniNegri, Amici, JS, Salvino, Jops, Qup, Vergogna, Film, Thegamer, Roll]
|
|
|
end
|
|
|
end
|
|
|
|