url_scrubber 0.8.8 → 0.8.9

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTg0Y2U4MGIxODA2ODYyNDYzMDUyMGZjYmY4MWYwNTlmNGI3YjI3Mg==
4
+ NTkxZGQ1NmRjZDMxMjNmOWViNzlhNzc3Yzg4N2Q1YjRmMmQzY2Y0Yg==
5
5
  data.tar.gz: !binary |-
6
- NTM3YWVhMzFkMDc0ZDI0NTdlYjQyZmIyYmEwYWU5ZDI5YzQ3ZWY5Nw==
6
+ Mzc1NmFhOTMxZjg5YjdjZjc4OTRiMWEyYWU4OWEwNzVhYTIxZjZlYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDVmZDhjYjllZTNkOWIyNjIyMTIxMWIyYjAyZjAzM2M4NTRlMTA1MDczM2M0
10
- MjJkMjJiOTYyZmNkNmMxODE2YmIxYjVkYmFmY2QwZDgxZjgyNGMwZGVhNjRi
11
- NzdkNGM3YmFmZjFhOTFjNTI0YjZiMjlmNTc4YzcxOWZjZmI3YTI=
9
+ YWRjNzU4YjM4OWE3NzE5MjIxOWNlMjMxMTg3YmY1OGM5NTlhMzdjMTUwN2Vl
10
+ MmNmZjk1ODMzZWY1MGJlYTYwNWEzZDVjZjAwMGFiZjIyY2I0ZWI0Y2VlYjc5
11
+ OTgyOGYzZmU0ZTEwNWY2YTFlYzQwN2IyZWQ2MDBkN2M0Y2NmOTI=
12
12
  data.tar.gz: !binary |-
13
- YjczOTUwYjQyNzI3MDVjOTQxNTVmMjhlMTkyZjNjNjQzYzgwOTMxYTA2YzBk
14
- MzY1ODgzYjE1ZDFmYmNhNWQ2OWNlODhhNDc4ZDIyMDI4MTA5NTdkYjRiM2Q1
15
- MGRkZjA3MGY1ZmU0MDdiNjk1MDM2YWQxNTIwMWJjZDcxN2YxZDc=
13
+ NGY0ZDRiNGQ1NjM4ZTc5NmIxMTZkNWQyZmVkY2YyNTE0MWU4Y2VlZmQ2MmJj
14
+ MzY4ODYzM2I2MGE3ZjliZmY3ZGZiZGFlODE3Y2JhZjZlZTM3NDMwZTlkNTU3
15
+ ODg3MjczYmVjOWUxMDhiMWNlODJmMTRkZGM2NjQ4NWE4NWIyZDA=
@@ -1,3 +1,3 @@
1
1
  module UrlScrubber
2
- VERSION = "0.8.8"
2
+ VERSION = "0.8.9"
3
3
  end
data/lib/url_scrubber.rb CHANGED
@@ -280,10 +280,10 @@ module UrlScrubber
280
280
 
281
281
  def self.sc_facebook(url)
282
282
  #puts "sc_facebook: #{url}"
283
- regex1 = /^(?<url>(https?:\/\/)((www|business)\.)?facebook\.com\/(pages\/)*(?<uname>.*)[\/-](?<uid>[0-9]+))($|\/|\/(about|timeline|info|app_)?)/i
283
+ regex1 = /^(?<url>(https?:\/\/)((www|business)\.)?facebook\.com\/((pages|pg)\/)*(?<uname>.*)[\/-](?<uid>[0-9]+))($|\/|\/(about|timeline|info|app_)?)/i
284
284
  regex2 = /^(?<url>(https?:\/\/)((www|business)\.)?facebook\.com\/profile.php\?id=(?<uid>[0-9]+))($|\/|\/.*|&.*)/i
285
285
  regex2a = /^(?<url>(https?:\/\/)((www|business)\.)?facebook\.com\/profile.php\?_rdr=p&id=(?<uid>[0-9]+))($|\/|\/.*|&.*)/i
286
- regex3 = /^(?<url>(https?:\/\/)((www|business)\.)?facebook\.com\/(?<uname>[^\?\/]*))($|\/$|\/(about|timeline|info|app_.*)?)/i
286
+ regex3 = /^(?<url>(https?:\/\/)((www|business)\.)?facebook\.com\/(pg\/)*(?<uname>[^\?\/]*))($|\/$|\/(about|timeline|info|app_.*)?)/i
287
287
  regex4 = /^(?<url>(https?:\/\/)((www|business)\.)?facebook\.com\/)(?<php>home.php\?([#!]+\/)*)(?<uname>.*)/i
288
288
 
289
289
  # If the user gives us a path to a Post, "http://facebook.com/LoansByJanet/posts/1691075027771418"
@@ -322,8 +322,9 @@ module UrlScrubber
322
322
  elsif mdata = url.match(regex3)
323
323
  # puts "regex3"
324
324
  # "http://facebook.com/TonyMollHomeLoans/timeline"
325
- if mdata[:uname] != "pages"
326
- url = mdata[:url]
325
+ # "http://facebook.com/pg/TonyMollHomeLoans/timeline"
326
+ if ["pages", "pg"].exclude?(mdata[:uname])
327
+ url = "http://facebook.com/" + mdata[:uname]
327
328
  uname = mdata[:uname]
328
329
  end
329
330
  url = drop_url_query!(url)
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.8
4
+ version: 0.8.9
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: 2017-09-13 00:00:00.000000000 Z
14
+ date: 2018-01-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rspec