email2face 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -0
- data/VERSION +1 -1
- data/email2face.gemspec +1 -1
- data/lib/email2face.rb +5 -4
- metadata +2 -2
data/README.md
CHANGED
@@ -45,6 +45,12 @@ Then, we just give Email2Face the email we want a face for:
|
|
45
45
|
require 'email2face'
|
46
46
|
Email2Face.face("jarred.sumner@facebook.com")
|
47
47
|
```
|
48
|
+
It'll return something like:
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
http://graph.facebook.com/jarred.sumner/picture
|
52
|
+
```
|
53
|
+
|
48
54
|
|
49
55
|
### Changing the Facebook Account
|
50
56
|
It's unlikely the included Facebook account will work for long. So, you may need to make a fake Facebook for it. Do not use your own because it's possible that Facebook may ban it.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/email2face.gemspec
CHANGED
data/lib/email2face.rb
CHANGED
@@ -9,7 +9,7 @@ class Email2Face
|
|
9
9
|
# This is why you should make a fake Facebook account.
|
10
10
|
@@username = FAKE_FACEBOOK_USERNAME
|
11
11
|
@@password = FAKE_FACEBOOK_PASSWORD
|
12
|
-
|
12
|
+
|
13
13
|
|
14
14
|
def self.username
|
15
15
|
@@username
|
@@ -40,6 +40,7 @@ class Email2Face
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.face_html(email)
|
43
|
+
Email2Face.configure_capybara
|
43
44
|
Headless.ly do
|
44
45
|
browser = Capybara::Session.new(:webkit, browser)
|
45
46
|
#self.driver.header("User-Agent", CHROME_USER_AGENT)
|
@@ -52,7 +53,7 @@ class Email2Face
|
|
52
53
|
if browser.driver.cookies["c_user", ".facebook.com"]
|
53
54
|
url = "https://www.facebook.com/search/results.php?o=2048&init=s%3Aemail&q=#{ email.sub("@", "%40") }"
|
54
55
|
browser.visit url
|
55
|
-
|
56
|
+
browser.html
|
56
57
|
else
|
57
58
|
login_failed!
|
58
59
|
end
|
@@ -70,10 +71,10 @@ class Email2Face
|
|
70
71
|
uri = URI.parse(href)
|
71
72
|
uri.host = "graph.facebook.com"
|
72
73
|
uri.path = uri.path + "/picture"
|
73
|
-
raise if uri.path.include?("profile.php")
|
74
|
+
raise if uri.path.include?("profile.php") || href == nil
|
74
75
|
uri.to_s
|
75
76
|
rescue
|
76
|
-
"I couldn't find a face for that email :("
|
77
|
+
"I couldn't find a face for that email :(. It's also possible that Facebook has asked for a security check on that account, which means that you should sign in and perform the security check."
|
77
78
|
end
|
78
79
|
|
79
80
|
def self.configure_capybara
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: email2face
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -176,7 +176,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
176
176
|
version: '0'
|
177
177
|
segments:
|
178
178
|
- 0
|
179
|
-
hash: -
|
179
|
+
hash: -893557933
|
180
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
181
|
none: false
|
182
182
|
requirements:
|