url_common 0.1.2 → 0.1.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
  SHA256:
3
- metadata.gz: b6ae6f1bbc3ec4b834e05a97701a13746db44ad172869868c962067599c12cc2
4
- data.tar.gz: 3194ad31952c2bfc4fc5730ad766104f96a0299b3000a99a6efd32224907adfc
3
+ metadata.gz: 0ab8c804a828390106ee6e442cd46362ef5648ff9d41d36317f2644cb9f21e15
4
+ data.tar.gz: 7d6068a766ed82a3c4fe724fe426549c9c56047acbf373eb46d87aba763dfab0
5
5
  SHA512:
6
- metadata.gz: 32882ac9c6ee8e890daa00cd7ebedb631b99ad3b57856378a49675586a4b125bef12dd4ab116087684969c600acd63300f9689af8ee223792362aecbbbb282fd
7
- data.tar.gz: a01f7d306fbc08f3610ea0732540d0ee80c13703d36fb5d4c3919025df9ccca92707737dfc640016086e7a179437108ddb696144bc55faa789ed6c46aa7f1184
6
+ metadata.gz: bddc296b7dae2781ec1ae7f8b8c79a1327e93bc1bfe30c761366033ef0882049948ea8c2ebbd7ce425aa7d437086b7ec38a4b30ebf0e976a4213990ef1e2d2b6
7
+ data.tar.gz: 395a2d6fec4519067d4dbb08f78c3e67cd4b1d2b1c7c8083299398790c5b9f9e6db81aade8c093f6b2eb39975f30b6923a80634d928e9c6fad159e12bb6a840d
data/Gemfile CHANGED
@@ -3,10 +3,15 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in url_common.gemspec
4
4
  gemspec
5
5
 
6
- ruby "2.7.1"
6
+ ruby "3.1.2"
7
7
 
8
8
  gem "rake", "~> 12.0"
9
9
  gem "rspec", "~> 3.0"
10
10
  gem "fuzzyurl", '~> 0.9.0'
11
- gem 'mechanize', '~> 2.6'
12
11
  gem "byebug"
12
+
13
+ gem "hpricot", "~> 0.8.6"
14
+ gem 'net-http-persistent', github: 'drbrain/net-http-persistent'
15
+ gem "mechanize", "~> 2.7"
16
+
17
+ gem "webrick", "~> 1.7"
data/Gemfile.lock CHANGED
@@ -1,7 +1,14 @@
1
+ GIT
2
+ remote: https://github.com/drbrain/net-http-persistent.git
3
+ revision: 857c3baaa541644fa437328b535042a500414119
4
+ specs:
5
+ net-http-persistent (4.0.1)
6
+ connection_pool (~> 2.2)
7
+
1
8
  PATH
2
9
  remote: .
3
10
  specs:
4
- url_common (0.1.2)
11
+ url_common (0.1.3)
5
12
  fuzzyurl (~> 0.9.0)
6
13
  mechanize (~> 2.6)
7
14
 
@@ -9,11 +16,12 @@ GEM
9
16
  remote: https://rubygems.org/
10
17
  specs:
11
18
  byebug (11.1.3)
12
- connection_pool (2.2.3)
19
+ connection_pool (2.2.5)
13
20
  diff-lcs (1.4.4)
14
21
  domain_name (0.5.20190701)
15
22
  unf (>= 0.0.5, < 1.0.0)
16
23
  fuzzyurl (0.9.0)
24
+ hpricot (0.8.6)
17
25
  http-cookie (1.0.3)
18
26
  domain_name (~> 0.5)
19
27
  mechanize (2.7.6)
@@ -30,8 +38,6 @@ GEM
30
38
  mime-types-data (3.2020.0512)
31
39
  mini_portile2 (2.4.0)
32
40
  net-http-digest_auth (1.4.1)
33
- net-http-persistent (4.0.0)
34
- connection_pool (~> 2.2)
35
41
  nokogiri (1.10.10)
36
42
  mini_portile2 (~> 2.4.0)
37
43
  ntlm-http (0.1.1)
@@ -52,6 +58,7 @@ GEM
52
58
  unf (0.1.4)
53
59
  unf_ext
54
60
  unf_ext (0.0.7.7)
61
+ webrick (1.7.0)
55
62
  webrobots (0.1.2)
56
63
 
57
64
  PLATFORMS
@@ -60,13 +67,16 @@ PLATFORMS
60
67
  DEPENDENCIES
61
68
  byebug
62
69
  fuzzyurl (~> 0.9.0)
63
- mechanize (~> 2.6)
70
+ hpricot (~> 0.8.6)
71
+ mechanize (~> 2.7)
72
+ net-http-persistent!
64
73
  rake (~> 12.0)
65
74
  rspec (~> 3.0)
66
75
  url_common!
76
+ webrick (~> 1.7)
67
77
 
68
78
  RUBY VERSION
69
- ruby 2.7.1p83
79
+ ruby 3.1.2p20
70
80
 
71
81
  BUNDLED WITH
72
82
  2.1.4
@@ -1,3 +1,3 @@
1
1
  module UrlCommon
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/url_common.rb CHANGED
@@ -30,6 +30,17 @@ module UrlCommon
30
30
  end
31
31
  end
32
32
 
33
+ # UrlCommon.parse_fid_from_amazon_url("https://www.amazon.com/Original-GEN-2-0-Screwdriver-Industrial-Technician/dp/B0845919P2/?_encoding=UTF8&pd_rd_w=cekvo&content-id=amzn1.sym.bbb6bbd8-d236-47cb-b42f-734cb0cacc1f&pf_rd_p=bbb6bbd8-d236-47cb-b42f-734cb0cacc1f&pf_rd_r=3WP00V89EKYCQ1PB16VY&pd_rd_wg=HlQVt&pd_rd_r=30b33abe-2010-435e-b2cc-338f2ffbf3cf&ref_=pd_gw_ci_mcx_mi")
34
+ def self.parse_fid_from_amazon_url(url)
35
+ tmp = /\/dp\/([A-Za-z0-9]+)/.match(url)
36
+ if tmp && tmp[1]
37
+ return tmp[1]
38
+ else
39
+ return nil
40
+ end
41
+ end
42
+
43
+
33
44
  def self.parse_country_from_itunes_url(url)
34
45
  country = /https?:\/\/itunes\.apple\.com\/(..)\//.match(url)
35
46
  if country
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: url_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Johnson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-28 00:00:00.000000000 Z
11
+ date: 2022-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fuzzyurl
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.1.2
87
+ rubygems_version: 3.3.7
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: This is a class library designed for common url manipulation and crawling