email2face 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +12 -6
  2. data/VERSION +1 -1
  3. data/email2face.gemspec +1 -1
  4. data/lib/email2face.rb +16 -11
  5. 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
- To install it on Mac OS X run (with Homebrew):
13
+ #### Install it on Mac OS X:
14
14
 
15
15
  ```bash
16
- $ brew install qt4
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
- To install it on Arch Linux run:
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
- To install it on Ubuntu run:
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("the.email.i.use.to.sign.into.facebook@example.com", { :username => "my.fake.facebook@example.com", :password => "123456" })
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
- You only need to pass in the fake Facebook the first time you run it. Afterwards, it'll store the account details.
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
1
+ 0.0.2
data/email2face.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "email2face"
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jarred Sumner"]
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
- "Sandvich"
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[:username]
36
- self.password = json[:password]
37
- self.verbose = options[:verbose]
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
- puts "Email2Face requires a Facebook account to search for faces. Don't use a Facebook account that matters."
43
- puts "Usage: Email2Face.face(email, { :username => USERNAME, :password => PASSWORD } )"
44
- puts "Afterwards, I'll store thlse Facebook account, so you don't have to do this everytime."
45
- exit(0)
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
- File.new(Email2Face.filepath, "w") unless File.exists?(Email2Face.filepath)
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.1
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: -181464691
195
+ hash: -15428611
196
196
  required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  none: false
198
198
  requirements: