Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

asd

  • Loading branch information...
commit 9d37fa9416f2be1c1082ce59bb0efa9ec41ae0b0 1 parent 8037c8e
Julio Capote authored
Showing with 33 additions and 9 deletions.
  1. +32 −8 views/index.erb
  2. +1 −1  watercoolr.rb
View
40 views/index.erb
@@ -5,26 +5,50 @@
<link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" />
</head>
<body>
-<h1>Watercoolr</h1>
-<strong>pubsub via webhooks, or "twitter" for your applications</strong>
-
-<h3>Example:</h3>
-<pre><strong>Create a channel:</strong>
+<div id="wrapper">
+<div class="generic twoforty">
+<img src="/images/cooler.jpg"/>
+</div>
+<div class="generic seventsixty">
+ <h1>Watercoolr</h1>
+ <strong class="tagline">pubsub via webhooks, or "twitter" for your applications</strong>
+<br/>
+<br/>
+<div class="example">
+<h4>Example:</h4>
+<strong>Create a channel:</strong>
+<pre>
&rarr; POST /channels
&larr; { 'id':'2d0128d' }
-
+</pre>
+<br/>
<strong>Add subscribers:</strong>
+<pre>
&rarr; POST /subscribers data={ 'channel':'2d0128d', 'url':'http://api.otherservice.com/your-message-handler' }
&larr; { 'status': 'OK' }
-
+</pre>
+<br/>
<strong>Post messages:</strong>
+<pre>
you &rarr; POST /messages data={ 'channel':'2d0128d', 'message':'hey guys!' }
us &rarr; POST http://api.otherservice.com/your-message-handler data='hey guys!'
...for every subscriber...
&larr; { 'status': 'OK' }
-
</pre>
+<br/>
<a href="http://www.github.com/jcapote/watercoolr">Watercoolr source</a>
+</div>
+</div>
+</div>
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-297284-19");
+pageTracker._trackPageview();
+} catch(err) {}</script>
</body>
</html>
View
2  watercoolr.rb
@@ -50,7 +50,7 @@ def gen_id
url = data['url'] || nil
if rec = DB[:channels].filter(:name => channel_name).first
if url and rec[:id]
- unless DB[:subscribers].filter(:channel_id => rec[:id], :url => url)
+ unless DB[:subscribers].filter(:channel_id => rec[:id], :url => url).first
res = DB[:subscribers] << { :channel_id => rec[:id], :url => url }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.