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 +4 -4
- data/Gemfile +7 -2
- data/Gemfile.lock +16 -6
- data/lib/url_common/version.rb +1 -1
- data/lib/url_common.rb +11 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab8c804a828390106ee6e442cd46362ef5648ff9d41d36317f2644cb9f21e15
|
4
|
+
data.tar.gz: 7d6068a766ed82a3c4fe724fe426549c9c56047acbf373eb46d87aba763dfab0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "
|
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.
|
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.
|
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
|
-
|
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
|
79
|
+
ruby 3.1.2p20
|
70
80
|
|
71
81
|
BUNDLED WITH
|
72
82
|
2.1.4
|
data/lib/url_common/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|