<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>public/application.js</filename>
    </added>
    <added>
      <filename>public/jquery.js</filename>
    </added>
    <added>
      <filename>views/index.haml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -7,7 +7,7 @@ set :repository,  &quot;git://github.com/you/#{application}.git&quot;
 # If you aren't using Subversion to manage your source code, specify
 # your SCM below:
 set :scm, :git
-   
+set :user, :you
 set :ruby_vm_type,      :ree        # :ree, :mri
 set :web_server_type,   :apache     # :apache, :nginx
 set :app_server_type,   :passenger  # :passenger, :mongrel
@@ -23,7 +23,7 @@ role :web, domain
 # If you aren't deploying to /opt/apps/#{application} on the target
 # servers (which is the deprec default), you can specify the actual location
 # via the :deploy_to variable:
-# set :deploy_to, &quot;/opt/apps/#{application}&quot;
+set :deploy_to, &quot;/opt/apps/#{application}&quot;
 
 namespace :deploy do
   task :restart, :roles =&gt; :app, :except =&gt; { :no_release =&gt; true } do</diff>
      <filename>config/deploy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,10 @@
 body {
-	margin-top: 20%;
 	background: #fde181;
 	color: #830000;
-	text-align: center;
 }
 
 body, input {
-  font: 36pt Sans-serif;
+  font: 16pt Sans-serif;
   font-weight:bold;
 }
 
@@ -26,4 +24,29 @@ input#url {
 
 a {
   color: #830000;
+}
+
+.left {
+  text-align: left;
+}
+
+.url {
+  border: 3px solid #c9ad71;
+  margin: 5px;
+  padding: 5px;
+  background: #e1c35e;
+  width: 40em;
+  overflow: none;
+}
+
+.url .original-url {
+  display: block;
+}
+h3, h6 { 
+  padding: 0px;
+  margin: 0px;
+}
+
+.as-seen-on {
+  display: none;
 }
\ No newline at end of file</diff>
      <filename>public/style.css</filename>
    </modified>
    <modified>
      <diff>@@ -5,105 +5,128 @@ require 'sequel'
 
 
 begin
-  database = YAML::load(File.open(&quot;config/database.yml&quot;))
-  if database[&quot;adapter&quot;] == &quot;sqlite&quot; || database[&quot;adapter&quot;] == &quot;sqlite3&quot;
-    DB = Sequel.sqlite('url') unless defined?(DB)
-  elsif database[&quot;adapter&quot;] == &quot;mysql&quot;
-    DB = Sequel.mysql(database[&quot;database&quot;],
-                      :user =&gt; database[&quot;user&quot;] || database[&quot;username&quot;],
-                      :password =&gt; database[&quot;password&quot;],
-                      :host =&gt; database[&quot;host&quot;] || 'localhost') unless defined?(DB)
-  elsif database[&quot;adapter&quot;] == &quot;postgresql&quot; || database[&quot;adapter&quot;] == &quot;postgres&quot;
-    DB = Sequel.connect('postgres://#{database[:user] || database[:username]}:#{database[:password]}@#{database[:host] || &quot;localhost&quot;}/#{database[:database]}') unless defined?(DB)
-  end
-  
-    unless DB.table_exists?(:urls)
-      DB.create_table :urls do
-        primary_key :id
-        column :url, :text
-      end
-    end
-    
-  end
-  $dataset = DB[:urls]
+	database = YAML::load(File.open(&quot;config/database.yml&quot;))
+	if database[&quot;adapter&quot;] == &quot;sqlite&quot; || database[&quot;adapter&quot;] == &quot;sqlite3&quot;
+		DB = Sequel.sqlite('url') unless defined?(DB)
+	elsif database[&quot;adapter&quot;] == &quot;mysql&quot;
+		DB = Sequel.mysql(database[&quot;database&quot;],
+											:user =&gt; database[&quot;user&quot;] || database[&quot;username&quot;],
+											:password =&gt; database[&quot;password&quot;],
+											:host =&gt; database[&quot;host&quot;] || 'localhost') unless defined?(DB)
+	end
+	
+	unless DB.table_exists?(:urls)
+		DB.create_table :urls do
+			primary_key :id
+			column :url, :text
+		end
+	end
+	$dataset = DB[:urls]
 end
 
 class AppError &lt; Exception
-  
+	
+end
+
+# We paginate 7 because the twitter search url can only be so long, we'll be conservative and try to keep this under 255.
+def paginate
+  @paginated_rows = $dataset.reverse_order(:id).paginate(params[:page].to_i, 7)
+end
+
+def next_page
+  !$dataset.reverse_order(:id).paginate(params[:page].to_i + 1, 7).empty?
+end
+
+def previous_page
+  return false if params[:page] == &quot;1&quot;
+  !$dataset.reverse_order(:id).paginate(params[:page].to_i - 1, 7).empty?
+end
+
+get '/urls' do
+  params[:page] = &quot;1&quot;
+  paginate
+  haml :index
+end
+
+get '/urls/:page' do
+  paginate
+  haml :index
 end
 
 get '/p/:url' do
-  begin
-    @url = $dataset.filter(:id =&gt; params[:url].to_i(36)).first[:url]
-    @url = assume_http(@url)
-    haml :preview
-  rescue Exception =&gt; e
-    missing_url
-  end
+	begin
+		@url = $dataset.filter(:id =&gt; params[:url].to_i(36)).first[:url]
+		@url = assume_http(@url)
+		haml :preview
+	rescue Exception =&gt; e
+		missing_url
+	end
 end
 
 get '/:url' do
-  begin
-    url = $dataset.filter(:id =&gt; params[:url].to_i(36)).first[:url]
-    redirect assume_http(url)
-  rescue
-    missing_url
-  end
+	begin
+		url = $dataset.filter(:id =&gt; params[:url].to_i(36)).first[:url]
+		redirect assume_http(url)
+	rescue
+		missing_url
+	end
 end
 
 get '/' do
-  haml :form
+	haml :form
 end
 
 # A get based creator so that bookmarklet can be used
 get '/c/*' do
-  create_and_display(params[:splat].to_s)
+	create_and_display(params[:splat].to_s)
 end
 
 post '/create' do
-  create_and_display(params[:url])
+	create_and_display(params[:url])
 end
 
 [AppError, Sinatra::NotFound].each do |e|
   error e do
     @error = request.env[&quot;sinatra.error&quot;].name
-    haml :error   
+    haml :error
   end
 end
 
 
 
 def missing_url
-  raise Sinatra::NotFound, &quot;We could not find that URL.&quot;
+	raise Sinatra::NotFound, &quot;We could not find that URL.&quot;
 end
 
 def create_and_display(url)
-  url
-  url = assume_http(url)
-  if url_chain?(url)
-    raise &quot;You've been bad.&lt;br /&gt;You cannot create URL chains.&quot;
-  elsif url.length.zero?
-    raise &quot;Input a URL, please.&quot;
-  else
-    if $dataset.filter(:url =&gt; url).empty?
-      $dataset &lt;&lt; {:url =&gt; url }
-    end
-  
-    url = $dataset.filter(:url =&gt; url)
-    @id = url[:id][:id].to_s(36)
-    haml :url
-  end
+	url
+	url = assume_http(url)
+	if url_chain?(url)
+		@error = &quot;You've been bad.&lt;br /&gt;You cannot create URL chains.&quot;
+		haml :error
+	elsif url.length.zero?
+		@error = &quot;Input a URL, please.&quot;
+		haml :error
+	else
+		if $dataset.filter(:url =&gt; url).empty?
+			$dataset &lt;&lt; {:url =&gt; url }
+		end
+	
+		url = $dataset.filter(:url =&gt; url)
+		@id = url[:id][:id].to_s(36)
+		haml :url
+	end
 end
  
 def url_chain?(string)
-  blacklist = [request.env['HTTP_HOST'], &quot;tinyurl&quot;, &quot;is.gd&quot;, &quot;tr.im&quot;, &quot;rubyurl&quot;]
-  !!blacklist.detect { |url| string.include?(url) }
+	blacklist = [request.env['HTTP_HOST'], &quot;tinyurl&quot;, &quot;is.gd&quot;, &quot;tr.im&quot;, &quot;rubyurl&quot;]
+	!!blacklist.detect { |url| string.include?(url) }
 end
 
 # Assume http if nothing is specified.
 def assume_http(url)
-  if !/^(.*):\/\//.match(url)
-    url = &quot;http://#{url}&quot;
-  end
-  url
+	if !/^(.*):\/\//.match(url)
+		url = &quot;http://#{url}&quot;
+	end
+	url
 end</diff>
      <filename>url.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,4 +7,12 @@
     %input{ :type =&gt; &quot;submit&quot;, :name =&gt; &quot;submit&quot;, :value =&gt; &quot;URLize&quot;, :class =&gt; &quot;button&quot; }
     
 %small
-  == We haz #{DB[:urls].count} urls
\ No newline at end of file
+  We haz 
+  %a{:href =&gt; &quot;/urls&quot;}== #{DB[:urls].count} urls
+  
+  %br/
+  Drag 
+  -#%a{:href =&gt; &quot;javascript:void(location.host=='maps.google.com'?location.href='http://#{request.env['HTTP_HOST']}/c/'+encodeURIComponent(document.getElementById('link').href):location.href='http://#{request.env['HTTP_HOST']}/c/'+encodeURIComponent(location.href))&quot;}
+  %a{:href =&gt; &quot;javascript:void(location.host=='maps.google.com'?location.href='http://#{request.env['HTTP_HOST']}/c/'+document.getElementById('link').href:location.href='http://#{request.env['HTTP_HOST']}/c/'+location.href)&quot;}
+    this link
+  to your bookmarks bar to save the link
\ No newline at end of file</diff>
      <filename>views/form.haml</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 %html
   %head
-    %link{ :rel =&gt; &quot;stylesheet&quot;, :href =&gt; &quot;/style.css&quot;}
+    %link{ :rel =&gt; &quot;stylesheet&quot;, :href =&gt; &quot;/style.css?#{Time.now}&quot;}
+    %script{ :src =&gt; &quot;/jquery.js?#{Time.now}&quot;, :type =&gt; &quot;text/javascript&quot; }
+    %script{ :src =&gt; &quot;/application.js?#{Time.now}&quot;, :type =&gt; &quot;text/javascript&quot; }
   %body
     = yield
     </diff>
      <filename>views/layout.haml</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>tmp/restart.txt</filename>
    </removed>
    <removed>
      <filename>url</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>b1998906f399639d29527151170aee194c0dec17</id>
    </parent>
    <parent>
      <id>d6592d6dfee412681c42e4f089f0dc7690f4d4e4</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Bigg</name>
    <email>radarlistener@gmail.com</email>
  </author>
  <url>http://github.com/radar/url/commit/c1803ea3b56368a9cb7d416af1e8eb66d570a4f2</url>
  <id>c1803ea3b56368a9cb7d416af1e8eb66d570a4f2</id>
  <committed-date>2009-02-26T22:18:43-08:00</committed-date>
  <authored-date>2009-02-26T22:18:43-08:00</authored-date>
  <message>Merge branch 'master' of git://github.com/mocra/url

Conflicts:
	url.rb</message>
  <tree>67eaa5ca0252965ed69a24522d17e83039478621</tree>
  <committer>
    <name>Ryan Bigg</name>
    <email>radarlistener@gmail.com</email>
  </committer>
</commit>
