pointmd_comments 0.1.7 → 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: 14bdb214817ffa3446133a02ce63339577eefeb5d92b07ec706916d287401698
4
- data.tar.gz: d56a2648b21a6a6b4c091fe050e6d16f20c20a2c0f4de9dc6a44f64c665ac328
3
+ metadata.gz: fca56a444c6f4243e673339bf85174fbb71dd2a959d3ad2b52b9728fbd598dbe
4
+ data.tar.gz: 208e3c91a53f539a08cf9d6a3dec0606f25851ac576898c9caa2975c08251018
5
5
  SHA512:
6
- metadata.gz: 6d1fa692ce179995acf29b6b3f4ea91021279919485c76a5a10c9219995dff0d5bbb015e31f87c2331b2c76dbeaada7b181e83c825273c29842e61b83c40d70a
7
- data.tar.gz: f90df92a739a23ed10c72d257973f60a7bffcc67ce28d1a60dbfbe8be0bff0a2753741576e0059c2db9decb0a2427a50ec1bd887e9fcaafa324bb32d53a0949d
6
+ metadata.gz: 170db4ed751423521520ce60d48fd30c40dd8212685c07672e749c90ccea7ef8a688e58a7f7bd4880885c621188e8414e883878669c65b83e43861d861dd1a37
7
+ data.tar.gz: cd3966ec082acbcbd6484b586593ea9b8b1c08fe3cba235c8c2292ef48044454575a39bd7f171afb0930effa215c55a72d4d60dc9ea0950e4965527dd24f474c
@@ -1,7 +1,7 @@
1
1
  module PointmdComments
2
2
  module Aggregators
3
3
  class Main
4
- CHROME_ARGS = %w[disable-dev-shm-usage disable-software-rasterizer no-sandbox].freeze
4
+ CHROME_ARGS = %w[disable-dev-shm-usage disable-software-rasterizer no-sandbox].freeze
5
5
 
6
6
  attr_reader :posts_aggregator, :browser, :comments_aggregator, :all_comments, :posts, :source, :output, :path
7
7
 
@@ -11,7 +11,6 @@ module PointmdComments
11
11
  def initialize(source:, path:)
12
12
  @source = source
13
13
  @path = path
14
- @urls = []
15
14
  end
16
15
 
17
16
  def call
@@ -41,22 +40,12 @@ module PointmdComments
41
40
  end
42
41
 
43
42
  def fetch_news_posts
44
- posts_block = @page.css('.post-blocks-wrap')
45
- main_post_heading = posts_block.children.css('.post-big-block').children.css('h2')
43
+ # NOTE: .post-blocks-wrap does not exist anymore
44
+ # Find <article> tags instead
45
+ articles = @page.css('article')
46
46
 
47
- main_post = main_post_heading.children.css('a').first['href']
48
- other_posts = posts_block.children.css('.post-small-blocks-wrap')
49
-
50
- populate_urls(main_post, other_posts)
51
- end
52
-
53
- def populate_urls(main_post, other_posts)
54
- @urls << main_post
55
-
56
- @urls += other_posts.children.map do |child|
57
- child.css('article').css('h2').children[1]['href']
58
- rescue StandardError
59
- next
47
+ @urls = articles.map do |article|
48
+ article.css('a').attribute('href').to_s
60
49
  end.compact
61
50
  end
62
51
 
@@ -1,3 +1,3 @@
1
1
  module PointmdComments
2
- VERSION = '0.1.7'.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: pointmd_comments
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolai Stoianov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-04 00:00:00.000000000 Z
11
+ date: 2021-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.1.2
123
+ rubygems_version: 3.2.3
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Point.md comments aggregator