feedbag 0.9.6 → 0.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.markdown +3 -3
  3. data/lib/feedbag.rb +10 -6
  4. metadata +20 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9698260f809a5f86915b8dbd281555903884fd4e
4
- data.tar.gz: 62d1b97a453ca8df4583159b68202c6abe62a473
3
+ metadata.gz: d849beafed42f6eaf06f5847d525b284990ea308
4
+ data.tar.gz: 59de9e7d7692ef586d82812bec5086b7570e75e1
5
5
  SHA512:
6
- metadata.gz: c23b21e4885ce88fe32748f289afd5ae3b8ca03170399cb1958f5ae2627519424a3a9a9f6492d93492f3ff718932b745a815bd6647059d83b720f7496dcd1306
7
- data.tar.gz: e01f337445faaf3a624e74c2d9c4fc7cb39fccf0e9aadf29c068e9e0942c7b4b84b732dda22cb268642e59ccb741e4c0cf5e4e482d701fc1f72d91f0f7ef400b
6
+ metadata.gz: 9a3d98e90e7f48bcbb44a461ff35f674737b2c4d93c09f137e33b3afdba4fdfb69221681ae43778aa39c7724d5305ca12ae38f258d83ff08294d1799d8374819
7
+ data.tar.gz: 367c78e9308d3e8ec85d3576c41d4f56057bc42766c5660d7adbdf7e6b52ccf3e4bd6062216b3031c240655168e557f37e55042584d2607d64ed530c84e90a17
@@ -33,11 +33,11 @@ You can also use the command line tool for quick queries, if you install the gem
33
33
  - Because it only uses [Nokogiri](http://nokogiri.org/) as dependency.
34
34
  - Because it follows modern feed filename conventions (like those ones used by WordPress blogs, or Blogger, etc).
35
35
  - Because it's a single file you can embed easily in your application.
36
- - Because it's faster than rfeedfinder.
36
+ - Because it's faster than anything else.
37
37
 
38
38
  ### Author
39
39
 
40
- [David Moreno](http://damog.net/) <[david@axiombox.com](mailto:david@axiombox.com)>.
40
+ [David Moreno](http://damog.net/) <[damog@damog.net](mailto:damog@damog.net)>.
41
41
 
42
42
  ### Donations
43
43
 
@@ -47,4 +47,4 @@ You can also use the command line tool for quick queries, if you install the gem
47
47
 
48
48
  ### Copyright
49
49
 
50
- This is free software. See [COPYING](https://raw.githubusercontent.com/damog/feedbag/master/COPYING) for more information.
50
+ This is and will always be free software. See [COPYING](https://raw.githubusercontent.com/damog/feedbag/master/COPYING) for more information.
@@ -9,10 +9,10 @@
9
9
  # distribute, sublicense, and/or sell copies of the Software, and to
10
10
  # permit persons to whom the Software is furnished to do so, subject to
11
11
  # the following conditions:
12
- #
12
+ #
13
13
  # The above copyright notice and this permission notice shall be
14
14
  # included in all copies or substantial portions of the Software.
15
- #
15
+ #
16
16
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
17
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
18
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -36,6 +36,7 @@ class Feedbag
36
36
  'text/xml',
37
37
  'application/rss+xml',
38
38
  'application/rdf+xml',
39
+ 'application/json',
39
40
  ].freeze
40
41
 
41
42
  def self.feed?(url)
@@ -115,19 +116,22 @@ class Feedbag
115
116
 
116
117
  # first with links
117
118
  (doc/"atom:link").each do |l|
118
- next unless l["rel"]
119
+ next unless l["rel"] && l["href"].present?
119
120
  if l["type"] and CONTENT_TYPES.include?(l["type"].downcase.strip) and l["rel"].downcase == "self"
120
121
  self.add_feed(l["href"], url, @base_uri)
121
122
  end
122
123
  end
123
124
 
124
- (doc/"link").each do |l|
125
- next unless l["rel"]
126
- if l["type"] and CONTENT_TYPES.include?(l["type"].downcase.strip) and (l["rel"].downcase =~ /alternate/i or l["rel"] == "service.feed")
125
+ doc.xpath("//link[@rel='alternate' or @rel='service.feed'][@href][@type]").each do |l|
126
+ if CONTENT_TYPES.include?(l['type'].downcase.strip)
127
127
  self.add_feed(l["href"], url, @base_uri)
128
128
  end
129
129
  end
130
130
 
131
+ doc.xpath("//link[@rel='alternate' and @type='application/json'][@href]").each do |e|
132
+ self.add_feed(e['href'], url, @base_uri) if self.looks_like_feed?(e['href'])
133
+ end
134
+
131
135
  (doc/"a").each do |a|
132
136
  next unless a["href"]
133
137
  if self.looks_like_feed?(a["href"]) and (a["href"] =~ /\// or a["href"] =~ /#{url_uri.host}/)
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feedbag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Moreno
8
- - Derek Willis
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2016-04-11 00:00:00.000000000 Z
11
+ date: 2017-06-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: nokogiri
@@ -45,14 +44,14 @@ dependencies:
45
44
  requirements:
46
45
  - - "~>"
47
46
  - !ruby/object:Gem::Version
48
- version: '0'
47
+ version: '3'
49
48
  type: :development
50
49
  prerelease: false
51
50
  version_requirements: !ruby/object:Gem::Requirement
52
51
  requirements:
53
52
  - - "~>"
54
53
  - !ruby/object:Gem::Version
55
- version: '0'
54
+ version: '3'
56
55
  - !ruby/object:Gem::Dependency
57
56
  name: mocha
58
57
  requirement: !ruby/object:Gem::Requirement
@@ -73,8 +72,22 @@ dependencies:
73
72
  - - ">="
74
73
  - !ruby/object:Gem::Version
75
74
  version: 0.12.0
75
+ - !ruby/object:Gem::Dependency
76
+ name: webmock
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '3'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '3'
76
89
  description: Ruby's favorite feed auto-discovery tool
77
- email: david@axiombox.com
90
+ email: damog@damog.net
78
91
  executables:
79
92
  - feedbag
80
93
  extensions: []
@@ -109,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
122
  version: '0'
110
123
  requirements: []
111
124
  rubyforge_project: feedbag
112
- rubygems_version: 2.2.2
125
+ rubygems_version: 2.6.11
113
126
  signing_key:
114
127
  specification_version: 4
115
128
  summary: Ruby's favorite feed auto-discovery tool