<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/irc_cat/http_server/github.rb</filename>
    </added>
    <added>
      <filename>lib/irc_cat/http_server/send.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -11,7 +11,10 @@ http:
   enabled: true
   host: 0.0.0.0
   port: '3489'
+  # Enable post-receive stuff from Github
   github: true
+  # Allow send with http
+  send: true
 
 # TCP Server
 </diff>
      <filename>config.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,43 +1,13 @@
 # The HTTP Server
 
 require 'mongrel'
-require 'json'
-require 'json/add/rails'
+require 'lib/irc_cat/http_server/send' if @config['http']['send'] == true
+require 'lib/irc_cat/http_server/github' if @config['http']['github'] == true
 
 class Index &lt; Mongrel::HttpHandler
   def process(request, response)
     response.start(200) do |head,out|
       head[&quot;Content-Type&quot;] = &quot;text/html&quot;
-      out.write(&quot;&lt;strong&gt;Welcome to irc_cat&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This irc_cat is ready to use:) Just send a GET to : &lt;code&gt;/send/your message&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;byekthx&quot;)
-    end
-  end
-end
-
-class Send &lt; Mongrel::HttpHandler
-
-  def initialize(bot, config); @bot = bot; @config = config; end
-
-  def process(request, response)
-    response.start(200) do |head,out|
-      head[&quot;Content-Type&quot;] = &quot;text/plain&quot;
-      message = CGI::unescape(&quot;#{request.params['PATH_INFO'].gsub('/','')}&quot;)
-      @bot.say(@config['irc']['channel'],&quot;#{message}&quot;)
-    end
-  end
-end
-
-class Github &lt; Mongrel::HttpHandler
-  
-  def initialize(bot, config); @bot = bot; @config = config; puts &quot;Github enabled&quot;; end
-  
-  def process(request, response)
-    response.start(200) do |head,out|
-      head[&quot;Content-Type&quot;] = &quot;text/plain&quot;
-      post = CGI.parse(request.body.read)
-      json = JSON.parse(post['payload'].join(','))
-      json['commits'].each do |c|
-        @bot.say(@config['irc']['channel'],&quot;[#{json['repository']['name']}] New commit by #{c.last['author']['name']} : #{c.last['message'].gsub(/\n(.*)/, '...')} - #{c.last['url']}&quot;)
-      end
     end
   end
 end
@@ -50,7 +20,7 @@ module IrcCat
       puts &quot;Starting HTTP (#{ip}:#{port})&quot;
       h = Mongrel::HttpServer.new(ip, port)
       h.register(&quot;/&quot;, Index.new)
-      h.register(&quot;/send&quot;, Send.new(@bot, @config))
+      h.register(&quot;/send&quot;, Send.new(@bot, @config)) if @config['http']['send'] == true
       h.register(&quot;/github&quot;, Github.new(@bot, @config)) if @config['http']['github'] == true
       h.run.join
     end</diff>
      <filename>lib/irc_cat/http_server.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9ece269782343746239ab2ea539702f1360a316e</id>
    </parent>
  </parents>
  <author>
    <name>Jordan Bracco</name>
    <email>jordan@bracco.name</email>
  </author>
  <url>http://github.com/webs/irccat/commit/36ea4ff49b41e582b383313019314be52df7da47</url>
  <id>36ea4ff49b41e582b383313019314be52df7da47</id>
  <committed-date>2008-02-16T19:01:35-08:00</committed-date>
  <authored-date>2008-02-16T19:01:35-08:00</authored-date>
  <message>Switched Send and Github class into different files. Now can disable http Send, removed http index</message>
  <tree>25017cbb21ed68670cf2d1686765a0dd5342643b</tree>
  <committer>
    <name>Jordan Bracco</name>
    <email>jordan@bracco.name</email>
  </committer>
</commit>
