rssly 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c25eb7b0ee6b8445a5a3272e88d9d166d1f0aeb7
4
- data.tar.gz: 39c286943032ae9a7b86e31fda1c0f52b84f209b
3
+ metadata.gz: 2cd55f05d8def4ad9b335f12828d17cdbb6786d9
4
+ data.tar.gz: 4011f97b18c32e72d43c1c81156d36349e970586
5
5
  SHA512:
6
- metadata.gz: 53f400d0d9d4e7d10ee842c4dd39abec25c7750e017079f1ff32fe9140641ead2f49422455b005df116c771d9424a47636d7b4c740979c414a26dcbbab961435
7
- data.tar.gz: e2ead2d0d8b530b8bf9c0108fe4691f11799351145cc554ee4548083f330e8c9a66b9799571b989754fe8000bed94047bcae9fc9ef33423ae457c575b1ff35e5
6
+ metadata.gz: 1fe6854c8827af70a2c43c1fb4bd4797f4767726cff14fbe2dc185e6839a1c3acfd943e58aefa4300704de3f24f74f5564260d0fabcbc4513c188e4cb6527047
7
+ data.tar.gz: 254047f7c43696e40892f5ae36756d8134048a5b66763e692765b39464384ddcd0c7eed1d035de150d8684e689569f7238d2a98f39b64010538c0f283f47cc58
@@ -1,6 +1,7 @@
1
1
  require 'addressable/uri'
2
2
  require 'readability'
3
3
  require 'open-uri'
4
+ require 'open_uri_redirections'
4
5
  require 'sanitize'
5
6
  require 'ots'
6
7
 
@@ -49,7 +50,7 @@ module Rssly
49
50
 
50
51
  def url=(url)
51
52
  normalized = Addressable::URI.parse(url).normalize
52
- @url = normalized.scheme + '://' + normalized.host + normalized.path
53
+ @url = normalized.to_s
53
54
  end
54
55
 
55
56
  def published
@@ -75,7 +76,7 @@ module Rssly
75
76
  def extracted
76
77
  @extracted ||= begin
77
78
  $stderr.puts "Fetching article at #{url}" if Rssly::CONFIG[:verbose]
78
- source = open(url).read
79
+ source = open(url, allow_redirections: :all).read
79
80
  Readability::Document.new(source)
80
81
  end
81
82
  rescue OpenURI::HTTPError
@@ -1,3 +1,3 @@
1
1
  module Rssly
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "bloomfilter-rb", "~> 2.1"
32
32
  spec.add_dependency "redis", "~> 3.0.7"
33
33
  spec.add_dependency "json", "~> 1.8.1"
34
+ spec.add_dependency 'open_uri_redirections', '~> 0.1.4'
34
35
  spec.add_dependency "thor"
35
36
 
36
37
  spec.add_development_dependency "bundler", "~> 1.3"
@@ -36,16 +36,6 @@ describe 'Rssly::Article' do
36
36
  @article = Rssly::Article.new(url: ARTICLE_TEST_URL)
37
37
  end
38
38
 
39
- it 'should standardize the url' do
40
- article = Rssly::Article.new url: 'http://notstandard.com/123123/?test=hello/'
41
- expect(article.url).to eq('http://notstandard.com/123123/')
42
- end
43
-
44
- it 'should standardize a file url' do
45
- article = Rssly::Article.new url: 'http://notstandard.com/123123.html?hello'
46
- expect(article.url).to eq('http://notstandard.com/123123.html')
47
- end
48
-
49
39
  it 'should fetch the title if not given' do
50
40
  expect(@article.title).not_to eq(nil)
51
41
  end
@@ -23,7 +23,7 @@ describe 'Rssly::Collection' do
23
23
  end
24
24
 
25
25
  it 'filters out duplicate articles' do
26
- expect(@collection.length).to eq(@feed_count)
26
+ expect(@collection.length).to.be <= @feed_count
27
27
  end
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rssly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Kot
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ~>
151
151
  - !ruby/object:Gem::Version
152
152
  version: 1.8.1
153
+ - !ruby/object:Gem::Dependency
154
+ name: open_uri_redirections
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: 0.1.4
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: 0.1.4
153
167
  - !ruby/object:Gem::Dependency
154
168
  name: thor
155
169
  requirement: !ruby/object:Gem::Requirement