Permalink
Browse files

Failed youtube example

  • Loading branch information...
1 parent 5897626 commit 372c24c5b9a10a948bb73a94b4657f6c3ef57d3d @raggi committed Nov 13, 2009
Showing with 22 additions and 0 deletions.
  1. +22 −0 examples/youtube.bot
View
@@ -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.