Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

subscribers are unique now

  • Loading branch information...
commit 8037c8e10e4c2188cbb20e53955a609ee1aa9f6c 1 parent 3a26c4a
Julio Capote authored
Showing with 12 additions and 1 deletion.
  1. +9 −0 views/index.erb
  2. +3 −1 watercoolr.rb
View
9 views/index.erb
@@ -1,3 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head><title>Watercoolr - Gossip for web applications</title>
+<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>
@@ -19,3 +26,5 @@ you &rarr; POST /messages data={ 'channel':'2d0128d', 'message':'hey guys!' }
</pre>
<a href="http://www.github.com/jcapote/watercoolr">Watercoolr source</a>
+</body>
+</html>
View
4 watercoolr.rb
@@ -50,7 +50,9 @@ def gen_id
url = data['url'] || nil
if rec = DB[:channels].filter(:name => channel_name).first
if url and rec[:id]
- res = DB[:subscribers] << { :channel_id => rec[:id], :url => url }
+ unless DB[:subscribers].filter(:channel_id => rec[:id], :url => url)
+ res = DB[:subscribers] << { :channel_id => rec[:id], :url => url }
+ end
end
end
if res
Please sign in to comment.
Something went wrong with that request. Please try again.