url_scrubber 0.7.14 → 0.7.15
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.
- data/lib/url_scrubber/version.rb +1 -1
- data/lib/url_scrubber.rb +9 -4
- metadata +1 -1
data/lib/url_scrubber/version.rb
CHANGED
data/lib/url_scrubber.rb
CHANGED
@@ -57,7 +57,7 @@ module UrlScrubber
|
|
57
57
|
end
|
58
58
|
|
59
59
|
:other
|
60
|
-
end
|
60
|
+
end
|
61
61
|
|
62
62
|
def self.ideal_form?(url)
|
63
63
|
url = scrub(url)
|
@@ -71,7 +71,7 @@ module UrlScrubber
|
|
71
71
|
when :facebook
|
72
72
|
!!url.match(%r{^http://facebook\.com/(profile\.php?id=\d+|[\w_\.-]+)$})
|
73
73
|
when :linkedin
|
74
|
-
!!url.match(%r{^http://linkedin\.com/(in/[\w_-]
|
74
|
+
!!url.match(%r{^http://linkedin\.com/pub/[\w-]+/[\w]+/[\w]+/[\w]+$}) || !!url.match(%r{^http://linkedin\.com/in/[\w_-]+$}) || !!url.match(%r{^http://linkedin\.com/(company/[\w_-]+|profile/view\?id=\d+)$}) || !!url.match(%r{^http://linkedin\.com/(groups\?gid=[0-9]+)$}) || !!url.match(%r{^http://linkedin\.com/(groups/[\w_-]+)$})
|
75
75
|
when :google
|
76
76
|
!!url.match(%r{^http://plus\.google\.com/(\+[\w_-]+|\d+)$})
|
77
77
|
when :slideshare
|
@@ -103,7 +103,7 @@ module UrlScrubber
|
|
103
103
|
def self.linkedin_personal_url?(url)
|
104
104
|
url = scrub(url)
|
105
105
|
return false unless url
|
106
|
-
return url.include?('http://linkedin.com/in/')
|
106
|
+
return url.include?('http://linkedin.com/in/') || url.include?('http://linkedin.com/pub/')
|
107
107
|
end
|
108
108
|
|
109
109
|
def self.find_identity_from_url(url)
|
@@ -115,8 +115,11 @@ module UrlScrubber
|
|
115
115
|
scrubbed_url = scrub(url)
|
116
116
|
if scrubbed_url && linkedin_company_url?(scrubbed_url)
|
117
117
|
scrubbed_url.split("/").last
|
118
|
-
elsif scrubbed_url &&
|
118
|
+
elsif scrubbed_url && scrubbed_url.include?('http://linkedin.com/in/')
|
119
119
|
scrubbed_url.split("/").last
|
120
|
+
elsif scrubbed_url && scrubbed_url.include?('http://linkedin.com/pub/')
|
121
|
+
id_partition = scrubbed_url.partition('linkedin.com/pub/')
|
122
|
+
drop_url_ampersand!(id_partition[2])
|
120
123
|
elsif scrubbed_url.include?('linkedin.com/groups/')
|
121
124
|
scrubbed_url.split("/").last
|
122
125
|
elsif scrubbed_url.include?('linkedin.com/groups?gid=')
|
@@ -227,6 +230,8 @@ module UrlScrubber
|
|
227
230
|
drop_url_query!(url)
|
228
231
|
elsif !!url.match(%r{com/in/})
|
229
232
|
drop_url_query!(url)
|
233
|
+
elsif !!url.match(%r{com/pub/})
|
234
|
+
drop_url_query!(url)
|
230
235
|
elsif url.include?('linkedin.com/groups/')
|
231
236
|
drop_url_query!(url)
|
232
237
|
elsif url.include?('linkedin.com/groups?gid=')
|