blob: e749449e999aba5f80eb0ef974e7b5b1e423d2f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
class RssController < ApplicationController
before_filter :authenticate, :only => :recent_changes
before_filter :get_host
def updates
@items = Page.heads.find_tagged_with(
"update",
:order => "published_at DESC",
:limit => 20
)
respond_to do |format|
format.xml {}
end
end
def recent_changes
@items = Page.all(
:limit => 20,
:order => "updated_at desc",
:conditions => [
"updated_at < ? AND updated_at > ?", Time.now, Time.now-14.days
]
)
end
protected
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == "recent" && password == "d@t3N+kLAu-23"
end
end
def get_host
@host = request.protocol + request.host_with_port
end
end
|