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 +4 -4
- data/lib/rssly/article.rb +3 -2
- data/lib/rssly/version.rb +1 -1
- data/rssly.gemspec +1 -0
- data/spec/article_spec.rb +0 -10
- data/spec/collection_spec.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cd55f05d8def4ad9b335f12828d17cdbb6786d9
|
4
|
+
data.tar.gz: 4011f97b18c32e72d43c1c81156d36349e970586
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fe6854c8827af70a2c43c1fb4bd4797f4767726cff14fbe2dc185e6839a1c3acfd943e58aefa4300704de3f24f74f5564260d0fabcbc4513c188e4cb6527047
|
7
|
+
data.tar.gz: 254047f7c43696e40892f5ae36756d8134048a5b66763e692765b39464384ddcd0c7eed1d035de150d8684e689569f7238d2a98f39b64010538c0f283f47cc58
|
data/lib/rssly/article.rb
CHANGED
@@ -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.
|
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
|
data/lib/rssly/version.rb
CHANGED
data/rssly.gemspec
CHANGED
@@ -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"
|
data/spec/article_spec.rb
CHANGED
@@ -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
|
data/spec/collection_spec.rb
CHANGED
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
|
+
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
|