imap_to_rss 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 1.0.1 / 2009-05-18
2
+
3
+ * 1 bug fix
4
+ * Don't add items if they don't match
5
+
1
6
  === 1.0 / 2009-05-14
2
7
 
3
8
  * 1 major enhancement
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ Hoe.new 'imap_to_rss', IMAPToRSS::VERSION do |itor|
9
9
  itor.rubyforge_name = 'seattlerb'
10
10
  itor.developer 'Eric Hodel', 'drbrain@example.com'
11
11
 
12
- itor.extra_deps << ['imap_processor', '~> 1.0']
12
+ itor.extra_deps << ['imap_processor', '~> 1.1']
13
13
  itor.extra_deps << ['nokogiri', '~> 1.2']
14
14
  itor.extra_deps << ['tmail', '~> 1.2']
15
15
  end
data/lib/imap_to_rss.rb CHANGED
@@ -14,7 +14,7 @@ class IMAPToRSS < IMAPProcessor
14
14
  ##
15
15
  # The version of IMAPToRSS you are using
16
16
 
17
- VERSION = '1.0'
17
+ VERSION = '1.0.1'
18
18
 
19
19
  ##
20
20
  # A Struct representing an RSS item for the RSS feed. Contains fields
@@ -45,7 +45,7 @@ class IMAPToRSS::Handler
45
45
  # imap_keywords --no-list --keywords IMAP_TO_RSS --delete
46
46
 
47
47
  ##
48
- # Adds an item to the RSS feed with given parts
48
+ # Adds an item to the RSS feed with given parts. Returns the created item
49
49
 
50
50
  def add_item(title, description, author, pub_date, link = nil, guid = nil,
51
51
  category = nil)
@@ -62,6 +62,8 @@ class IMAPToRSS::Handler
62
62
  guid, category
63
63
 
64
64
  @itor.rss_items << item
65
+
66
+ item
65
67
  end
66
68
 
67
69
  ##
@@ -45,7 +45,7 @@ class IMAPToRSS::Handler::Amazon < IMAPToRSS::Handler
45
45
  next
46
46
  else
47
47
  log "Unknown Subject: %p" % @mail.subject
48
- next
48
+ next false
49
49
  end
50
50
  end
51
51
  end
@@ -27,8 +27,7 @@ class IMAPToRSS::Handler::HSBC < IMAPToRSS::Handler
27
27
  ([ \t]*\r?\n){2,}
28
28
  (.*?)
29
29
  ([ \t]*\r?\n){2,}/mx
30
-
31
- next unless $2
30
+ next false unless $2
32
31
 
33
32
  description = $2
34
33
  when 'A2ATransfer@us.hsbc.com' then
@@ -37,8 +36,10 @@ class IMAPToRSS::Handler::HSBC < IMAPToRSS::Handler
37
36
  (.*?)
38
37
  ([ \t]*\r?\n){2,}
39
38
  Sincerely,/mx
39
+ next false unless $2
40
40
 
41
41
  body = $2
42
+
42
43
  body.gsub!(/[*\r]/, '')
43
44
  body.gsub!(/[ \t]*\n/, "\n")
44
45
  body = body.split(/\n\n+/).map { |para| "<p>#{para}</p>" }
@@ -46,11 +47,12 @@ class IMAPToRSS::Handler::HSBC < IMAPToRSS::Handler
46
47
  description = body.join "\n\n"
47
48
  when 'alerts@email.hsbcusa.com' then
48
49
  mail.body =~ /^(http:.*)/
50
+ next false unless $1
49
51
 
50
52
  url = $1
51
53
  else
52
54
  log "Unknown From: #{mail.from.join ', '}"
53
- next
55
+ next false
54
56
  end
55
57
 
56
58
  add_item mail.subject, description, mail.from, mail.date, url,
@@ -21,6 +21,8 @@ class IMAPToRSS::Handler::UPS < IMAPToRSS::Handler
21
21
 
22
22
  tracking_number = $1
23
23
 
24
+ next false unless $1
25
+
24
26
  url = "http://wwwapps.ups.com/WebTracking/processRequest?tracknum=#{tracking_number}"
25
27
 
26
28
  description = %{Package shipped: <a href="#{url}">#{tracking_number}</a>}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imap_to_rss
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.0"
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -30,7 +30,7 @@ cert_chain:
30
30
  x52qPcexcYZR7w==
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-05-15 00:00:00 -07:00
33
+ date: 2009-05-18 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -41,7 +41,7 @@ dependencies:
41
41
  requirements:
42
42
  - - ~>
43
43
  - !ruby/object:Gem::Version
44
- version: "1.0"
44
+ version: "1.1"
45
45
  version:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: nokogiri
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- w��S�r>��߄������P;�DdԿ�7?���V�@c�ʷ�V(?��Q
2
- 9ޣj_N65dun[�,+�[V!��n7
1
+ Q�0����{b�*p�=�ˀY��/��2��$if��9$��pI�4=��Y�N/:�l������C懸/r+BuMg�7�9Ͷ2�� 4[�*���)��
2
+ ��p$#�/ƺ�a>��cЧe0&k�O9 ��ffHGRȈ��c�IxD3���w!`���o��\�KuR���iP2�ڍZ����(���21�A�����ՠ�Yx3�ze��V6C�n��uy�،�r�'�N��x��� �M���