url_scrubber 0.7.14 → 0.7.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module UrlScrubber
2
- VERSION = "0.7.14"
2
+ VERSION = "0.7.15"
3
3
  end
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_-]+|profile/view\?id=\d+)$}) || !!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_-]+)$})
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 && linkedin_personal_url?(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=')
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.7.14
4
+ version: 0.7.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: