Created
January 25, 2013 21:51
-
-
Save nhunzaker/4638219 to your computer and use it in GitHub Desktop.
No JavaScript Tracking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
set :public_folider, './public' | |
count = 0 | |
get '/' do | |
erb :index, :locals => { :count => count } | |
end | |
get '/track' do | |
count += 1 | |
redirect to("/images/nojs.gif") | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './app.rb' | |
run Sinatra::Application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'sinatra' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Number of visitors without JavaScript: <%= count %></p> | |
<noscript> | |
<img src="/track" width="0" height="0" /> | |
</noscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment