Skip to content

Commit

Permalink
Failed youtube example
Browse files Browse the repository at this point in the history
  • Loading branch information
raggi committed Nov 13, 2009
1 parent 5897626 commit 372c24c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions examples/youtube.bot
@@ -0,0 +1,22 @@
abort "bzzzt, known broken atm"

require 'youtube'

class YouTube
attr_accessor :client

def initialize
@toobes = YouTube::Client.new(File.read(ENV['HOME'] + '/.youtube').strip)
end

def on_message(sender, content, event)
return if sender['name'] == 'bot'
case content
when /(.*) on youtube/
@toobes.search(:query => $1)
client.send_message "Hi #{sender['name']}!"
end
end
end

use YouTube.new

0 comments on commit 372c24c

Please sign in to comment.