url_scrubber 0.7.11 → 0.7.12
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 +16 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6ae9b76fdd2922fcee550e8fbaf31dd6eb0b68f
|
4
|
+
data.tar.gz: f8baf698401f55685a7d00d70971bf8ebca7182b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ca6fd80cded808748bafc296bc90c9a562374da6887c9ed0823c193ee79b09ddc82a322e958975fb169ca2038df6ac81d70e357e2e43a6d82fc9b921c631ff3
|
7
|
+
data.tar.gz: 5a67da704ed0ed900aaed96b01f1fd98b447b8fd0c2789c99d95f12b7eadfac149cbe274c1b62724ce02321a367aebdd86e6471f9ba85627c86c637252d544bf
|
data/lib/url_scrubber/version.rb
CHANGED
data/lib/url_scrubber.rb
CHANGED
@@ -133,14 +133,14 @@ module UrlScrubber
|
|
133
133
|
|
134
134
|
def self.special_cases(url)
|
135
135
|
case service_of(url)
|
136
|
-
when :youtube then return
|
137
|
-
when :twitter then return
|
138
|
-
when :facebook then return
|
139
|
-
when :linkedin then return
|
140
|
-
when :google then return
|
141
|
-
when :flickr then return
|
142
|
-
when :pinterest then return
|
143
|
-
when :yelp then return
|
136
|
+
when :youtube then return sc_youtube(url)
|
137
|
+
when :twitter then return sc_twitter(url)
|
138
|
+
when :facebook then return sc_facebook(url)
|
139
|
+
when :linkedin then return sc_linkedin(url)
|
140
|
+
when :google then return sc_google_plus(url)
|
141
|
+
when :flickr then return sc_flickr(url)
|
142
|
+
when :pinterest then return sc_pinterest(url)
|
143
|
+
when :yelp then return sc_yelp(url)
|
144
144
|
end
|
145
145
|
|
146
146
|
url
|
@@ -166,13 +166,13 @@ module UrlScrubber
|
|
166
166
|
url
|
167
167
|
end
|
168
168
|
|
169
|
-
def self.
|
169
|
+
def self.sc_youtube(url)
|
170
170
|
url.sub!('youtube.com/user/', 'youtube.com/')
|
171
171
|
url.sub!('youtube.com/profile?user=', 'youtube.com/')
|
172
172
|
url
|
173
173
|
end
|
174
174
|
|
175
|
-
def self.
|
175
|
+
def self.sc_twitter(url)
|
176
176
|
url.sub!('twitter.com/@', 'twitter.com/')
|
177
177
|
|
178
178
|
status_match = url.match(%r{(twitter\.com/[^/]+)/statuses/\d+})
|
@@ -188,7 +188,7 @@ module UrlScrubber
|
|
188
188
|
url
|
189
189
|
end
|
190
190
|
|
191
|
-
def self.
|
191
|
+
def self.sc_facebook(url)
|
192
192
|
if url.match("/media/albums") || url.match("/media/set")
|
193
193
|
url = url.match('\&') ? url.split('&',2)[0] : url
|
194
194
|
elsif url.include?("facebook.com/profile.php?id=")
|
@@ -202,7 +202,7 @@ module UrlScrubber
|
|
202
202
|
url
|
203
203
|
end
|
204
204
|
|
205
|
-
def self.
|
205
|
+
def self.sc_linkedin(url)
|
206
206
|
|
207
207
|
url.sub!('linkedin.com/companies/', 'linkedin.com/company/')
|
208
208
|
if !!url.match(%r{com/company/})
|
@@ -221,7 +221,7 @@ module UrlScrubber
|
|
221
221
|
url
|
222
222
|
end
|
223
223
|
|
224
|
-
def self.
|
224
|
+
def self.sc_google_plus(url)
|
225
225
|
url.sub!('com/u/0/b/', 'com/')
|
226
226
|
url.sub!('com/u/0/', 'com/')
|
227
227
|
url.sub!('com/b/', 'com/')
|
@@ -235,18 +235,18 @@ module UrlScrubber
|
|
235
235
|
"http://plus.google.com/#{path_match[1]}"
|
236
236
|
end
|
237
237
|
|
238
|
-
def self.
|
238
|
+
def self.sc_flickr(url)
|
239
239
|
user_match = url.match(%r{flickr\.com/(photos/|people/)?([^/]+)})
|
240
240
|
return url unless user_match
|
241
241
|
|
242
242
|
"http://flickr.com/#{user_match[2]}"
|
243
243
|
end
|
244
244
|
|
245
|
-
def self.
|
245
|
+
def self.sc_pinterest(url)
|
246
246
|
url
|
247
247
|
end
|
248
248
|
|
249
|
-
def self.
|
249
|
+
def self.sc_yelp(url)
|
250
250
|
url
|
251
251
|
end
|
252
252
|
|
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.
|
4
|
+
version: 0.7.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colin Langton
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-02-
|
14
|
+
date: 2014-02-27 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rspec
|