url_scrubber 0.8.19 → 0.8.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/url_scrubber/version.rb +1 -1
- data/lib/url_scrubber.rb +11 -4
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4558673ef07349f4ae8fd577edfcf3b005ce6be12f022a6d52d008aacfd7cabd
|
4
|
+
data.tar.gz: a0d715b3ec092791f73da84c9658ce030e1c71164e780b198c995bd7b04838fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6345f6aba2066b3d5a31f9b2be28f0fd84ccf9268c3782000a51a35495c99c970a458933503b699b237e909d879b00501bbf6cba3ed2be5f87570278de6e9f56
|
7
|
+
data.tar.gz: 59e7fcb1077c9a5488b03553ea2df050ff063c1f10d83bffeb094d04b4d6fea3dcaed3ab3de426b0732590827ac3f3219d90c1dfd9ebd07dfbb000f740c79444
|
data/lib/url_scrubber/version.rb
CHANGED
data/lib/url_scrubber.rb
CHANGED
@@ -9,10 +9,11 @@ module UrlScrubber
|
|
9
9
|
def self.scrub(url)
|
10
10
|
return url if url.blank?
|
11
11
|
return url if /^app:\/\//.match(url) # Do not scrub app-only URLs
|
12
|
+
return url if /^https?:\/\/(www.)?business.tiktok\.com\/manage\//.match(url) # Don't scrub tik tok business manager urls, quick fix until we can implement a different solution, https://business.tiktok.com/manage/overview?org_id=6974497704617492482
|
12
13
|
|
13
14
|
url = url.clone # don't modify the original argument
|
14
15
|
|
15
|
-
m = url.match(/(htt?ps?:\/\/\S
|
16
|
+
m = url.match(/(htt?ps?:\/\/\S+)/i)
|
16
17
|
return nil unless m
|
17
18
|
|
18
19
|
url = m[1]
|
@@ -119,9 +120,11 @@ module UrlScrubber
|
|
119
120
|
return url.include?('http://linkedin.com/in/') || url.include?('http://linkedin.com/pub/')
|
120
121
|
end
|
121
122
|
|
122
|
-
|
123
|
+
|
123
124
|
def self.find_identity_from_url(url)
|
124
|
-
|
125
|
+
return nil unless url.present?
|
126
|
+
url = UrlScrubber.scrub(url)
|
127
|
+
url ? url.split("/").last : nil
|
125
128
|
end
|
126
129
|
|
127
130
|
|
@@ -179,7 +182,11 @@ module UrlScrubber
|
|
179
182
|
|
180
183
|
def self.downcase_domain(url)
|
181
184
|
domain_match = url.match(%r{http://[^/]+}i)
|
182
|
-
|
185
|
+
if domain_match
|
186
|
+
domain_match[0].downcase + domain_match.post_match
|
187
|
+
else
|
188
|
+
url
|
189
|
+
end
|
183
190
|
end
|
184
191
|
|
185
192
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url_scrubber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Langton
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2021-09-02 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rspec
|
@@ -125,8 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
|
-
|
129
|
-
rubygems_version: 2.7.8
|
128
|
+
rubygems_version: 3.0.6
|
130
129
|
signing_key:
|
131
130
|
specification_version: 4
|
132
131
|
summary: Clean up URLs.
|