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.
Files changed (3) hide show
  1. data/History.txt +9 -1
  2. data/lib/faceoff.rb +13 -6
  3. metadata +20 -6
@@ -1,4 +1,12 @@
1
- === 1.0.0 / 2010-05-11
1
+ === 1.0.1 / 2010-08-10
2
+
3
+ * Bugfixes
4
+
5
+ * Added zip support.
6
+
7
+ * Added default directory to download content to.
8
+
9
+ === 1.0.0 / 2010-08-10
2
10
 
3
11
  * 1 major enhancement
4
12
 
@@ -31,7 +31,7 @@ class Faceoff
31
31
 
32
32
 
33
33
  # Version of the gem.
34
- VERSION = '1.0.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', '--gzip [NAME]', 'Zip content when done') do |name|
114
- options['gzip'] = name || true
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 options['dir'], action.capitalize.gsub("_", " ")
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
- - 0
9
- version: 1.0.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: hoe
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
- - 3
85
- - 3
86
- version: 2.3.3
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