medium-scrapper 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 159c9a1de5200ace4fd046cc2730f93d4a91e053
4
- data.tar.gz: 1234666074cdde0a5bdbbc2a46eb285c809f4653
3
+ metadata.gz: 2a7487a6dd3896bf5c2019c1e258eb05f2cb23ba
4
+ data.tar.gz: ceda479bc062582d6d200a8c2812ea058f59c5f8
5
5
  SHA512:
6
- metadata.gz: 076802e6c3c210cf301a80e6e2b377fa7b10d17ad93184e45c1a242f3730483f79f37650adbe993b2d96e04b16eff5340103ece74732b07c9df051159cd523e6
7
- data.tar.gz: 889135aede45a43ca0e821f057c14585226262420867c3f3e4a6de25ecde3540f21de74ca3dd2746ee18b5f8771e010a5975a23ce590f2add13c0c48e94075a9
6
+ metadata.gz: d62dd87a1b6f5d016800e4aa1ee3db4fd9f377bc11f701a21164b8448d6aaad40b3d9de483e75a07307a7788e48c23dc4285688023271a41e7d58d4eae9ac2b8
7
+ data.tar.gz: 94c38a08397f8305ac3f6cd94df102ab2ee1c57c8140ecb0520e06ac1b7a6249a51a9898d090b91276729dd0a3d2bea79b4b04e2dbb1bad0bd1be2d03f472cdd
data/lib/model/post.rb CHANGED
@@ -2,9 +2,10 @@
2
2
  class Post
3
3
  attr_reader :title
4
4
 
5
- def initialize(title, subtitle, content)
5
+ def initialize(title, subtitle, content, url)
6
6
  @title = title
7
7
  @subtitle = subtitle
8
8
  @content = content
9
+ @url = url
9
10
  end
10
11
  end
@@ -9,7 +9,10 @@ class PostRetriever
9
9
  def load(user_id, post_id)
10
10
  parsed_url = parse_url(user_id, post_id)
11
11
 
12
- Post.new(parsed_url["title"], parsed_url["content"]["subtitle"], normalize_content(parsed_url["content"]["bodyModel"]["paragraphs"]))
12
+ Post.new(parsed_url["title"],
13
+ parsed_url["content"]["subtitle"],
14
+ normalize_content(parsed_url["content"]["bodyModel"]["paragraphs"]),
15
+ parsed_url["canonicalUrl"])
13
16
  end
14
17
 
15
18
  def normalize_content(paragraphs_raw)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: medium-scrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - uesteibar