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 +4 -4
- data/lib/facebook_username_extractor.rb +4 -0
- data/lib/facebook_username_extractor/version.rb +1 -1
- 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: 255e1d6042f832b2f0a92db72ab71d2ae97848f1
|
4
|
+
data.tar.gz: 1968a0ad63158e8a5cb10abbfa32502a85f66559
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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?://}, '')
|
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.
|
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-
|
11
|
+
date: 2016-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|