imap-feeder 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == 0.2.1 2008-07-8
2
+
3
+ * Workaround for feeds containing google-adword links, just filter them. This
4
+ fixes the problems with the Dilbert strip.
5
+
1
6
  == 0.2.0 2008-07-5
2
7
 
3
8
  * 1 major enhancement:
@@ -16,19 +16,21 @@ end
16
16
  class FeedReader
17
17
  attr_reader :messages
18
18
 
19
+ DEFAULT_ENCODING = "UTF-8"
20
+
19
21
  def initialize(feed_url)
20
22
  @feed_url = feed_url
21
23
  @feed = SimpleRSS.parse(open(feed_url))
22
24
 
23
25
  @encoding = @feed.source[/encoding=["'](.*?)["']/, 1]
24
26
  if not @encoding
25
- $log.warn "No encoding found for #{feed_url}, defaulting to UTF-8."
26
- @encoding = "UTF-8"
27
+ $log.info "No encoding found for #{feed_url}, defaulting to #{DEFAULT_ENCODING}."
28
+ @encoding = DEFAULT_ENCODING
27
29
  end
28
30
  end
29
31
 
30
32
  def conv(str)
31
- Iconv.iconv("UTF-8", @encoding, str).first
33
+ Iconv.iconv(DEFAULT_ENCODING, @encoding, str).first
32
34
  rescue Iconv::IllegalSequence => e
33
35
  $log.error "IConv reports an IllegalSequence: #{e.message} from #{str}"
34
36
  return str
@@ -159,6 +159,10 @@ EOF
159
159
  href = URI(link.attributes['href']) rescue nil
160
160
  next if not href && href.host
161
161
  next if link.innerHTML.strip == href.to_s.strip
162
+ if href.to_s =~ /googleadservices/
163
+ link.swap ""
164
+ next
165
+ end
162
166
  urls << href
163
167
  link.swap(link.innerHTML.strip + "[#{urls.length}]")
164
168
  end
@@ -2,7 +2,7 @@ class ImapFeeder #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -150,6 +150,12 @@ body<br/><br/><a href='http://url'>http://url</a>
150
150
  EOF
151
151
  end
152
152
 
153
+ def test_removes_googleads
154
+ m_with_ads = Message.new(:title => "with url", :body => 'Hello!<a href="http://feedads.googleadservices.com/~a/2cqltt2cam2gg6mnrvfr05h7gg/a"><img src="http://feedads.googleadservices.com/~a/2cqltt2cam2gg6mnrvfr05h7gg/i"></img></a>')
155
+ m_without_ads = Message.new(:title => "with url", :body => 'Hello!')
156
+ assert_equal(m_with_ads.generate_identifier, m_without_ads.generate_identifier)
157
+ end
158
+
153
159
  end
154
160
 
155
161
  class MessageFormatterTest < Test::Unit::TestCase
metadata CHANGED
@@ -1,35 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imap-feeder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mirko Stocker
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDJDCCAgygAwIBAgIBADANBgkqhkiG9w0BAQUFADA4MQswCQYDVQQDDAJtZTEV
14
- MBMGCgmSJomT8ixkARkWBW1pc3RvMRIwEAYKCZImiZPyLGQBGRYCY2gwHhcNMDgw
15
- NjA5MjEwNDI2WhcNMDkwNjA5MjEwNDI2WjA4MQswCQYDVQQDDAJtZTEVMBMGCgmS
16
- JomT8ixkARkWBW1pc3RvMRIwEAYKCZImiZPyLGQBGRYCY2gwggEiMA0GCSqGSIb3
17
- DQEBAQUAA4IBDwAwggEKAoIBAQDY4Rq5KS6Dmcz9TQmOCuJgPRv1npHVJ5mRsKlL
18
- qwKbFRpWV4VnzcUoo+z1iKHNFHNI4G4nSk+8eZ5I8kLO/K5UPmHtYWUw5p83Aj8d
19
- r2/i1cuVxrEdn9JeeroKPfYIHEgtuoEfUAFC7/07GoLiEvDqGS0lN72vyX4H4nnp
20
- p7ijurreOIIXbY0ex8PLlpjCrPQT9+ADQe3iX4oLFDIWCrkmPJZVZ/JCqz1hVlRR
21
- c8fzm9WGcgXnPm8TjV5PcQnD5ElHfD/O3ZTpdkZkZKlGfqXW6Nb3FQGwCP2wE5cE
22
- gd4wxGBHDVJrYpiXdD38V2Y9UDl682ixXU/9UnkHYG5eosk3AgMBAAGjOTA3MAkG
23
- A1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBQo8c+wtGsqDeTZWqPOrR1Y
24
- GMg+3jANBgkqhkiG9w0BAQUFAAOCAQEAOJrch12cZO+72z44rHHNMi8jdjvzn8D3
25
- b2I5Qu5FzO/NxMGlWyETJyTaaYJ6fHdIoO5tATDo+DfiUtUMQGkE/Jrt8Rff+/1H
26
- oWrKMS0+YR3n67RCCoLnsZpeITaqgenXDUiuaG7h8zQFNL4e9/+WVlEi3DM3oaLA
27
- iRxaHvD71BuBpA8fJ6cC2WL5QcNUZpfSJZ4LDZoeE1WrzpEqv44dAVT4rjWF3Q3n
28
- U6DE8XAdANgJLLQKU0xcFMj20tnkZSj/Frk5eCmMqvwP7URfbywKfSoIIyE17A3n
29
- uqXC6cgFmydQfHaHeH24NZ6LBcoaacZYI/xsdm+9S18u2P+G/LAGOg==
30
- -----END CERTIFICATE-----
10
+ cert_chain: []
31
11
 
32
- date: 2008-07-05 00:00:00 +02:00
12
+ date: 2008-07-08 00:00:00 +02:00
33
13
  default_executable:
34
14
  dependencies:
35
15
  - !ruby/object:Gem::Dependency
@@ -82,6 +62,16 @@ dependencies:
82
62
  - !ruby/object:Gem::Version
83
63
  version: "1.1"
84
64
  version:
65
+ - !ruby/object:Gem::Dependency
66
+ name: hoe
67
+ type: :development
68
+ version_requirement:
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: 1.7.0
74
+ version:
85
75
  description: Imap-feeder pushes entries from RSS and Atom feeds to an IMAP server.
86
76
  email:
87
77
  - me@misto.ch
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1,4 +0,0 @@
1
- B� �QS=�|�Fv����;���n� ܹ�IlQ���G<7Yq�Mgm�2�
2
- 5�t��{�yзd��ԁ�@B"�}E�K��?�f�{��7ѕ΋ qR-����q����wd �Ջ��3��ay��4�5��9=�Y$�H=b����64�.6ԲOz�Q��({hd7��qu~�\��[
3
- ,Z���E��XC&7� .�w�9����N�_��;��I+
4
- ?~�CG��(�l���I�wJ��?��ۻ��b�(o�A