<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>hooks.rb</filename>
    </added>
    <added>
      <filename>hooks/ff.rb</filename>
    </added>
    <added>
      <filename>hooks/twitter.rb</filename>
    </added>
    <added>
      <filename>hooks/xmpp.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,3 +2,5 @@ httpclient
 SystemTimer
 messagepub
 crack
+xmpp4r
+xmpp4r-simple</diff>
      <filename>.gems</filename>
    </modified>
    <modified>
      <diff>@@ -54,7 +54,12 @@ configure do
     end
   end 
   # Need to have at least admin user
-  #DB[:users] &lt;&lt; { :name =&gt; 'admin', :password =&gt; 'change_me', :service =&gt; 'self' } 
+  #DB[:users] &lt;&lt; { :name =&gt; 'admin', :password =&gt; 'change_me', :service =&gt; 'self' }
+  # All hooks library URLs will be /hook/:name/:secret/
+  # default secret
+  # DB[:users] &lt;&lt; { :name =&gt; 'all', :password =&gt; 'change_me', :service =&gt; 'hooks' }
+  # secret per hook
+  # DB[:users] &lt;&lt; { :name =&gt; 'ff', :password =&gt; 'change_me_too', :service =&gt; 'hooks' }
 end
 
 helpers do
@@ -93,12 +98,16 @@ helpers do
     subs.each do |sub|
       begin
         raise &quot;No valid URL provided&quot; unless sub[:url]
+        # remove sensitive data for the 'debug' subscribers
+        data = (sub[:type] == 'debug') ? {} : unmarshal(sub[:data])
         MyTimer.timeout(5) do
         # see: http://messagepub.com/documentation/api
           if sub[:type] == 'messagepub'
-            MPubClient.post(sub[:url], msg, unmarshal(sub[:data]))
+            MPubClient.post(sub[:url], msg, data)
           else
-            HTTPClient.post(sub[:url], :payload =&gt; {:message =&gt; msg}.to_json)
+            HTTPClient.post(sub[:url], 
+                            :payload =&gt; {:message =&gt; msg}.to_json,
+                            :data =&gt; data.to_json)
           end
         end
       rescue Exception =&gt; e
@@ -120,6 +129,7 @@ end
 load 'pubs.rb'
 load 'subs.rb'
 load 'superfeedr.rb'
+load 'hooks.rb'
 
 get '/' do
   erb :index
@@ -146,7 +156,7 @@ post '/subscribe' do
     data = JSON.parse(params[:data])
     raise &quot;missing URL in the 'data' parameter&quot; unless url = data['url']
     channel_name = data['channel'] || 'boo'
-    type = data['type'] || 'github'
+    type = data['type'] || 'debug'
     ['url', 'channel', 'type'].each { |d| data.delete(d) }
     rec = DB[:channels].filter(:name =&gt; channel_name).first
     raise &quot;channel #{channel_name} does not exists&quot; unless rec[:id]  </diff>
      <filename>watercoolr.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>997a8f3fae5734b34c75de3ca7ada9d80ca84833</id>
    </parent>
  </parents>
  <author>
    <name>Stoyan Zhekov</name>
    <email>zh@zhware.net</email>
  </author>
  <url>http://github.com/zh/watercoolr/commit/b2624b309fa9bcf933b2c00cd4873a0e0b75e20e</url>
  <id>b2624b309fa9bcf933b2c00cd4873a0e0b75e20e</id>
  <committed-date>2009-07-06T08:24:16-07:00</committed-date>
  <authored-date>2009-07-06T08:24:16-07:00</authored-date>
  <message>small webhooks library - ff, twitter and xmpp</message>
  <tree>2d32ddd70eb0ac8c9f3347dd5aa61ab4f599045b</tree>
  <committer>
    <name>Stoyan Zhekov</name>
    <email>zh@zhware.net</email>
  </committer>
</commit>
