rss2mail 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/rss2mail/feed.rb +19 -9
- data/lib/rss2mail/version.rb +1 -1
- metadata +12 -12
data/README
CHANGED
data/lib/rss2mail/feed.rb
CHANGED
@@ -122,6 +122,7 @@ module RSS2Mail
|
|
122
122
|
}
|
123
123
|
|
124
124
|
# only keep the last 100 entries
|
125
|
+
feed[:sent].uniq!
|
125
126
|
feed[:sent].slice!(0...-100)
|
126
127
|
|
127
128
|
log "#{sent} items sent"
|
@@ -131,14 +132,17 @@ module RSS2Mail
|
|
131
132
|
private
|
132
133
|
|
133
134
|
def get(reload = reload)
|
135
|
+
conditions = {}
|
136
|
+
|
134
137
|
if reload
|
135
138
|
@content = nil
|
136
|
-
conditions = {}
|
137
139
|
else
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
140
|
+
if etag = feed[:etag]
|
141
|
+
conditions['If-None-Match'] = etag
|
142
|
+
end
|
143
|
+
|
144
|
+
if mtime = feed[:mtime]
|
145
|
+
conditions['If-Modified-Since'] = mtime
|
142
146
|
end
|
143
147
|
end
|
144
148
|
|
@@ -146,10 +150,16 @@ module RSS2Mail
|
|
146
150
|
|
147
151
|
begin
|
148
152
|
open(feed[:url], conditions) { |uri|
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
+
if etag = uri.meta['etag']
|
154
|
+
feed[:etag] = etag
|
155
|
+
end
|
156
|
+
|
157
|
+
if mtime = uri.last_modified
|
158
|
+
feed[:mtime] = mtime.rfc822
|
159
|
+
end
|
160
|
+
|
161
|
+
unless etag || mtime
|
162
|
+
feed[:updated] = Time.now
|
153
163
|
end
|
154
164
|
|
155
165
|
@content ||= uri.read
|
data/lib/rss2mail/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rss2mail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-26 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -63,16 +63,16 @@ extra_rdoc_files:
|
|
63
63
|
- ChangeLog
|
64
64
|
- README
|
65
65
|
files:
|
66
|
-
- lib/rss2mail.rb
|
66
|
+
- lib/rss2mail/rss.rb
|
67
67
|
- lib/rss2mail/version.rb
|
68
68
|
- lib/rss2mail/util.rb
|
69
|
-
- lib/rss2mail/rss.rb
|
70
69
|
- lib/rss2mail/feed.rb
|
70
|
+
- lib/rss2mail.rb
|
71
71
|
- bin/rss2mail
|
72
|
-
- COPYING
|
73
72
|
- Rakefile
|
74
|
-
-
|
73
|
+
- COPYING
|
75
74
|
- ChangeLog
|
75
|
+
- README
|
76
76
|
- templates/plain.erb
|
77
77
|
- templates/html.erb
|
78
78
|
- example/feeds.yaml
|
@@ -82,15 +82,15 @@ licenses: []
|
|
82
82
|
|
83
83
|
post_install_message:
|
84
84
|
rdoc_options:
|
85
|
-
- --
|
85
|
+
- --main
|
86
|
+
- README
|
87
|
+
- --line-numbers
|
86
88
|
- --title
|
87
89
|
- rss2mail Application documentation
|
90
|
+
- --inline-source
|
91
|
+
- --all
|
88
92
|
- --charset
|
89
93
|
- UTF-8
|
90
|
-
- --all
|
91
|
-
- --main
|
92
|
-
- README
|
93
|
-
- --line-numbers
|
94
94
|
require_paths:
|
95
95
|
- lib
|
96
96
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements: []
|
109
109
|
|
110
110
|
rubyforge_project: rss2mail
|
111
|
-
rubygems_version: 1.3.
|
111
|
+
rubygems_version: 1.3.5
|
112
112
|
signing_key:
|
113
113
|
specification_version: 3
|
114
114
|
summary: Send RSS feeds as e-mail
|