facebook_username_extractor 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e610748b328f7d0494013fd16ba30f3abb395547
4
- data.tar.gz: c4e956337c46a04556895496a9db4ceb13c6600a
3
+ metadata.gz: 255e1d6042f832b2f0a92db72ab71d2ae97848f1
4
+ data.tar.gz: 1968a0ad63158e8a5cb10abbfa32502a85f66559
5
5
  SHA512:
6
- metadata.gz: 47ff88ed58427f96347167b870eb0b2363fd44e9d2d5cf3eba7c4b5a5dd974e142e602b47926e8555662872bf6c2319a06e68b0646f1a48c7060c39a59cac4be
7
- data.tar.gz: c3dc9c420d0b6b4f8170af8f34b1c677afaa4ad322105831662a77836ea551cfc80f9cdc6f7359fd1a31b602eb929824202a92b9abff82b90d5e6f7244dfce27
6
+ metadata.gz: 5c48b8a2fee8ea74af713e2759c25d7f44376e071b39906f9eb50110c210d7a5cdaaf18ef5a2a9be3612edc702e5ace0b92221ebd88f2c575403ee82ce19a395
7
+ data.tar.gz: 66f4542075cb6be6678db202d2ea7dd5ff66542bd2507adeefaa2b3f0c23bac6b0ccc0ddfee3d12834558b72e8a2b8df1045ffe4ca01fd0bb82f226c6b71692a
@@ -4,6 +4,10 @@ module FacebookUsernameExtractor
4
4
  def self.extract(page)
5
5
  return if page.to_s.empty?
6
6
  page = page.split(/(?=https?:)/).first
7
+ # Anything after #!
8
+ unless (matched = page.match /\#\!\/([^\?]+)/).nil?
9
+ return matched.captures.last
10
+ end
7
11
  return page[/profile.php\?id=(\w+)/, 1] if page.include? 'profile.php'
8
12
  page = page
9
13
  .sub(%r{^https?://}, '')
@@ -1,3 +1,3 @@
1
1
  module FacebookUsernameExtractor
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook_username_extractor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Mytton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-15 00:00:00.000000000 Z
11
+ date: 2016-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler