summaryrefslogtreecommitdiff
path: root/app/controllers/rss_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/rss_controller.rb')
-rw-r--r--app/controllers/rss_controller.rb28
1 files changed, 25 insertions, 3 deletions
diff --git a/app/controllers/rss_controller.rb b/app/controllers/rss_controller.rb
index 4c2a2e8..e749449 100644
--- a/app/controllers/rss_controller.rb
+++ b/app/controllers/rss_controller.rb
@@ -1,8 +1,9 @@
1class RssController < ApplicationController 1class RssController < ApplicationController
2 2
3 def updates 3 before_filter :authenticate, :only => :recent_changes
4 @host = request.protocol + request.host_with_port 4 before_filter :get_host
5 5
6 def updates
6 @items = Page.heads.find_tagged_with( 7 @items = Page.heads.find_tagged_with(
7 "update", 8 "update",
8 :order => "published_at DESC", 9 :order => "published_at DESC",
@@ -14,4 +15,25 @@ class RssController < ApplicationController
14 end 15 end
15 end 16 end
16 17
18 def recent_changes
19 @items = Page.all(
20 :limit => 20,
21 :order => "updated_at desc",
22 :conditions => [
23 "updated_at < ? AND updated_at > ?", Time.now, Time.now-14.days
24 ]
25 )
26 end
27
28 protected
29 def authenticate
30 authenticate_or_request_with_http_basic do |username, password|
31 username == "recent" && password == "d@t3N+kLAu-23"
32 end
33 end
34
35 def get_host
36 @host = request.protocol + request.host_with_port
37 end
38
17end 39end