pat-maddox-twinkies 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/twinkies.rb +1 -0
- data/lib/twinkies/item.rb +1 -0
- data/lib/twinkies/server.rb +9 -2
- metadata +10 -1
data/VERSION.yml
CHANGED
data/lib/twinkies.rb
CHANGED
data/lib/twinkies/item.rb
CHANGED
data/lib/twinkies/server.rb
CHANGED
@@ -32,21 +32,28 @@ module Twinkies
|
|
32
32
|
|
33
33
|
def handle_request
|
34
34
|
username = @username # builder must instance_eval?
|
35
|
+
|
35
36
|
get '/feed.xml' do
|
37
|
+
pieces = ['http://', request.env['SERVER_NAME']]
|
38
|
+
pieces << ":#{request.env['SERVER_PORT']}" unless request.env['SERVER_PORT'].to_i == 80
|
39
|
+
pieces << request.env['REQUEST_PATH']
|
40
|
+
request_path = pieces.join
|
41
|
+
|
36
42
|
builder do |xml|
|
37
43
|
xml.instruct!
|
38
|
-
xml.rss :version => '2.0' do
|
44
|
+
xml.rss :version => '2.0', "xmlns:atom" => "http://www.w3.org/2005/Atom" do
|
39
45
|
xml.channel do
|
40
46
|
xml.title "#{username}'s twitter URL feed"
|
41
47
|
xml.description "#{username}'s twitter URL feed"
|
42
48
|
xml.link "http://twitter.com/#{username}"
|
49
|
+
xml.tag! "atom:link", :rel => "self", :href => request_path
|
43
50
|
|
44
51
|
Item.latest.each do |tweet|
|
45
52
|
xml.item do
|
46
53
|
xml.title "#{tweet.user} - #{tweet.text}"
|
47
54
|
xml.link tweet.link
|
48
55
|
xml.pubDate tweet.created_at.rfc822
|
49
|
-
xml.guid tweet.
|
56
|
+
xml.guid tweet.guid, :isPermaLink => false
|
50
57
|
end
|
51
58
|
end
|
52
59
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pat-maddox-twinkies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Maddox
|
@@ -39,6 +39,15 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: "0"
|
41
41
|
version:
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: guid
|
44
|
+
version_requirement:
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: "0"
|
50
|
+
version:
|
42
51
|
description: TODO
|
43
52
|
email: pat.maddox@gmail.com
|
44
53
|
executables:
|