Skip to content

Instantly share code, notes, and snippets.

@crigor
Created March 19, 2009 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crigor/81943 to your computer and use it in GitHub Desktop.
Save crigor/81943 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'lib/models'
require 'rfeedparser'
require 'rack-flash'
use Rack::Session::Cookie
use Rack::Flash
configure do
require File.join(File.dirname(__FILE__), 'config', 'movies.rb')
end
get '/update' do
count = Torrent.update
torrents = Torrent.all
flash[:notice] = "#{count} new movies added"
redirect '/'
end
get '/' do
@torrents = Torrent.all(:order => [:added_at.desc])
haml :index
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment