Created
March 19, 2009 17:10
-
-
Save crigor/81943 to your computer and use it in GitHub Desktop.
This file contains 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 '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