facebook-cli 1.5.5 → 1.6.0
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.
- checksums.yaml +4 -4
- data/lib/fbcli.rb +15 -9
- data/lib/fbcli/facebook.rb +6 -6
- data/lib/fbcli/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 063a8bcc4bb4a962c80ac15e05ec2499925eefa3
|
4
|
+
data.tar.gz: 151c977f71edbe195bd03c25c662054a4cf176fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9696c883248c1ef9046207d33eddfe86193143575c9d9493f109eb0e295a092c4e179b55433b521c177cb68375a312fa1b874c1aa8f232da3ae585b690b05a58
|
7
|
+
data.tar.gz: '095299b209206ad56fa53bb0dfb00753e79a137b9e357b1320b3977809fb6c920361cef4b98edc88a4d2da19bdc69030e8b533b3de62c148b7092fc5b5c002a3'
|
data/lib/fbcli.rb
CHANGED
@@ -259,28 +259,32 @@ command :links do |c|
|
|
259
259
|
end
|
260
260
|
end
|
261
261
|
|
262
|
-
|
262
|
+
TO_FLAG_DESC = 'ID or alias of page or group to post to (use "me" for timeline)'
|
263
|
+
TO_COMMAND_DESC = 'to your timeline, a page or a group'
|
264
|
+
|
265
|
+
desc "Post a message or image " + TO_COMMAND_DESC
|
263
266
|
arg_name "message"
|
264
267
|
long_desc %(
|
265
|
-
Facebook
|
268
|
+
Facebook recommends: photos should be less than 4 MB and saved as JPG, PNG, GIF or TIFF files.
|
266
269
|
)
|
267
270
|
command :post do |c|
|
271
|
+
c.flag [:to], :desc => TO_FLAG_DESC, :default_value => 'me'
|
268
272
|
c.flag [:i, :image], :desc => 'File or URL of image to post'
|
269
273
|
c.action do |global_options, options, args|
|
270
274
|
if not options['image'].nil?
|
271
|
-
full_post_id = FBCLI::publish_image args[0], options['image']
|
275
|
+
full_post_id = FBCLI::publish_image options['to'], args[0], options['image']
|
272
276
|
else
|
273
|
-
full_post_id = FBCLI::publish_post args[0]
|
277
|
+
full_post_id = FBCLI::publish_post options['to'], args[0]
|
274
278
|
end
|
275
279
|
|
276
280
|
puts "Your post: #{link_to_post full_post_id}"
|
277
281
|
end
|
278
282
|
end
|
279
283
|
|
280
|
-
desc "Post a video
|
284
|
+
desc "Post a video " + TO_COMMAND_DESC
|
281
285
|
arg_name "message"
|
282
286
|
long_desc %(
|
283
|
-
Facebook
|
287
|
+
Facebook recommends: aspect ratio must be between 9x16 and 16x9. The following formats are
|
284
288
|
supported:
|
285
289
|
|
286
290
|
3g2, 3gp, 3gpp, asf, avi, dat, divx, dv, f4v, flv, m2ts, m4v,
|
@@ -288,10 +292,11 @@ long_desc %(
|
|
288
292
|
ts, vob, and wmv
|
289
293
|
)
|
290
294
|
command :postvideo do |c|
|
295
|
+
c.flag [:to], :desc => TO_FLAG_DESC, :default_value => 'me'
|
291
296
|
c.flag [:v, :video], :desc => 'File or URL of video'
|
292
297
|
c.flag [:t, :title], :desc => 'Title'
|
293
298
|
c.action do |global_options, options, args|
|
294
|
-
video_id = FBCLI::publish_video args[0], options['video'], options['title']
|
299
|
+
video_id = FBCLI::publish_video options['to'], args[0], options['video'], options['title']
|
295
300
|
puts "Your post: #{link video_id}"
|
296
301
|
puts "Edit your video: #{link "video/edit/?v=#{video_id}"}"
|
297
302
|
puts
|
@@ -299,9 +304,10 @@ command :postvideo do |c|
|
|
299
304
|
end
|
300
305
|
end
|
301
306
|
|
302
|
-
desc "Post a link
|
307
|
+
desc "Post a link " + TO_COMMAND_DESC
|
303
308
|
arg_name "url"
|
304
309
|
command :postlink do |c|
|
310
|
+
c.flag [:to], :desc => TO_FLAG_DESC, :default_value => 'me'
|
305
311
|
c.flag [:m, :message], :desc => 'Main message'
|
306
312
|
c.flag [:n, :name], :desc => 'Link name'
|
307
313
|
c.flag [:d, :description], :desc => 'Link description'
|
@@ -316,7 +322,7 @@ command :postlink do |c|
|
|
316
322
|
"picture" => options['image']
|
317
323
|
}
|
318
324
|
|
319
|
-
full_post_id = FBCLI::publish_post options['message'], link_metadata
|
325
|
+
full_post_id = FBCLI::publish_post options['to'], options['message'], link_metadata
|
320
326
|
|
321
327
|
puts "Your post: #{link_to_post full_post_id}"
|
322
328
|
end
|
data/lib/fbcli/facebook.rb
CHANGED
@@ -94,25 +94,25 @@ Run: #{APP_NAME} login
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
def self.publish_post(msg, link_metadata = {})
|
97
|
+
def self.publish_post(target, msg, link_metadata = {})
|
98
98
|
result = api_call lambda { |api|
|
99
|
-
api.put_wall_post(msg, link_metadata)
|
99
|
+
api.put_wall_post(msg, link_metadata, target)
|
100
100
|
}
|
101
101
|
|
102
102
|
result['id']
|
103
103
|
end
|
104
104
|
|
105
|
-
def self.publish_image(msg, image_file_or_url)
|
105
|
+
def self.publish_image(target, msg, image_file_or_url)
|
106
106
|
result = api_call lambda { |api|
|
107
|
-
api.put_picture(image_file_or_url, {:message => msg})
|
107
|
+
api.put_picture(image_file_or_url, {:message => msg}, target)
|
108
108
|
}
|
109
109
|
|
110
110
|
result['post_id']
|
111
111
|
end
|
112
112
|
|
113
|
-
def self.publish_video(msg, video_file_or_url, title = nil)
|
113
|
+
def self.publish_video(target, msg, video_file_or_url, title = nil)
|
114
114
|
result = api_call lambda { |api|
|
115
|
-
api.put_video(video_file_or_url, {:title => title, :description => msg})
|
115
|
+
api.put_video(video_file_or_url, {:title => title, :description => msg}, target)
|
116
116
|
}
|
117
117
|
|
118
118
|
result['id']
|
data/lib/fbcli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facebook-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ildar Sagdejev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: koala
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '3.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '3.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|