faceoff 1.0.0 → 1.0.1
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/History.txt +9 -1
- data/lib/faceoff.rb +13 -6
- metadata +20 -6
data/History.txt
CHANGED
data/lib/faceoff.rb
CHANGED
@@ -31,7 +31,7 @@ class Faceoff
|
|
31
31
|
|
32
32
|
|
33
33
|
# Version of the gem.
|
34
|
-
VERSION = '1.0.
|
34
|
+
VERSION = '1.0.1'
|
35
35
|
|
36
36
|
# Command line actions available.
|
37
37
|
ACTIONS = %w{albums friends notes photos_of_me profile_pictures videos_of_me}
|
@@ -110,15 +110,13 @@ your content in a reusable format.
|
|
110
110
|
options['dir'] = path
|
111
111
|
end
|
112
112
|
|
113
|
-
opt.on('-z', '--
|
114
|
-
options['
|
113
|
+
opt.on('-z', '--zip [NAME]', 'Zip content when done') do |name|
|
114
|
+
options['zip'] = name || true
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
118
|
opts.parse! argv
|
119
119
|
|
120
|
-
options['dir'] ||= "."
|
121
|
-
|
122
120
|
options['email'], options['password'] = argv
|
123
121
|
|
124
122
|
options
|
@@ -159,9 +157,11 @@ your content in a reusable format.
|
|
159
157
|
options['password'] = nil unless faceoff
|
160
158
|
end
|
161
159
|
|
160
|
+
directory = options['dir'] || "./#{email}"
|
161
|
+
|
162
162
|
ACTIONS.each do |action|
|
163
163
|
next unless options[action]
|
164
|
-
dir = File.join
|
164
|
+
dir = File.join directory, action.capitalize.gsub("_", " ")
|
165
165
|
|
166
166
|
faceoff.send(action, options[action]) do |item|
|
167
167
|
name = item.name rescue item.fid
|
@@ -169,6 +169,13 @@ your content in a reusable format.
|
|
169
169
|
item.save! dir
|
170
170
|
end
|
171
171
|
end
|
172
|
+
|
173
|
+
if options['zip']
|
174
|
+
zipfile = String === options['zip'] ? options['zip'] : directory
|
175
|
+
success = system "zip -u #{zipfile}.zip #{directory}/**/*"
|
176
|
+
|
177
|
+
FileUtils.rm_rf directory if success
|
178
|
+
end
|
172
179
|
end
|
173
180
|
|
174
181
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jeremie Castagna
|
@@ -73,7 +73,7 @@ dependencies:
|
|
73
73
|
type: :runtime
|
74
74
|
version_requirements: *id004
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: rubyforge
|
77
77
|
prerelease: false
|
78
78
|
requirement: &id005 !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
@@ -81,11 +81,25 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
segments:
|
83
83
|
- 2
|
84
|
-
-
|
85
|
-
-
|
86
|
-
version: 2.
|
84
|
+
- 0
|
85
|
+
- 4
|
86
|
+
version: 2.0.4
|
87
87
|
type: :development
|
88
88
|
version_requirements: *id005
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: hoe
|
91
|
+
prerelease: false
|
92
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
segments:
|
97
|
+
- 2
|
98
|
+
- 6
|
99
|
+
- 1
|
100
|
+
version: 2.6.1
|
101
|
+
type: :development
|
102
|
+
version_requirements: *id006
|
89
103
|
description: |-
|
90
104
|
A scraper to backup your facebook account (albums, photos, notes, users, video).
|
91
105
|
Why a scraper instead of using facebook apps? Logging in as a user gives you
|