Skip to content
Browse files

fix zlib error on GAE

  • Loading branch information...
1 parent cb53240 commit 7f3d3a03897b591cabc65daebb735ce6b9de2586 @igrigorik committed Sep 23, 2009
Showing with 8 additions and 15 deletions.
  1. +1 −1 config.ru
  2. +4 −10 views/index.erb
  3. +3 −4 watercoolr.rb
View
2 config.ru
@@ -2,7 +2,7 @@ require 'appengine-rack'
AppEngine::Rack.configure_app(
:application => 'watercoolr',
- :version => 1
+ :version => 3
)
require 'watercoolr.rb'
View
14 views/index.erb
@@ -12,6 +12,8 @@
<div class="generic seventsixty">
<h1>Watercoolr</h1>
<strong class="tagline">pubsub via webhooks, or "twitter" for your applications</strong>
+
+ <p>This is a public server, feel free to use it to power your own HTTP pubsub services!</p>
<br/>
<br/>
<div class="example">
@@ -36,18 +38,10 @@ you &rarr; POST /messages data={ 'channel':'2d0128d', 'message':'hey guys!' }
&larr; { 'status': 'OK' }
</pre>
<br/>
-<h4>Run it <a href="http://www.github.com/jcapote/watercoolr">locally</a> on your own server, or using http://watercoolr.nuklei.com</h4>
+<h4>This server is powered by <a href="http://github.com/igrigorik/watercoolr">modified GAE version</a> of <a href="http://www.github.com/jcapote/watercoolr">watercoolr service</a>.</h4>
</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
7 watercoolr.rb
@@ -1,6 +1,5 @@
require 'rubygems'
require 'sinatra'
-require 'zlib'
require 'json/pure'
require 'uri'
require 'dm-core'
@@ -25,9 +24,9 @@ class Subscriber
helpers do
def gen_id
- base = rand(100000000).to_s
- salt = Time.now.to_s
- Zlib.crc32(base + salt).to_s(36)
+ base = rand(100000000)
+ salt = Time.now.to_i
+ (base + salt).to_s
end
end

0 comments on commit 7f3d3a0

Please sign in to comment.
Something went wrong with that request. Please try again.