Skip to content

Instantly share code, notes, and snippets.

@kkosuge
Created January 3, 2012 18:31
Show Gist options
  • Save kkosuge/1556205 to your computer and use it in GitHub Desktop.
Save kkosuge/1556205 to your computer and use it in GitHub Desktop.
require 'sinatra'
require 'haml'
require 'mongo'
get '/' do
@db = Mongo::Connection.new.db('creepy')
deleted = []
@status = []
@db['delete'].find({},{:sort=>['id', 'ascending']}).each do |s|
deleted << s['delete']['status']['id']
end
deleted.each do |d|
@db['status'].find(:id => d).each do |s|
@status << s
end
end
haml :index
end
__END__
@@ layout
%html
%header
%body
= yield
@@ index
- @status.each do |s|
%p= "#{s['user']['screen_name']}: #{s['text']}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment