email2face 0.0.1 → 0.0.2
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.
- data/README.md +12 -6
- data/VERSION +1 -1
- data/email2face.gemspec +1 -1
- data/lib/email2face.rb +16 -11
- metadata +2 -2
data/README.md
CHANGED
@@ -10,19 +10,20 @@ It needs a Facebook account to work. I *do not* recommend using your own Faceboo
|
|
10
10
|
|
11
11
|
You need to have Xvfb and QTWebkit installed in order to use this.
|
12
12
|
|
13
|
-
|
13
|
+
#### Install it on Mac OS X:
|
14
14
|
|
15
15
|
```bash
|
16
|
-
$ brew install
|
16
|
+
$ brew install qt
|
17
17
|
```
|
18
|
+
Then, download and install [XQuartz](http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.1.dmg).
|
18
19
|
|
19
|
-
|
20
|
+
#### Install it on Arch Linux:
|
20
21
|
|
21
22
|
```bash
|
22
23
|
$ sudo pacman -S xorg-server-xvfb qtwebkit
|
23
24
|
```
|
24
25
|
|
25
|
-
|
26
|
+
#### Install it on Ubuntu:
|
26
27
|
|
27
28
|
```bash
|
28
29
|
$ sudo apt-get install xvfb libqtwebkit4 libqtwebkit4-dev
|
@@ -42,8 +43,13 @@ Then, we pass in the email, with the Facebook account in a hash:
|
|
42
43
|
|
43
44
|
```ruby
|
44
45
|
require 'email2face'
|
45
|
-
Email2Face.face("
|
46
|
+
Email2Face.face("my.email@facebook.com")
|
46
47
|
```
|
48
|
+
I've included a fake Facebook by default. However, it could be disabled at any time.
|
47
49
|
|
48
|
-
|
50
|
+
When you want to change the Facebook account, just run
|
49
51
|
|
52
|
+
```ruby
|
53
|
+
require 'email2face'
|
54
|
+
Email2Face.face("my.email@facebook.com", { :username => "fb_account@example.com", :password => "fbpassword" })
|
55
|
+
```
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/email2face.gemspec
CHANGED
data/lib/email2face.rb
CHANGED
@@ -7,7 +7,7 @@ class Email2Face
|
|
7
7
|
attr_accessor :username, :password, :verbose
|
8
8
|
|
9
9
|
def self.filepath
|
10
|
-
"
|
10
|
+
"#{ENV["HOME"]}/.sandvich"
|
11
11
|
end
|
12
12
|
|
13
13
|
CHROME_USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.41 Safari/536.5
|
@@ -23,7 +23,7 @@ class Email2Face
|
|
23
23
|
user.verbose = options[:verbose]
|
24
24
|
end
|
25
25
|
if user.username.nil? || user.username == "" || user.password.nil? || user.password == ""
|
26
|
-
user.no_login_details
|
26
|
+
user.no_login_details(email)
|
27
27
|
end
|
28
28
|
html = user.face_html(email)
|
29
29
|
return user.face(html)
|
@@ -32,17 +32,18 @@ class Email2Face
|
|
32
32
|
def load_auth_from_disk(options)
|
33
33
|
if File.exists?(Email2Face.filepath)
|
34
34
|
json = JSON.parse(File.open(Email2Face.filepath, "r").read)
|
35
|
-
self.username = json[
|
36
|
-
self.password = json[
|
37
|
-
self.verbose = options[
|
35
|
+
self.username = json["username"]
|
36
|
+
self.password = json["password"]
|
37
|
+
self.verbose = options["verbose"]
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
def no_login_details
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
def no_login_details(email)
|
42
|
+
options = {}
|
43
|
+
options[:username] = 'anmail@email2face.net'
|
44
|
+
options[:password] = 'thisisapassword'
|
45
|
+
puts "You didn't specify a Facebook account, so I set you up with a fake Facebook account that might not work. When it stops working, just open up \"#{Email2Face.filepath}\" and change it there"
|
46
|
+
Email2Face.face(email, options)
|
46
47
|
end
|
47
48
|
|
48
49
|
def face_html(email)
|
@@ -70,7 +71,11 @@ class Email2Face
|
|
70
71
|
end
|
71
72
|
|
72
73
|
def login_success!
|
73
|
-
|
74
|
+
if File.exists?(Email2Face.filepath)
|
75
|
+
File.delete(Email2Face.filepath)
|
76
|
+
else
|
77
|
+
File.new(Email2Face.filepath, "w")
|
78
|
+
end
|
74
79
|
File.open(Email2Face.filepath, "w") do |f|
|
75
80
|
f.write(self.to_json)
|
76
81
|
end
|
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.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -192,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
192
192
|
version: '0'
|
193
193
|
segments:
|
194
194
|
- 0
|
195
|
-
hash: -
|
195
|
+
hash: -15428611
|
196
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
197
197
|
none: false
|
198
198
|
requirements:
|