url_scrubber 0.8.25 → 0.8.27
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/lib/url_scrubber/version.rb +1 -1
- data/lib/url_scrubber.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb367d57777b8375f82beb4cb46f964c28c5cb7ed47b8825901115d379f47b79
|
|
4
|
+
data.tar.gz: 4ad2eff095634f9f1ff45776008d9773e00a8541d9ebcdd3acc0a78f7de9cf51
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: caed9b0d395f5eda4bbb5a0953a6e3986feb3cf1c977e25acef317431406c21d80c6b037025c4f122601dcea12b7f11612b8fff3991a83942134798233a4f863
|
|
7
|
+
data.tar.gz: 2c96638554cfe6ae3b117748c77dc9df672fdf34bd913deb186b3ff121c4736519cc3b90909170ea17d12a41668eef2e33201912c455c5cacc3e08c151652d8d
|
data/lib/url_scrubber/version.rb
CHANGED
data/lib/url_scrubber.rb
CHANGED
|
@@ -10,6 +10,8 @@ module UrlScrubber
|
|
|
10
10
|
return url if url.blank?
|
|
11
11
|
return url if /^app:\/\//.match(url) # Do not scrub app-only URLs
|
|
12
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
|
|
13
|
+
return url if /^http(s)?:\/\/(.+\.)?youtube\.com\/watch\?v=(?<vid>[^&]+)/i.match(url) # Don't scrub youtube video urls, just let it through!
|
|
14
|
+
|
|
13
15
|
|
|
14
16
|
url = url.clone # don't modify the original argument
|
|
15
17
|
|
|
@@ -164,7 +166,7 @@ module UrlScrubber
|
|
|
164
166
|
scrubbed = scrub(url)
|
|
165
167
|
parsed = URI.parse(URI.escape(url)) or return nil
|
|
166
168
|
host = Domainatrix.parse(parsed.host)
|
|
167
|
-
if host.domain == "facebook" && host.subdomain == "business"
|
|
169
|
+
if host.domain == "facebook" && host.subdomain == "business" && scrubbed.exclude?("/settings/business_info")
|
|
168
170
|
public_url = scrubbed.sub("http://business.facebook.com", "http://facebook.com")
|
|
169
171
|
elsif host.domain == "google" && host.subdomain == "business"
|
|
170
172
|
public_url = scrubbed.sub("http://business.google.com", "http://plus.google.com")
|
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.27
|
|
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: 2026-04-22 00:00:00.000000000 Z
|
|
16
16
|
dependencies:
|
|
17
17
|
- !ruby/object:Gem::Dependency
|
|
18
18
|
name: rspec
|