LOL! +1 for lack of code, yet it works (I guess?).
Why did you make this bot btw?
It works. Phage and I were playing with it last night. Cinch is a domain specific language for writing IRC bots. Much less painful than working with sockets.
Someone else has a bot called 'randomcat' which does essentially the same thing but doesn't have as many cats. I wrote this because 1) I wanted moar cats 2) I heard about Cinch but hadn't had a chance to use it.
I'm working on a second version that also posts cat facts and calls the cat picture API more efficiently. I think I can also integrate more services.
Also, 200th post.
EDIT: updated catbot and is now longer. Here's v1.0 for those wondering why Kulver thought it was small:
# cat.rb
# IRC bot to post cats.
# Author: Fur
# Date: 22 Oct 2014
require 'open-uri'
require 'nokogiri'
require 'cinch'
def get_random_cat
doc = Nokogiri(open("http://thecatapi.com/api/images/get?format=xml&results_per_page=1&type=jpg,png?size=full"))
doc.xpath("//url")[0].content
end
bot = Cinch::Bot.new do
configure do |c|
c.server = "irc.evilzone.org"
c.channels = ["#evilzone"]
c.nick = "catbot"
end
on :message, "!cat" do |m|
m.reply get_random_cat
end
end
bot.start