html2rss 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cc71ee2722757d0f4cceaf8aea1b9007496acf35fdf4da37a5dea998233258d
4
- data.tar.gz: '0009a02fe85a6e2b088aec00944e1dc46233ce6878b8558782286be0e020511b'
3
+ metadata.gz: e2383144ffd44b49ff516d2ca58b28e83f22b9213c5f8000d3295172804078c2
4
+ data.tar.gz: 52d7d4cc36986fbad3b1a39136b1b111a3ffe66af8395cf396e0239c5100e0bc
5
5
  SHA512:
6
- metadata.gz: 2de4befd1f3beec2ee094f2c792ec94a1bde37c3da1f30eb737403ae04eddb36b54a43b86163f8b348229c42a5d38aae0bc7657c677bdbe95a54bee26b1fa6d9
7
- data.tar.gz: f344bb3046c0493d9979e9daf53d5f3725798c96093dbbff6164a1339fd80bf54ad60868eb55dbc5a67239584f825cb0f5f6ca18c4e3e7f8f67b6698d26f3adf
6
+ metadata.gz: bff3938bfa78ed99d27a960828ff4b8d9efe843826a68758ae33d7b3d326047b57e2c6cd0556344fa0fdc1dc2173daaf8bc145cdbab92197640012b376faa78b
7
+ data.tar.gz: ecf174673a2faffd64e9638b0fada4485b4d1ff9e0edad09e9d1fb610fd8e5b3201cd650f22f0ba578f83069de92bec651efe40686cf8e561337c7813db6f11e
@@ -1,115 +1,40 @@
1
- <img width="300px" src="https://github.com/gildesmarais/html2rss/raw/master/support/logo.png" />
1
+ # [0.1.0](https://github.com/gildesmarais/html2rss/compare/v0.0.1...v0.1.0) (2018-11-04)
2
2
 
3
- # html2rss
4
3
 
5
- _Generate RSS feeds by scraping websites by providing a config._
4
+ ### Bug Fixes
6
5
 
6
+ * handling of url query breaks processing ([ace289e](https://github.com/gildesmarais/html2rss/commit/ace289e))
7
+ * only set supported attributes on rss item ([dae0d8e](https://github.com/gildesmarais/html2rss/commit/dae0d8e))
8
+ * **config:** feed generation fails ([7dd5586](https://github.com/gildesmarais/html2rss/commit/7dd5586))
9
+ * **parse_uri:** handle non-absolute paths ([9215025](https://github.com/gildesmarais/html2rss/commit/9215025))
7
10
 
8
11
 
9
- ## Bugfixes
10
- - handling of url query breaks processing
11
- ([ace289e9](git@github.com:gildesmarais/html2rss/commit/ace289e911b69cb92433cac6f1ca0403715d8286))
12
- - only set supported attributes on rss item
13
- ([dae0d8e7](git@github.com:gildesmarais/html2rss/commit/dae0d8e75541e810275e789a23971a61e60a2154))
12
+ ### Features
14
13
 
15
- - **config**
16
- - feed generation fails
17
- ([7dd55869](git@github.com:gildesmarais/html2rss/commit/7dd55869f79b1de76c004bf0e82d13b16b5b3f0d))
14
+ * **item_extractor:** add static and current_time ([25043dc](https://github.com/gildesmarais/html2rss/commit/25043dc))
15
+ * **item_extractor:** handle absolute urls ([f96be00](https://github.com/gildesmarais/html2rss/commit/f96be00))
16
+ * **item_extractor:** text strips strings ([f598285](https://github.com/gildesmarais/html2rss/commit/f598285))
17
+ * **post_processing:** add configurable post_processing ([#5](https://github.com/gildesmarais/html2rss/issues/5)) ([4cf6cac](https://github.com/gildesmarais/html2rss/commit/4cf6cac)), closes [#1](https://github.com/gildesmarais/html2rss/issues/1)
18
+ * **post_processor:** add substring ([6f2a32a](https://github.com/gildesmarais/html2rss/commit/6f2a32a))
19
+ * **postprocessors:** add Template ([#6](https://github.com/gildesmarais/html2rss/issues/6)) ([f1db542](https://github.com/gildesmarais/html2rss/commit/f1db542)), closes [#4](https://github.com/gildesmarais/html2rss/issues/4)
20
+ * **sanitize_html:** add target="_blank" to anchors ([975a73b](https://github.com/gildesmarais/html2rss/commit/975a73b))
21
+ * add logo [skip ci] ([857a55f](https://github.com/gildesmarais/html2rss/commit/857a55f))
22
+ * do not fail on invalid item, just skip it ([3b83d71](https://github.com/gildesmarais/html2rss/commit/3b83d71))
23
+ * require updated to be present ([e1bedae](https://github.com/gildesmarais/html2rss/commit/e1bedae))
18
24
 
19
- - **parse_uri**
20
- - handle non-absolute paths
21
- ([92150257](git@github.com:gildesmarais/html2rss/commit/921502574e4436d65a30e1d34b9b31f238336247))
22
25
 
23
26
 
27
+ ## [0.0.1](https://github.com/gildesmarais/html2rss/compare/219cac8...v0.0.1) (2018-06-03)
24
28
 
25
29
 
26
- ## Features
27
- - add logo [skip ci]
28
- ([857a55fd](git@github.com:gildesmarais/html2rss/commit/857a55fd8c932930d96c47c5abe57f0507356df1))
29
- - require updated to be present
30
- ([e1bedaec](git@github.com:gildesmarais/html2rss/commit/e1bedaecc91e874fe24e96000612abb9cd11e9fe))
31
- - do not fail on invalid item, just skip it
32
- ([3b83d715](git@github.com:gildesmarais/html2rss/commit/3b83d715619abbc33b124de1945d17cb0dc7edb0))
30
+ ### Bug Fixes
33
31
 
34
- - **item_extractor**
35
- - text strips strings
36
- ([f5982859](git@github.com:gildesmarais/html2rss/commit/f59828593dca663bdbe8699392594e2d18658f8f))
37
- - add static and current_time
38
- ([25043dcb](git@github.com:gildesmarais/html2rss/commit/25043dcbd8f0f4901202f4a2f66b355ac48825a8))
39
- - handle absolute urls
40
- ([f96be008](git@github.com:gildesmarais/html2rss/commit/f96be00857bdcded02d52dd62ec22b9b52c803ed))
32
+ * gem's version and readme-typos ([eab39d9](https://github.com/gildesmarais/html2rss/commit/eab39d9))
41
33
 
42
- - **post_processing**
43
- - add configurable post_processing (#5)
44
- ([4cf6caca](git@github.com:gildesmarais/html2rss/commit/4cf6cacac00bd3c0c53d584ca11274ba24b03ef7),
45
- [#1](git@github.com:gildesmarais/html2rss/issues/1))
46
34
 
47
- - **post_processor**
48
- - add substring
49
- ([6f2a32a6](git@github.com:gildesmarais/html2rss/commit/6f2a32a6304ef9956577711173de681daf93f55f))
35
+ ### Features
50
36
 
51
- - **postprocessors**
52
- - add Template (#6)
53
- ([f1db542e](git@github.com:gildesmarais/html2rss/commit/f1db542e8c1e9e09a066a3cd6c8514a6ca0aa871),
54
- [#4](git@github.com:gildesmarais/html2rss/issues/4))
37
+ * **html2rss:** add initial version of the html2rss gem ([219cac8](https://github.com/gildesmarais/html2rss/commit/219cac8))
55
38
 
56
- - **sanitize_html**
57
- - add target="_blank" to anchors
58
- ([975a73bf](git@github.com:gildesmarais/html2rss/commit/975a73bfd396ba5942bc0ea80eebd14cc37ad776))
59
39
 
60
40
 
61
-
62
-
63
- ## Documentation
64
- - create the changelog
65
- ([5c561db5](git@github.com:gildesmarais/html2rss/commit/5c561db51d4e0b8592b1c82812ab5cdbe9320b70))
66
- - add tips and tricks
67
- ([ea978240](git@github.com:gildesmarais/html2rss/commit/ea9782408107f3637a4c9665396f511fc07be19b))
68
- - update readme
69
- ([4743167c](git@github.com:gildesmarais/html2rss/commit/4743167c86959e83524ffb7282c562413a651797))
70
- - add note about html2rss-web
71
- ([3371c12f](git@github.com:gildesmarais/html2rss/commit/3371c12ffc6c8d3c29073d03ff206886a39401cd))
72
- - add a badge for travis-ci
73
- ([8818d4f4](git@github.com:gildesmarais/html2rss/commit/8818d4f464a9c163ebc9665d01719e2bab132bd6))
74
-
75
-
76
-
77
-
78
- ## Test
79
- - don't be so lazy when matching strings
80
- ([6a0eb627](git@github.com:gildesmarais/html2rss/commit/6a0eb62765523a1405fd269466b2fc57794eac7a))
81
-
82
-
83
-
84
-
85
- ## Chore
86
- - upgrade sanitze gem to version 5.0.0
87
- ([8c4bf3a4](git@github.com:gildesmarais/html2rss/commit/8c4bf3a44885758e395568ec452a7cffdb9a0389))
88
- - rubocop autocorrect
89
- ([af6b9fac](git@github.com:gildesmarais/html2rss/commit/af6b9facca547d3ca3ce9ef0d1227707cd16eaea))
90
- - build against latest ruby releases
91
- ([17ba79ac](git@github.com:gildesmarais/html2rss/commit/17ba79acd2f68da1fcc984368d3e6de3437cbf1b))
92
- - update dependencies
93
- ([855279b4](git@github.com:gildesmarais/html2rss/commit/855279b46d584a8a8c2a317529f7a4be550eaf15))
94
- - update dependencies
95
- ([46e5a283](git@github.com:gildesmarais/html2rss/commit/46e5a2832d1f2fe1353dcc2a8d82a9786f15f6bd))
96
- - add simplecov
97
- ([b4e1144b](git@github.com:gildesmarais/html2rss/commit/b4e1144b7f8f90126e528cc4a4ec048113d93634))
98
-
99
- - **changelog**
100
- - add generation with git-changelog
101
- ([07ad5a51](git@github.com:gildesmarais/html2rss/commit/07ad5a513f0951ee988426abda4b8c233411ead7))
102
-
103
- - **travis**
104
- - use cache for bundler
105
- ([ac76b3b2](git@github.com:gildesmarais/html2rss/commit/ac76b3b2dd94adecd4927de18651800438a7e7ba))
106
- - setup autorelease to rubygems
107
- ([eb9c8e1b](git@github.com:gildesmarais/html2rss/commit/eb9c8e1b16902dc0e174a0cccb6eb9227307ce82))
108
-
109
-
110
-
111
-
112
-
113
- ---
114
- <sub><sup>*Generated with [git-changelog](https://github.com/rafinskipg/git-changelog). If you have any problems or suggestions, create an issue.* :) **Thanks** </sub></sup>
115
-
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- html2rss (0.0.1)
4
+ html2rss (0.1.0)
5
5
  faraday (~> 0.15)
6
6
  nokogiri (~> 1.8)
7
7
  sanitize (~> 5.0)
@@ -20,7 +20,7 @@ GEM
20
20
  multipart-post (2.0.0)
21
21
  nokogiri (1.8.5)
22
22
  mini_portile2 (~> 2.3.0)
23
- nokogumbo (2.0.0)
23
+ nokogumbo (2.0.1)
24
24
  nokogiri (~> 1.8, >= 1.8.4)
25
25
  rspec (3.8.0)
26
26
  rspec-core (~> 3.8.0)
data/README.md CHANGED
@@ -56,8 +56,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/gildes
56
56
 
57
57
  ## Changelog generation
58
58
 
59
- The `CHANGELOG.md` can be generated automatically.
60
- Install [git-changelog](https://www.npmjs.com/package/git-changelog) globally and run `git-changelog` afterwards.
59
+ The `CHANGELOG.md` can be generated automatically with [`standard-changelog`](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/standard-changelog).
61
60
 
62
61
  ## License
63
62
 
@@ -41,6 +41,10 @@ module Html2rss
41
41
  feed_config.dig('selectors').fetch(name, {}).merge('channel' => channel_config)
42
42
  end
43
43
 
44
+ def categories
45
+ feed_config.dig('selectors').fetch('categories', [])
46
+ end
47
+
44
48
  def selector(name)
45
49
  feed_config.dig('selectors', name, 'selector')
46
50
  end
@@ -40,9 +40,13 @@ module Html2rss
40
40
  items.new_item do |rss_item|
41
41
  feed_item.available_attributes.each do |attribute_name|
42
42
  rss_item.send("#{attribute_name}=".to_sym, feed_item.send(attribute_name))
43
+ end
43
44
 
44
- rss_item.guid.content = Digest::SHA1.hexdigest(feed_item.title)
45
+ feed_item.categories.each do |category|
46
+ rss_item.categories.new_category.content = category
45
47
  end
48
+
49
+ rss_item.guid.content = Digest::SHA1.hexdigest(feed_item.title)
46
50
  end
47
51
  end
48
52
  end
@@ -32,8 +32,8 @@ module Html2rss
32
32
  end
33
33
 
34
34
  def available_attributes
35
- # TODO: support optional attributes, e.g. category, enclosure, source
36
- @available_attributes ||= (%w[title link description author comments updated] & @config.attribute_names)
35
+ @available_attributes ||= (%w[title link description author comments updated] &
36
+ @config.attribute_names) - ['categories']
37
37
  end
38
38
 
39
39
  def valid?
@@ -42,6 +42,10 @@ module Html2rss
42
42
  true
43
43
  end
44
44
 
45
+ def categories
46
+ config.categories.map(&method(:method_missing)).uniq.keep_if { |category| category.to_s != '' }
47
+ end
48
+
45
49
  def self.from_url(url, config)
46
50
  connection = Faraday.new(url: url, headers: config.headers)
47
51
  page = Nokogiri::HTML(connection.get.body)
@@ -1,3 +1,3 @@
1
1
  module Html2rss
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: html2rss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gil Desmarais
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-04 00:00:00.000000000 Z
11
+ date: 2018-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -156,7 +156,6 @@ files:
156
156
  - lib/html2rss/item.rb
157
157
  - lib/html2rss/item_extractor.rb
158
158
  - lib/html2rss/version.rb
159
- - support/changelog.md
160
159
  - support/logo.png
161
160
  homepage: https://github.com/gildesmarais/html2rss
162
161
  licenses:
@@ -1,15 +0,0 @@
1
- <% if(logo) { %><img width="300px" src="<%= logo %>" /><%= '\n\n' %><% } %># <%= title %>
2
- <% if(intro) { %><%= '\n' %>_<%= intro %>_<%= '\n' %><% } %>
3
- <% if(version && (version.name || version.number)) { %>##<% if(version.name){%> <%= version.name %><% } %> <%= version.number %> <% if(version.date){ %>( <%= version.date %> )<% } %><%= '\n' %><% } %>
4
- <% _.forEach(sections, function(section){
5
- if(section.commitsCount > 0) { %>
6
- ## <%= section.title %>
7
- <% _.forEach(section.commits, function(commit){ %> - <%= printCommit(commit, true) %><% }) %>
8
- <% _.forEach(section.components, function(component){ %> - **<%= component.name %>**
9
- <% _.forEach(component.commits, function(commit){ %> - <%= printCommit(commit, true) %><% }) %>
10
- <% }) %>
11
- <% } %>
12
- <% }) %>
13
-
14
- ---
15
- <sub><sup>*Generated with [git-changelog](https://github.com/rafinskipg/git-changelog). If you have any problems or suggestions, create an issue.* :) **Thanks** </sub></sup>