Skip to content

Commit

Permalink
Adding !commit command to answer with commit messages generated at ht…
Browse files Browse the repository at this point in the history
  • Loading branch information
manveru committed Oct 12, 2010
1 parent abea14a commit 9a9e42f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/mathetes/plugins/whatthecommit.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'open-uri'
require 'nokogiri'

module Mathetes
module Plugins
class Commit
def initialize(mathetes)
mathetes.hook_privmsg(:regexp => /^!commit\b/) do |msg|
open 'http://whatthecommit.com/' do |io|
msg.answer Nokogiri::HTML(io).css('#content > p').text.strip
end
end
end
end
end
end

0 comments on commit 9a9e42f

Please sign in to comment.