Skip to content

Commit

Permalink
add schneier facts plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwand committed Aug 18, 2010
1 parent 3e3a0ec commit 5cbfc3e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions plugins/bruce.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'open-uri'
require 'hpricot'
require 'tempfile'

class Bruce < CampfireBot::Plugin
on_command 'bruce', :fail

def fail(msg)
# Scrape random fail
fail = (Hpricot(open('http://www.schneierfacts.com/'))/'p.fact').first
msg.speak(fail.inner_html)
rescue => e
msg.speak e
end
end

0 comments on commit 5cbfc3e

Please sign in to comment.